diff --git a/flake.nix b/flake.nix index d28582af422..3ff578b3215 100644 --- a/flake.nix +++ b/flake.nix @@ -19,9 +19,8 @@ let base = rec { jdk = - if javaVersion < 21 then prev."jdk${toString javaVersion}" - else if javaVersion == 22 then jdk22-ea - else jdk21; + if javaVersion <= 21 then prev."jdk${toString javaVersion}" + else jdk22-ea; maven = prev.maven.override { inherit jdk; }; }; extra = with base; { @@ -31,18 +30,6 @@ (if extraChecks then base // extra else base)) ]; }; - jdk21 = pkgs.stdenv.mkDerivation rec { - name = "jdk21-oracle"; - version = "21+35"; - src = builtins.fetchTarball { - url = "https://download.oracle.com/java/21/archive/jdk-21_linux-x64_bin.tar.gz"; - sha256 = "sha256:1snj1jxa5175r17nb6l2ldgkcvjbp5mbfflwcc923svgf0604ps4"; - }; - installPhase = '' - cd .. - mv $sourceRoot $out - ''; - }; jdk22-ea = pkgs.stdenv.mkDerivation rec { name = "jdk22-ea"; version = "22+16"; @@ -198,18 +185,16 @@ # We have additional options (currently EA jdks) on 64 bit linux systems blessedSystem = "x86_64-linux"; blessed = rec { - jdk21 = mkShell blessedSystem { javaVersion = 21; }; jdk22-ea = mkShell blessedSystem { javaVersion = 22; }; - default = jdk21; }; common = forAllSystems (system: rec { - default = jdk11; + default = jdk17; jdk17 = mkShell system { javaVersion = 17; }; - jdk11 = mkShell system { javaVersion = 11; }; - extraChecks = mkShell system { extraChecks = true; javaVersion = 11; }; - jReleaser = mkShell system { release = true; javaVersion = 11; }; + jdk21 = mkShell system { javaVersion = 21; }; + extraChecks = mkShell system { extraChecks = true; javaVersion = 21; }; + jReleaser = mkShell system { release = true; javaVersion = 21; }; }); in common // { "${blessedSystem}" = common."${blessedSystem}" // blessed; }; diff --git a/jreleaser.yml b/jreleaser.yml index d15436cdc45..ca213c505e2 100644 --- a/jreleaser.yml +++ b/jreleaser.yml @@ -16,7 +16,7 @@ project: homepage: https://spoon.gforge.inria.fr/ java: groupId: fr.inria.gforge - version: "11" + version: "17" inceptionYear: "2015" release: diff --git a/spoon-pom/pom.xml b/spoon-pom/pom.xml index 99d7f22616e..165d74f4de4 100644 --- a/spoon-pom/pom.xml +++ b/spoon-pom/pom.xml @@ -25,7 +25,7 @@ - 11 + 17 target/velocity.log UTF-8 1696689792 diff --git a/src/main/java/spoon/metamodel/Metamodel.java b/src/main/java/spoon/metamodel/Metamodel.java index c42c92b99b1..703f9b59080 100644 --- a/src/main/java/spoon/metamodel/Metamodel.java +++ b/src/main/java/spoon/metamodel/Metamodel.java @@ -410,6 +410,7 @@ private static Factory createFactory(File spoonJavaSourcesDirectory) { final Launcher launcher = new Launcher(); launcher.getEnvironment().setNoClasspath(true); launcher.getEnvironment().setCommentEnabled(true); + launcher.getEnvironment().setComplianceLevel(17); // // Spoon model interfaces Arrays.asList("spoon/reflect/code", "spoon/reflect/declaration", diff --git a/src/main/java/spoon/testing/utils/ModelUtils.java b/src/main/java/spoon/testing/utils/ModelUtils.java index 8f76e7c0b39..a54166d3199 100644 --- a/src/main/java/spoon/testing/utils/ModelUtils.java +++ b/src/main/java/spoon/testing/utils/ModelUtils.java @@ -26,7 +26,9 @@ private ModelUtils() { } public static Factory createFactory() { - return new FactoryImpl(new DefaultCoreFactory(), new StandardEnvironment()); + StandardEnvironment environment = new StandardEnvironment(); + environment.setComplianceLevel(17); + return new FactoryImpl(new DefaultCoreFactory(), environment); } /** Utility method for testing: creates the model of `packageName` from src/test/java and returns the CtType corresponding to `className` */