diff --git a/.github/workflows/deploy_snapshot.yml b/.github/workflows/deploy_snapshot.yml index 735d77a6c..32de396cc 100644 --- a/.github/workflows/deploy_snapshot.yml +++ b/.github/workflows/deploy_snapshot.yml @@ -15,7 +15,8 @@ on: types: [ trigger_after_upstream_deploy ] env: - GRADLE_VERSION: 7.6 # Gradle version used + GRADLE_VERSION: 8.5 # Gradle version used + JAVA_VERSION: 21 # Java version used GRADLE_CLI_OPTS: "-Pci --build-cache -PgenTR=false -PgenTagging=true --refresh-dependencies " # CLI options passed to Gradle GRADLE_BUILD_ACTION_CACHE_KEY_JOB: "test-cache-${{ github.head_ref }}.${{ github.sha }}" @@ -29,6 +30,11 @@ jobs: steps: - name: Checkout project sources uses: actions/checkout@v4 + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ env.JAVA_VERSION }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 with: @@ -45,6 +51,11 @@ jobs: steps: - name: Checkout project sources uses: actions/checkout@v4 + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ env.JAVA_VERSION }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 with: diff --git a/.github/workflows/test_branch.yml b/.github/workflows/test_branch.yml index 5b3f3fb7a..451191296 100644 --- a/.github/workflows/test_branch.yml +++ b/.github/workflows/test_branch.yml @@ -14,7 +14,8 @@ on: types: [opened, synchronize] env: - GRADLE_VERSION: 7.6 # Gradle version used + GRADLE_VERSION: 8.5 # Gradle version used + JAVA_VERSION: 21 # Java version used GRADLE_CLI_OPTS: "-Pci --build-cache -PgenTR=false -PgenTagging=true --refresh-dependencies " # CLI options passed to Gradle GRADLE_BUILD_ACTION_CACHE_KEY_JOB: "test-cache-${{ github.head_ref }}.${{ github.sha }}" @@ -30,6 +31,11 @@ jobs: steps: - name: Checkout project sources uses: actions/checkout@v4 + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ env.JAVA_VERSION }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 with: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 709a25970..b8b48daba 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,6 @@ # (c) https://github.com/MontiCore/monticore -image: registry.git.rwth-aachen.de/monticore/container-registry/gradle:7.6.4-jdk11 +image: registry.git.rwth-aachen.de/monticore/container-registry/gradle:8.5-jdk21 variables: GRADLE_OPTS: "-Dorg.gradle.daemon=false" diff --git a/README.md b/README.md index e245d4a8f..b9bb96f87 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ processing models, including: * computing the semantic difference of 2 CDs, and * merging 2 CDs (iff the result is semantically sound) -The requirements for building and using the CD tool are that Java 11, Git, +The requirements for building and using the CD tool are that Java 21, Git, and Gradle are installed and available for use (e.g., in bash). ### Downloading the Latest Version of the Tool @@ -186,8 +186,8 @@ As alternative to a download, it is possible to build an executable JAR of the tool from the source files located in GitHub. Make sure you have installed the following dependencies: -* Java 11 or 17 (check it with java -version) -* Gradle 7.6.4 (check it with gradle --version) +* Java 21 (check it with java -version) +* Gradle 8.5 (check it with gradle --version) In order to build an executable Jar of the tool with Bash from the source files available in GitHub, execute the following commands. diff --git a/build.gradle b/build.gradle index 937c12119..31b433f20 100644 --- a/build.gradle +++ b/build.gradle @@ -4,11 +4,13 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent /* (c) https://github.com/MontiCore/monticore */ plugins { + id 'java' id "maven-publish" id "io.github.themrmilchmann.ecj" version "0.2.0" apply(false) // Eclipse compiler as it's much faster than javac id "de.se_rwth.codestyle" version "$mc_version" } + description = "CD4Analysis" buildDir = file("$projectDir/target") @@ -24,7 +26,7 @@ ext { junit_platform_version = "1.14.1" freemarker_version = "2.3.31" javaparser_version = "3.14.11" - mockito_version = "3.11.1" + mockito_version = "5.11.0" logback_version = "1.2.3" apache_commons_version = '4.4' } @@ -37,12 +39,17 @@ repositories { } subprojects { + apply plugin: 'java-library' apply plugin: 'io.github.themrmilchmann.ecj' apply plugin: 'maven-publish' apply plugin: 'de.se_rwth.codestyle' - sourceCompatibility = JavaVersion.VERSION_11 + ecj { + compilerVersion = "3.43.0" + } + + sourceCompatibility = JavaVersion.VERSION_21 allprojects { group = "de.monticore.lang.cd4analysis" @@ -105,7 +112,7 @@ subprojects { } java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(21) } } } diff --git a/cdtool/build.gradle b/cdtool/build.gradle index 93961e995..f33e646ea 100644 --- a/cdtool/build.gradle +++ b/cdtool/build.gradle @@ -1,6 +1,6 @@ /* (c) https://github.com/MontiCore/monticore */ plugins { - id "com.github.johnrengelman.shadow" version "$shadow_plugin_version" + id 'com.gradleup.shadow' version "$shadow_plugin_version" } description = "CD4Analysis: Tool" diff --git a/cdtool/cdgradle/src/test/java/de/monticore/cdgen/CDGenGradlePluginTest.java b/cdtool/cdgradle/src/test/java/de/monticore/cdgen/CDGenGradlePluginTest.java index 948c07cb4..d6ac7f4f0 100644 --- a/cdtool/cdgradle/src/test/java/de/monticore/cdgen/CDGenGradlePluginTest.java +++ b/cdtool/cdgradle/src/test/java/de/monticore/cdgen/CDGenGradlePluginTest.java @@ -19,30 +19,18 @@ import org.gradle.testkit.runner.GradleRunner; import org.gradle.testkit.runner.TaskOutcome; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; public class CDGenGradlePluginTest { @TempDir File testProjectDir; - @Test - public void testCDGen_v7_4_2() throws IOException { - testCDGen("7.4.2"); - } - - @Test - public void testCDGen_v8_0_1() throws IOException { - this.testCDGen("8.0.1"); - } - - @Test - public void testCDGen_v8_7() throws IOException { - this.testCDGen("8.7"); - } - - void testCDGen(String version) throws IOException { + @ParameterizedTest + @ValueSource(strings = { "8.5", "8.7", "8.14" }) + public void testCDGen(String version) throws IOException { FileUtils.copyDirectory(new File("src/test/resources/cdgradle-it"), testProjectDir); BuildResult result = GradleRunner.create().withPluginClasspath().withGradleVersion(version) @@ -77,21 +65,6 @@ void testCDGen(String version) throws IOException { CD4CodeMill.reset(); } - @Test - public void testCDGenOwnDecorator_v7_4_2() throws IOException { - this.testCDGenOwnDecorator("7.4.2"); - } - - @Test - public void testCDGenOwnDecorator_v8_0_1() throws IOException { - this.testCDGenOwnDecorator("8.0.1"); - } - - @Test - public void testCDGenOwnDecorator_v8_7() throws IOException { - this.testCDGenOwnDecorator("8.7"); - } - /** * Test the CDGenPlugin with a decorator written in a custom sourceSet and a custom config * template @@ -99,7 +72,9 @@ public void testCDGenOwnDecorator_v8_7() throws IOException { * @param version gradle version * @throws IOException in case of errors */ - void testCDGenOwnDecorator(String version) throws IOException { + @ParameterizedTest + @ValueSource(strings = { "8.5", "8.7", "8.14" }) + public void testCDGenOwnDecorator(String version) throws IOException { FileUtils.copyDirectory(new File("src/test/resources/cdgradle-it"), testProjectDir); BuildResult result = GradleRunner.create().withPluginClasspath().withGradleVersion(version) diff --git a/gradle.properties b/gradle.properties index e53485750..be5d1893f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ repo=https://nexus.se.rwth-aachen.de/content/groups/public version=7.9.0-SNAPSHOT mc_version=7.9.0-SNAPSHOT commons_version=7.9.0-SNAPSHOT -shadow_plugin_version=7.1.2 +shadow_plugin_version=8.3.9 useLocalRepo=false org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true diff --git a/language-server/build.gradle b/language-server/build.gradle index 0861258e9..67feba08b 100644 --- a/language-server/build.gradle +++ b/language-server/build.gradle @@ -9,7 +9,7 @@ plugins { group 'de.monticore.lang' version mc_version -sourceCompatibility = JavaVersion.VERSION_11 +sourceCompatibility = JavaVersion.VERSION_21 repositories { mavenCentral() diff --git a/symtabdefinitiontool/build.gradle b/symtabdefinitiontool/build.gradle index 360e1f3eb..3ba11d449 100644 --- a/symtabdefinitiontool/build.gradle +++ b/symtabdefinitiontool/build.gradle @@ -1,6 +1,6 @@ /* (c) https://github.com/MontiCore/monticore */ plugins { - id "com.github.johnrengelman.shadow" version "$shadow_plugin_version" + id 'com.gradleup.shadow' version "$shadow_plugin_version" } description = "SymTabDefinition: Tool" diff --git a/trafo-library/build.gradle b/trafo-library/build.gradle index a14c819ad..29d075f3d 100644 --- a/trafo-library/build.gradle +++ b/trafo-library/build.gradle @@ -10,7 +10,7 @@ import de.monticore.MontiTransExec group = "de.monticore.lang" description = "trafo-library" -sourceCompatibility = JavaVersion.VERSION_11 +sourceCompatibility = JavaVersion.VERSION_21 buildDir = file("$projectDir/target")