diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28a2041e..74ecc456 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,3 +42,24 @@ jobs: shell: bash run: | sbt -v -Dfile.encoding=UTF8 scalafmtCheckAll + + ea-test: + runs-on: ubuntu-latest + env: + # define Java options for both official sbt and sbt-extras + JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 + JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup JDK + uses: actions/setup-java@v3 + with: + java-version: 22-ea + distribution: temurin + jdkFile: https://download.java.net/java/early_access/jdk22/20/GPL/openjdk-22-ea+20_linux-x64_bin.tar.gz + cache: sbt + - name: Build and test + shell: bash + run: | + sbt -v -Dfile.encoding=UTF8 "jarjar/publishLocal" "jarjar/IntegrationTest/test" "+test" "publishLocal;scripted" diff --git a/build.sbt b/build.sbt index 8241cc50..f5d96e6a 100644 --- a/build.sbt +++ b/build.sbt @@ -146,6 +146,7 @@ lazy val sbtplugin = project Vector("-Xmx1024M", "-Dplugin.version=" + version.value) } pluginCrossBuild / sbtVersion := "1.2.8" + scriptedSbt := "1.9.7" scriptedBufferLog := false }) diff --git a/jarjar/src/it/java/com/eed3si9n/jarjar/integration/BadPackagesTest.java b/jarjar/src/it/java/com/eed3si9n/jarjar/integration/BadPackagesTest.java index 05dc45fa..f0cd6886 100644 --- a/jarjar/src/it/java/com/eed3si9n/jarjar/integration/BadPackagesTest.java +++ b/jarjar/src/it/java/com/eed3si9n/jarjar/integration/BadPackagesTest.java @@ -159,7 +159,7 @@ private File createJarWithClasses(Map classNameMap) throws Excep String[] paths = sourcePaths.toArray(new String[sourcePaths.size()]); File folder = createTree(files); - Assert.assertTrue(tryCompile(folder, paths, "-source", "6", "-target", "6")); + Assert.assertTrue(tryCompile(folder, paths, "-source", "1.8", "-target", "1.8")); for (String className : classNameMap.keySet()) { String dstName = classNameMap.get(className).replaceAll("[.]", "/") + ".class"; @@ -212,14 +212,14 @@ private File createJarWithOldVersion() throws IOException { String[] paths = { sourcePath }; File folder = createTree(files); - Assert.assertTrue(tryCompile(folder, paths, "-source", "6", "-target", "6")); + Assert.assertTrue(tryCompile(folder, paths, "-source", "1.8", "-target", "1.8")); File srcFile = new File(folder + File.separator + binaryPath); File dstFile = new File(folder + File.separator + "oldversion" + File.separator + binaryPath); dstFile.getParentFile().mkdirs(); srcFile.renameTo(dstFile); - Assert.assertTrue(tryCompile(folder, paths, "-source", "6", "-target", "6")); + Assert.assertTrue(tryCompile(folder, paths, "-source", "1.8", "-target", "1.8")); for (String file : new FileTree(folder)) { if (file.endsWith(".java")) { diff --git a/jarjar/src/it/java/com/eed3si9n/jarjar/integration/JavaVersionsTest.java b/jarjar/src/it/java/com/eed3si9n/jarjar/integration/JavaVersionsTest.java index fb6710bd..4699b5cd 100644 --- a/jarjar/src/it/java/com/eed3si9n/jarjar/integration/JavaVersionsTest.java +++ b/jarjar/src/it/java/com/eed3si9n/jarjar/integration/JavaVersionsTest.java @@ -16,16 +16,6 @@ public void testShadeJava8Class() throws Exception { testVersion("1.8"); } - @Test - public void testShadeJava7Class() throws Exception { - testVersion("1.7"); - } - - @Test - public void testShadeJava6Class() throws Exception { - testVersion("1.6"); - } - private void testVersion(String version) throws Exception { if (!javaVersionIsAtLeast(version)) { System.out.println("Cannot test java " + version + " if this is being run in less than " + version + "."); diff --git a/sbtplugin/src/sbt-test/actions/simple/build.sbt b/sbtplugin/src/sbt-test/actions/simple/build.sbt index d4f7b29e..778fb1f7 100644 --- a/sbtplugin/src/sbt-test/actions/simple/build.sbt +++ b/sbtplugin/src/sbt-test/actions/simple/build.sbt @@ -1,5 +1,5 @@ ThisBuild / organization := "com.example" -ThisBuild / scalaVersion := "2.12.11" +ThisBuild / scalaVersion := "2.12.18" lazy val shadedJawn = project .enablePlugins(JarjarAbramsPlugin) diff --git a/sbtplugin/src/sbt-test/actions/two/build.sbt b/sbtplugin/src/sbt-test/actions/two/build.sbt index 474f56f9..efb80d7b 100644 --- a/sbtplugin/src/sbt-test/actions/two/build.sbt +++ b/sbtplugin/src/sbt-test/actions/two/build.sbt @@ -1,5 +1,5 @@ ThisBuild / organization := "com.example" -ThisBuild / scalaVersion := "2.12.11" +ThisBuild / scalaVersion := "2.12.18" lazy val shadedJawn = project .enablePlugins(JarjarAbramsPlugin)