Skip to content
This repository was archived by the owner on May 12, 2024. It is now read-only.

Commit 5243f57

Browse files
committed
Gradle improvements:tm:
1 parent 6211936 commit 5243f57

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

gradle-plugin/src/main/java/net/raphimc/javadowngrader/gradle/task/DowngradeJarTask.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void run() throws IOException, URISyntaxException {
7474
final File inputFile = getInput().getAsFile().get();
7575
System.out.println("Downgrading jar: " + inputFile);
7676

77-
try (FileSystem inFs = FileSystems.newFileSystem(inputFile.toPath(), null)) {
77+
try (FileSystem inFs = FileSystems.newFileSystem(inputFile.toPath(), (ClassLoader)null)) {
7878
final Path inRoot = inFs.getRootDirectories().iterator().next();
7979

8080
final Collection<String> runtimeDeps = new HashSet<>();
@@ -133,7 +133,9 @@ public void run() throws IOException, URISyntaxException {
133133
for (final String runtimeDep : runtimeDeps) {
134134
final String classPath = runtimeDep.concat(".class");
135135
try (InputStream is = RuntimeRoot.class.getResourceAsStream("/" + classPath)) {
136-
if (is == null) continue;
136+
if (is == null) {
137+
throw new IllegalStateException("Missing runtime class " + runtimeDep);
138+
}
137139
final Path dest = outRoot.resolve(classPath);
138140
final Path parent = dest.getParent();
139141
if (parent != null) {

gradle-plugin/src/main/java/net/raphimc/javadowngrader/gradle/task/DowngradeSourceSetTask.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ public void run() throws IOException {
103103
for (final String runtimeDep : runtimeDeps) {
104104
final String classPath = runtimeDep.concat(".class");
105105
try (InputStream is = RuntimeRoot.class.getResourceAsStream("/" + classPath)) {
106-
if (is == null) continue;
106+
if (is == null) {
107+
throw new IllegalStateException("Missing runtime class " + runtimeDep);
108+
}
107109
final Path dest = inRoot.resolve(classPath);
108110
final Path parent = dest.getParent();
109111
if (parent != null) {

0 commit comments

Comments
 (0)