fix gradle 5 support changes
This commit is contained in:
parent
0dcb7070be
commit
6749c9688e
6 changed files with 27 additions and 11 deletions
|
@ -57,6 +57,10 @@ import java.util.Set;
|
|||
public class AbstractPlugin implements Plugin<Project> {
|
||||
protected Project project;
|
||||
|
||||
private void extendsFrom(String a, String b) {
|
||||
project.getConfigurations().getByName(a).extendsFrom(project.getConfigurations().getByName(b));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(Project target) {
|
||||
this.project = target;
|
||||
|
@ -76,14 +80,17 @@ public class AbstractPlugin implements Plugin<Project> {
|
|||
|
||||
Configuration compileModsConfig = project.getConfigurations().maybeCreate(Constants.COMPILE_MODS);
|
||||
compileModsConfig.setTransitive(false); // Dont get transitive deps of mods
|
||||
Configuration minecraftNamedConfig = project.getConfigurations().maybeCreate(Constants.MINECRAFT_NAMED);
|
||||
minecraftNamedConfig.setTransitive(false); // The launchers do not recurse dependencies
|
||||
Configuration minecraftIntermediaryConfig = project.getConfigurations().maybeCreate(Constants.MINECRAFT_INTERMEDIARY);
|
||||
minecraftIntermediaryConfig.setTransitive(false);
|
||||
Configuration minecraftDependenciesConfig = project.getConfigurations().maybeCreate(Constants.MINECRAFT_DEPENDENCIES);
|
||||
minecraftDependenciesConfig.setTransitive(false);
|
||||
Configuration minecraftConfig = project.getConfigurations().maybeCreate(Constants.MINECRAFT);
|
||||
minecraftConfig.setTransitive(false); // The launchers do not recurse dependencies
|
||||
minecraftConfig.setTransitive(false);
|
||||
|
||||
project.getConfigurations().maybeCreate(Constants.MAPPINGS);
|
||||
|
||||
Configuration minecraftMappedConfig = project.getConfigurations().maybeCreate(Constants.MINECRAFT_MAPPED);
|
||||
minecraftMappedConfig.setTransitive(false); // The launchers do not recurse dependencies
|
||||
|
||||
configureIDEs();
|
||||
configureCompile();
|
||||
|
||||
|
@ -236,6 +243,13 @@ public class AbstractPlugin implements Plugin<Project> {
|
|||
handler.add("annotationProcessor", "net.fabricmc:sponge-mixin:" + extension.getMixinVersion());
|
||||
handler.add("annotationProcessor", "net.fabricmc:fabric-loom:" + extension.getLoomVersion());
|
||||
|
||||
extendsFrom(Constants.MINECRAFT_NAMED, Constants.MINECRAFT_DEPENDENCIES);
|
||||
extendsFrom(Constants.COMPILE_MODS, Constants.MINECRAFT_NAMED);
|
||||
extendsFrom("compile", Constants.COMPILE_MODS);
|
||||
extendsFrom("compile", Constants.MAPPINGS);
|
||||
extendsFrom("annotationProcessor", Constants.COMPILE_MODS);
|
||||
extendsFrom("annotationProcessor", Constants.MAPPINGS);
|
||||
|
||||
// Enables the default mod remapper
|
||||
if (extension.remapMod) {
|
||||
AbstractArchiveTask jarTask = (AbstractArchiveTask) project1.getTasks().getByName("jar");
|
||||
|
|
|
@ -92,8 +92,6 @@ public class MappingsProvider extends DependencyProvider {
|
|||
});
|
||||
}
|
||||
|
||||
project.getDependencies().add("compile", project.getDependencies().module(dependency.getDependency().getGroup() + ":" + dependency.getDependency().getName() + ":" + version));
|
||||
|
||||
mappedProvider = new MinecraftMappedProvider();
|
||||
mappedProvider.initFiles(project, minecraftProvider, this);
|
||||
mappedProvider.provide(dependency, project, extension, postPopulationScheduler);
|
||||
|
|
|
@ -66,7 +66,7 @@ public class MinecraftLibraryProvider {
|
|||
isClientOnly = true;
|
||||
} */
|
||||
|
||||
project.getDependencies().add("compile", project.getDependencies().module(library.getArtifactName()));
|
||||
project.getDependencies().add(Constants.MINECRAFT_DEPENDENCIES, project.getDependencies().module(library.getArtifactName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,9 @@ public class MinecraftMappedProvider extends DependencyProvider {
|
|||
}
|
||||
|
||||
String version = minecraftProvider.minecraftVersion + "-mapped-" + extension.getMappingsProvider().mappingsVersion;
|
||||
project.getDependencies().add("compile", project.getDependencies().module("net.minecraft:minecraft:" + version));
|
||||
project.getDependencies().add(Constants.MINECRAFT_NAMED, project.getDependencies().module("net.minecraft:minecraft:" + version));
|
||||
version = minecraftProvider.minecraftVersion + "-intermediary";
|
||||
project.getDependencies().add(Constants.MINECRAFT_INTERMEDIARY, project.getDependencies().module("net.minecraft:minecraft:" + version));
|
||||
}
|
||||
|
||||
public void initFiles(Project project, MinecraftProvider minecraftProvider, MappingsProvider mappingsProvider) {
|
||||
|
@ -89,6 +91,6 @@ public class MinecraftMappedProvider extends DependencyProvider {
|
|||
|
||||
@Override
|
||||
public String getTargetConfig() {
|
||||
return Constants.MINECRAFT_MAPPED;
|
||||
return Constants.MINECRAFT_NAMED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public class ModRemapperProvider extends DependencyProvider {
|
|||
throw new RuntimeException("Failed to remap mod");
|
||||
}
|
||||
|
||||
project.getDependencies().add("compile", project.getDependencies().module(
|
||||
project.getDependencies().add(Constants.COMPILE_MODS, project.getDependencies().module(
|
||||
rds + verSuffix
|
||||
));
|
||||
|
||||
|
|
|
@ -37,6 +37,8 @@ public class Constants {
|
|||
|
||||
public static final String COMPILE_MODS = "modCompile";
|
||||
public static final String MINECRAFT = "minecraft";
|
||||
public static final String MINECRAFT_MAPPED = "minecraftMapped";
|
||||
public static final String MINECRAFT_DEPENDENCIES = "minecraftLibraries";
|
||||
public static final String MINECRAFT_INTERMEDIARY = "minecraftIntermediary";
|
||||
public static final String MINECRAFT_NAMED = "minecraftNamed";
|
||||
public static final String MAPPINGS = "mappings";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue