update tiny-remapper

dev/0.11
asie 2018-11-12 01:25:06 +01:00
parent 24b1b0669d
commit 823854f2a1
4 changed files with 4 additions and 31 deletions

View File

@ -35,7 +35,7 @@ dependencies {
implementation ('com.google.code.gson:gson:2.8.5') implementation ('com.google.code.gson:gson:2.8.5')
implementation ('com.google.guava:guava:27.0-jre') implementation ('com.google.guava:guava:27.0-jre')
implementation ('net.fabricmc:stitch:0.1.0.+') implementation ('net.fabricmc:stitch:0.1.0.+')
implementation ('net.fabricmc:tiny-remapper:0.1.0.16') { implementation ('net.fabricmc:tiny-remapper:0.1.0.17') {
transitive = false transitive = false
} }

View File

@ -64,9 +64,7 @@ public class MapJarsTiny {
.withMappings(TinyUtils.createTinyMappingProvider(mappings, fromM, toM)) .withMappings(TinyUtils.createTinyMappingProvider(mappings, fromM, toM))
.build(); .build();
OutputConsumerPath outputConsumer = null; try (OutputConsumerPath outputConsumer = new OutputConsumerPath(output)) {
try {
outputConsumer = new OutputConsumerPath(output);
outputConsumer.addNonClassFiles(input); outputConsumer.addNonClassFiles(input);
remapper.read(input); remapper.read(input);
remapper.read(classpath); remapper.read(classpath);
@ -74,13 +72,6 @@ public class MapJarsTiny {
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("Failed to remap JAR", e); throw new RuntimeException("Failed to remap JAR", e);
} finally { } finally {
if (outputConsumer != null) {
try {
outputConsumer.finish();
} catch (Exception e) {
e.printStackTrace();
}
}
remapper.finish(); remapper.finish();
} }
} }

View File

@ -99,9 +99,7 @@ public class ModProcessor {
.withMappings(TinyUtils.createTinyMappingProvider(mappings, fromM, toM)) .withMappings(TinyUtils.createTinyMappingProvider(mappings, fromM, toM))
.build(); .build();
OutputConsumerPath outputConsumer = null; try (OutputConsumerPath outputConsumer = new OutputConsumerPath(Paths.get(output.getAbsolutePath()))) {
try {
outputConsumer = new OutputConsumerPath(Paths.get(output.getAbsolutePath()));
outputConsumer.addNonClassFiles(input.toPath()); outputConsumer.addNonClassFiles(input.toPath());
if (!modCompileFiles.contains(input)) { if (!modCompileFiles.contains(input)) {
remapper.read(input.toPath()); remapper.read(input.toPath());
@ -113,13 +111,6 @@ public class ModProcessor {
} catch (Exception e){ } catch (Exception e){
throw new RuntimeException("Failed to remap JAR to " + toM, e); throw new RuntimeException("Failed to remap JAR to " + toM, e);
} finally { } finally {
if (outputConsumer != null) {
try {
outputConsumer.finish();
} catch (Exception e) {
e.printStackTrace();
}
}
remapper.finish(); remapper.finish();
} }

View File

@ -79,9 +79,7 @@ public class ModRemapper {
TinyRemapper remapper = remapperBuilder.build(); TinyRemapper remapper = remapperBuilder.build();
OutputConsumerPath outputConsumer = null; try (OutputConsumerPath outputConsumer = new OutputConsumerPath(modJarOutputPath)) {
try {
outputConsumer = new OutputConsumerPath(modJarOutputPath);
outputConsumer.addNonClassFiles(modJarPath); outputConsumer.addNonClassFiles(modJarPath);
remapper.read(classpath); remapper.read(classpath);
remapper.read(modJarPath); remapper.read(modJarPath);
@ -89,13 +87,6 @@ public class ModRemapper {
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("Failed to remap JAR", e); throw new RuntimeException("Failed to remap JAR", e);
} finally { } finally {
if (outputConsumer != null) {
try {
outputConsumer.finish();
} catch (Exception e) {
e.printStackTrace();
}
}
remapper.finish(); remapper.finish();
} }