Skip to content

Commit

Permalink
[#228] move DependencyDescriptor and GenerateModuleInfo to Java 8; mo…
Browse files Browse the repository at this point in the history
…ve GenerateModuleList to Java 12
  • Loading branch information
bmarwell committed Feb 9, 2024
1 parent 5dabb6b commit 7b1839a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
18 changes: 15 additions & 3 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,27 @@
<goal>compile</goal>
</goals>
<configuration>
<release>11</release>
<compileSourceRoots>${project.basedir}/src/main/java11</compileSourceRoots>
<release>9</release>
<compileSourceRoots>${project.basedir}/src/main/java9</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
<execution>
<id>compile-java12</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<release>12</release>
<compileSourceRoots>${project.basedir}/src/main/java12</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
</execution>
<execution>
<id>default-testCompile</id>
<configuration>
<release>11</release>
<release>9</release>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ public GenerateModuleInfo(
Path workingDirectory, Path outputDirectory,
Set<String> opensResources, Set<String> uses, Set<String> provides,
boolean addServiceUses, List<String> jdepsExtraArgs, Log log) {
throw new UnsupportedOperationException("new GenerateModuleInfo() not supported on Java 8");
throw new UnsupportedOperationException("new GenerateModuleInfo() requires Java 9");
}

public static Path createCopyWithAutoModuleNameManifestHeader(Path workingDirectory, Path inputJar, String moduleName) {
throw new UnsupportedOperationException("GenerateModuleInfo.createCopyWithAutoModuleNameManifestHeader() not supported on Java 8");
throw new UnsupportedOperationException("GenerateModuleInfo.createCopyWithAutoModuleNameManifestHeader() requires Java 9");
}

public GeneratedModuleInfo run() {
throw new UnsupportedOperationException("new GenerateModuleInfo().run() not supported on Java 8");
throw new UnsupportedOperationException("new GenerateModuleInfo().run() requires Java 9");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
public class GenerateModuleList {

public GenerateModuleList(Path projectJar, Set<Path> dependencies, Version jvmVersion, Log log) {
throw new UnsupportedOperationException("new GenerateModuleList() not supported on Java 8");
throw new UnsupportedOperationException("new GenerateModuleList() requires Java 12");
}

public void run() {
throw new UnsupportedOperationException("GenerateModuleList().run not supported on Java 8");
throw new UnsupportedOperationException("GenerateModuleList().run requires Java 12");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
public class DependencyDescriptor {

public DependencyDescriptor(Path path, boolean optional, String assignedModuleName) {
throw new UnsupportedOperationException("new DependencyDescriptor() not supported on Java 8");
throw new UnsupportedOperationException("new DependencyDescriptor() requires Java 9");
}

public static String getAutoModuleNameFromInputJar(Path path, String invalidModuleName) {
throw new UnsupportedOperationException("getAutoModuleNameFromInputJar() not supported on Java 8");
throw new UnsupportedOperationException("getAutoModuleNameFromInputJar() requires Java 9");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void run() {
jdeps.run(out, System.err, "--version");
out.close();
int jdepsVersion = Runtime.Version
.parse(outStream.toString().strip())
.parse(outStream.toString().trim())
.feature();
if (jdepsVersion < 12) {
log.error("The jdeps option this plugin uses to list JDK modules only works flawlessly on JDK 12+, so please use that to run this goal.");
Expand Down

0 comments on commit 7b1839a

Please sign in to comment.