Skip to content

Commit

Permalink
Merge pull request #42 from eed3si9n/wip/22-ea
Browse files Browse the repository at this point in the history
Add CI for JDK 22-ea
  • Loading branch information
eed3si9n authored Oct 27, 2023
2 parents 58b7fb2 + 77f22b4 commit 50cbec9
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private File createJarWithClasses(Map<String, String> 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";
Expand Down Expand Up @@ -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")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ".");
Expand Down
2 changes: 1 addition & 1 deletion sbtplugin/src/sbt-test/actions/simple/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ThisBuild / organization := "com.example"
ThisBuild / scalaVersion := "2.12.11"
ThisBuild / scalaVersion := "2.12.18"

lazy val shadedJawn = project
.enablePlugins(JarjarAbramsPlugin)
Expand Down
2 changes: 1 addition & 1 deletion sbtplugin/src/sbt-test/actions/two/build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ThisBuild / organization := "com.example"
ThisBuild / scalaVersion := "2.12.11"
ThisBuild / scalaVersion := "2.12.18"

lazy val shadedJawn = project
.enablePlugins(JarjarAbramsPlugin)
Expand Down

0 comments on commit 50cbec9

Please sign in to comment.