rename mapping headers
parent
6b17d207d5
commit
dff255da68
|
@ -108,14 +108,14 @@ public class AbstractPlugin implements Plugin<Project> {
|
||||||
javaCompileTask.getClasspath().add(project.getConfigurations().getByName(Constants.CONFIG_MINECRAFT));
|
javaCompileTask.getClasspath().add(project.getConfigurations().getByName(Constants.CONFIG_MINECRAFT));
|
||||||
javaCompileTask.getClasspath().add(target.files(this.getClass().getProtectionDomain().getCodeSource().getLocation()));
|
javaCompileTask.getClasspath().add(target.files(this.getClass().getProtectionDomain().getCodeSource().getLocation()));
|
||||||
|
|
||||||
javaCompileTask.getOptions().getCompilerArgs().add("-AinMapFilePomfIntermediary=" + Constants.MAPPINGS_TINY.get(extension).getCanonicalPath());
|
javaCompileTask.getOptions().getCompilerArgs().add("-AinMapFileNamedIntermediary=" + Constants.MAPPINGS_TINY.get(extension).getCanonicalPath());
|
||||||
javaCompileTask.getOptions().getCompilerArgs().add("-AoutMapFilePomfIntermediary=" + Constants.MAPPINGS_MIXIN_EXPORT.get(extension).getCanonicalPath());
|
javaCompileTask.getOptions().getCompilerArgs().add("-AoutMapFileNamedIntermediary=" + Constants.MAPPINGS_MIXIN_EXPORT.get(extension).getCanonicalPath());
|
||||||
if(extension.refmapName == null || extension.refmapName.isEmpty()){
|
if(extension.refmapName == null || extension.refmapName.isEmpty()){
|
||||||
project.getLogger().error("Could not find refmap definition, will be using default name: " + project.getName() + "-refmap.json");
|
project.getLogger().error("Could not find refmap definition, will be using default name: " + project.getName() + "-refmap.json");
|
||||||
extension.refmapName = project.getName() + "-refmap.json";
|
extension.refmapName = project.getName() + "-refmap.json";
|
||||||
}
|
}
|
||||||
javaCompileTask.getOptions().getCompilerArgs().add("-AoutRefMapFile=" + new File(javaCompileTask.getDestinationDir(), extension.refmapName).getCanonicalPath());
|
javaCompileTask.getOptions().getCompilerArgs().add("-AoutRefMapFile=" + new File(javaCompileTask.getDestinationDir(), extension.refmapName).getCanonicalPath());
|
||||||
javaCompileTask.getOptions().getCompilerArgs().add("-AdefaultObfuscationEnv=pomf:intermediary");
|
javaCompileTask.getOptions().getCompilerArgs().add("-AdefaultObfuscationEnv=named:intermediary");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,24 +60,24 @@ public class ObfuscationServiceFabric implements IObfuscationService {
|
||||||
@Override
|
@Override
|
||||||
public Set<String> getSupportedOptions() {
|
public Set<String> getSupportedOptions() {
|
||||||
ImmutableSet.Builder<String> builder = new ImmutableSet.Builder<>();
|
ImmutableSet.Builder<String> builder = new ImmutableSet.Builder<>();
|
||||||
addSupportedOptions(builder, "mojang", "intermediary");
|
addSupportedOptions(builder, "official", "intermediary");
|
||||||
addSupportedOptions(builder, "mojang", "pomf");
|
addSupportedOptions(builder, "official", "named");
|
||||||
addSupportedOptions(builder, "intermediary", "mojang");
|
addSupportedOptions(builder, "intermediary", "official");
|
||||||
addSupportedOptions(builder, "intermediary", "pomf");
|
addSupportedOptions(builder, "intermediary", "named");
|
||||||
addSupportedOptions(builder, "pomf", "mojang");
|
addSupportedOptions(builder, "named", "official");
|
||||||
addSupportedOptions(builder, "pomf", "intermediary");
|
addSupportedOptions(builder, "named", "intermediary");
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ObfuscationTypeDescriptor> getObfuscationTypes() {
|
public Collection<ObfuscationTypeDescriptor> getObfuscationTypes() {
|
||||||
return ImmutableSet.of(
|
return ImmutableSet.of(
|
||||||
createObfuscationType("mojang", "intermediary"),
|
createObfuscationType("official", "intermediary"),
|
||||||
createObfuscationType("mojang", "pomf"),
|
createObfuscationType("official", "named"),
|
||||||
createObfuscationType("intermediary", "mojang"),
|
createObfuscationType("intermediary", "official"),
|
||||||
createObfuscationType("intermediary", "pomf"),
|
createObfuscationType("intermediary", "named"),
|
||||||
createObfuscationType("pomf", "mojang"),
|
createObfuscationType("named", "official"),
|
||||||
createObfuscationType("pomf", "intermediary")
|
createObfuscationType("named", "intermediary")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ import java.util.Arrays;
|
||||||
public class MapJarsTiny {
|
public class MapJarsTiny {
|
||||||
|
|
||||||
public void mapJars(MapJarsTask task) throws IOException {
|
public void mapJars(MapJarsTask task) throws IOException {
|
||||||
String fromM = "mojang";
|
String fromM = "official";
|
||||||
|
|
||||||
Path mappings = task.getMappingFile().toPath();
|
Path mappings = task.getMappingFile().toPath();
|
||||||
Path[] classpath = task.getMapperPaths().stream()
|
Path[] classpath = task.getMapperPaths().stream()
|
||||||
|
@ -51,8 +51,8 @@ public class MapJarsTiny {
|
||||||
Path outputMapped = task.getMappedJar().toPath();
|
Path outputMapped = task.getMappedJar().toPath();
|
||||||
Path outputIntermediary = task.getIntermediaryJar().toPath();
|
Path outputIntermediary = task.getIntermediaryJar().toPath();
|
||||||
|
|
||||||
for (String toM : Arrays.asList("pomf", "intermediary")) {
|
for (String toM : Arrays.asList("named", "intermediary")) {
|
||||||
Path output = "pomf".equals(toM) ? outputMapped : outputIntermediary;
|
Path output = "named".equals(toM) ? outputMapped : outputIntermediary;
|
||||||
|
|
||||||
task.getLogger().lifecycle(":remapping minecraft (TinyRemapper, " + fromM + " -> " + toM + ")");
|
task.getLogger().lifecycle(":remapping minecraft (TinyRemapper, " + fromM + " -> " + toM + ")");
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class ModProcessor {
|
||||||
private static void remapJar(File input, File output, Project project){
|
private static void remapJar(File input, File output, Project project){
|
||||||
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
|
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
|
||||||
String fromM = "intermediary";
|
String fromM = "intermediary";
|
||||||
String toM = "pomf";
|
String toM = "named";
|
||||||
|
|
||||||
File mappingsFile = Constants.MAPPINGS_TINY.get(extension);
|
File mappingsFile = Constants.MAPPINGS_TINY.get(extension);
|
||||||
Path mappings = mappingsFile.toPath();
|
Path mappings = mappingsFile.toPath();
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class ModRemapper {
|
||||||
|
|
||||||
Path mappings = Constants.MAPPINGS_TINY.get(extension).toPath();
|
Path mappings = Constants.MAPPINGS_TINY.get(extension).toPath();
|
||||||
|
|
||||||
String fromM = "pomf";
|
String fromM = "named";
|
||||||
String toM = "intermediary";
|
String toM = "intermediary";
|
||||||
|
|
||||||
List<File> classpathFiles = new ArrayList<>();
|
List<File> classpathFiles = new ArrayList<>();
|
||||||
|
|
Loading…
Reference in New Issue