diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index a261a995f..131deab10 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -26,7 +26,7 @@ are also not included to prevent attackers from easily impersonating the XPipe a ## Modularity -All XPipe components target [Java 19](https://openjdk.java.net/projects/jdk/19/) and make full use of the Java Module System (JPMS). +All XPipe components target [Java 20](https://openjdk.java.net/projects/jdk/20/) and make full use of the Java Module System (JPMS). All components are modularized, including all their dependencies. In case a dependency is (sadly) not modularized yet, module information is manually added using [moditect](https://github.com/moditect/moditect-gradle-plugin). Further, note that as this is a pretty complicated Java project that fully utilizes modularity, @@ -42,6 +42,10 @@ This is due to the fact that some components are only included in the release ve XPipe is able to automatically detect your local installation and fetch the required components from it when it is run in a development environment. +You need to have GraalVM Community Edition for Java 20 installed as a JDK to compile the project. +If you are on Linux or macOS, you can easily accomplish that by running the `setup.sh` script. +On Windows, you have to manually install the JDK. + ## Building and Running You can use the gradle wrapper to build and run the project: diff --git a/app/src/main/java/io/xpipe/app/ext/DataStoreProvider.java b/app/src/main/java/io/xpipe/app/ext/DataStoreProvider.java index 3371cc017..ba8126981 100644 --- a/app/src/main/java/io/xpipe/app/ext/DataStoreProvider.java +++ b/app/src/main/java/io/xpipe/app/ext/DataStoreProvider.java @@ -35,6 +35,10 @@ public interface DataStoreProvider { default void preAdd(DataStore store) {} + default boolean shouldEdit() { + return false; + } + default Comp customDisplay(StoreSection s) { return new StandardStoreEntryComp(s.getWrapper(), null); } diff --git a/ext/base/src/main/java/io/xpipe/ext/base/action/EditStoreAction.java b/ext/base/src/main/java/io/xpipe/ext/base/action/EditStoreAction.java index 2a66da6d4..23c45d8f6 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/action/EditStoreAction.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/action/EditStoreAction.java @@ -3,6 +3,7 @@ package io.xpipe.ext.base.action; import io.xpipe.app.comp.store.GuiDsStoreCreator; import io.xpipe.app.core.AppI18n; import io.xpipe.app.ext.ActionProvider; +import io.xpipe.app.ext.DataStoreProviders; import io.xpipe.app.storage.DataStorage; import io.xpipe.app.storage.DataStoreEntry; import io.xpipe.core.store.DataStore; @@ -58,7 +59,8 @@ public class EditStoreAction implements ActionProvider { @Override public boolean isMajor(DataStore o) { - return false; + var provider = DataStoreProviders.byStore(o); + return provider.shouldEdit(); } @Override diff --git a/gradle/gradle_scripts/java.gradle b/gradle/gradle_scripts/java.gradle index dfea39f88..b29c363ad 100644 --- a/gradle/gradle_scripts/java.gradle +++ b/gradle/gradle_scripts/java.gradle @@ -1,6 +1,6 @@ tasks.withType(JavaCompile).configureEach { - sourceCompatibility = JavaVersion.VERSION_19 - targetCompatibility = JavaVersion.VERSION_19 + sourceCompatibility = JavaVersion.VERSION_20 + targetCompatibility = JavaVersion.VERSION_20 modularity.inferModulePath = true options.encoding = 'UTF-8' options.compilerArgs << "-Xlint:unchecked" @@ -18,7 +18,7 @@ tasks.withType(JavaExec).configureEach { javadoc{ source = sourceSets.main.allJava options { - addStringOption('-release', '19') + addStringOption('-release', '20') addStringOption('link', 'https://docs.oracle.com/en/java/javase/19/docs/api/') addBooleanOption('html5', true) addStringOption('Xdoclint:none', '-quiet') diff --git a/gradle/gradle_scripts/lombok.gradle b/gradle/gradle_scripts/lombok.gradle index d1cc1d4ed..ad4fe1d03 100644 --- a/gradle/gradle_scripts/lombok.gradle +++ b/gradle/gradle_scripts/lombok.gradle @@ -1,6 +1,6 @@ dependencies { - compileOnly 'org.projectlombok:lombok:1.18.26' - annotationProcessor 'org.projectlombok:lombok:1.18.26' - testCompileOnly 'org.projectlombok:lombok:1.18.26' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.26' + compileOnly 'org.projectlombok:lombok:1.18.28' + annotationProcessor 'org.projectlombok:lombok:1.18.28' + testCompileOnly 'org.projectlombok:lombok:1.18.28' + testAnnotationProcessor 'org.projectlombok:lombok:1.18.28' } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3796d3cd3..a1f2792d7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/setup.sh b/setup.sh new file mode 100755 index 000000000..3dbee49b8 --- /dev/null +++ b/setup.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +which sdk +if [ $? -ne 0 ]; then + curl -s "https://get.sdkman.io" | bash + if [ $? -ne 0 ]; then + die "sdkman failed" + fi; + . "$HOME/.sdkman/bin/sdkman-init.sh" +fi; + +sdk install java 20.0.1-graalce +sdk default java 20.0.1-graalce