2016-08-16 22:29:10 +00:00
|
|
|
/*
|
|
|
|
* This file is part of fabric-loom, licensed under the MIT License (MIT).
|
|
|
|
*
|
2018-10-27 14:14:05 +00:00
|
|
|
* Copyright (c) 2016, 2017, 2018 FabricMC
|
2016-08-16 22:29:10 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2020-12-24 20:58:30 +00:00
|
|
|
package net.fabricmc.loom.configuration;
|
2016-08-15 10:22:14 +00:00
|
|
|
|
2020-06-27 19:18:32 +00:00
|
|
|
import java.io.IOException;
|
2019-11-02 20:23:27 +00:00
|
|
|
|
2019-06-11 02:20:57 +00:00
|
|
|
import org.gradle.api.Project;
|
|
|
|
import org.gradle.api.Task;
|
|
|
|
import org.gradle.api.UnknownTaskException;
|
2018-10-29 11:55:30 +00:00
|
|
|
import org.gradle.api.artifacts.Configuration;
|
2016-08-15 10:22:14 +00:00
|
|
|
import org.gradle.api.artifacts.repositories.MavenArtifactRepository;
|
|
|
|
import org.gradle.api.plugins.JavaPlugin;
|
|
|
|
import org.gradle.api.plugins.JavaPluginConvention;
|
|
|
|
import org.gradle.api.tasks.SourceSet;
|
2018-11-06 09:36:35 +00:00
|
|
|
import org.gradle.api.tasks.bundling.AbstractArchiveTask;
|
2016-08-15 10:22:14 +00:00
|
|
|
import org.gradle.api.tasks.javadoc.Javadoc;
|
|
|
|
|
2020-12-24 20:58:30 +00:00
|
|
|
import net.fabricmc.loom.LoomGradleExtension;
|
|
|
|
import net.fabricmc.loom.build.JarRemapper;
|
|
|
|
import net.fabricmc.loom.build.NestedJars;
|
|
|
|
import net.fabricmc.loom.build.mixin.JavaApInvoker;
|
|
|
|
import net.fabricmc.loom.build.mixin.KaptApInvoker;
|
|
|
|
import net.fabricmc.loom.build.mixin.ScalaApInvoker;
|
|
|
|
import net.fabricmc.loom.configuration.ide.SetupIntelijRunConfigs;
|
|
|
|
import net.fabricmc.loom.configuration.providers.LaunchProvider;
|
|
|
|
import net.fabricmc.loom.configuration.providers.MinecraftProvider;
|
|
|
|
import net.fabricmc.loom.configuration.providers.mappings.MappingsProvider;
|
2020-06-28 11:51:29 +00:00
|
|
|
import net.fabricmc.loom.task.AbstractLoomTask;
|
2020-12-24 20:58:30 +00:00
|
|
|
import net.fabricmc.loom.task.RemapAllSourcesTask;
|
2019-11-02 20:23:27 +00:00
|
|
|
import net.fabricmc.loom.task.RemapJarTask;
|
|
|
|
import net.fabricmc.loom.task.RemapSourcesJarTask;
|
|
|
|
import net.fabricmc.loom.util.Constants;
|
2020-06-27 19:18:32 +00:00
|
|
|
import net.fabricmc.loom.util.SourceRemapper;
|
2019-06-11 02:20:57 +00:00
|
|
|
|
2020-12-24 20:58:30 +00:00
|
|
|
/**
|
|
|
|
* Add Minecraft dependencies to compile time.
|
|
|
|
*/
|
|
|
|
public final class CompileConfiguration {
|
|
|
|
private CompileConfiguration() {
|
2018-12-30 22:26:50 +00:00
|
|
|
}
|
|
|
|
|
2020-12-24 20:58:30 +00:00
|
|
|
public static void setupConfigurations(Project project) {
|
2020-09-21 19:22:31 +00:00
|
|
|
Configuration modCompileClasspathConfig = project.getConfigurations().maybeCreate(Constants.Configurations.MOD_COMPILE_CLASSPATH);
|
2019-05-28 07:23:19 +00:00
|
|
|
modCompileClasspathConfig.setTransitive(true);
|
2020-09-21 19:22:31 +00:00
|
|
|
Configuration modCompileClasspathMappedConfig = project.getConfigurations().maybeCreate(Constants.Configurations.MOD_COMPILE_CLASSPATH_MAPPED);
|
2019-05-28 07:23:19 +00:00
|
|
|
modCompileClasspathMappedConfig.setTransitive(false);
|
|
|
|
|
2020-09-21 19:22:31 +00:00
|
|
|
Configuration minecraftNamedConfig = project.getConfigurations().maybeCreate(Constants.Configurations.MINECRAFT_NAMED);
|
2018-12-30 22:26:50 +00:00
|
|
|
minecraftNamedConfig.setTransitive(false); // The launchers do not recurse dependencies
|
2020-09-21 19:22:31 +00:00
|
|
|
Configuration minecraftDependenciesConfig = project.getConfigurations().maybeCreate(Constants.Configurations.MINECRAFT_DEPENDENCIES);
|
2018-12-30 22:26:50 +00:00
|
|
|
minecraftDependenciesConfig.setTransitive(false);
|
2020-12-21 19:34:00 +00:00
|
|
|
Configuration loaderDependenciesConfig = project.getConfigurations().maybeCreate(Constants.Configurations.LOADER_DEPENDENCIES);
|
|
|
|
loaderDependenciesConfig.setTransitive(false);
|
2020-09-21 19:22:31 +00:00
|
|
|
Configuration minecraftConfig = project.getConfigurations().maybeCreate(Constants.Configurations.MINECRAFT);
|
2018-12-30 22:26:50 +00:00
|
|
|
minecraftConfig.setTransitive(false);
|
2016-08-17 16:38:54 +00:00
|
|
|
|
2020-09-21 19:22:31 +00:00
|
|
|
Configuration includeConfig = project.getConfigurations().maybeCreate(Constants.Configurations.INCLUDE);
|
2019-04-07 14:18:11 +00:00
|
|
|
includeConfig.setTransitive(false); // Dont get transitive deps
|
|
|
|
|
2020-09-21 19:22:31 +00:00
|
|
|
project.getConfigurations().maybeCreate(Constants.Configurations.MAPPINGS);
|
|
|
|
project.getConfigurations().maybeCreate(Constants.Configurations.MAPPINGS_FINAL);
|
2021-02-14 13:56:22 +00:00
|
|
|
project.getConfigurations().maybeCreate(Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES);
|
2018-11-05 15:54:14 +00:00
|
|
|
|
2019-05-28 07:23:19 +00:00
|
|
|
for (RemappedConfigurationEntry entry : Constants.MOD_COMPILE_ENTRIES) {
|
|
|
|
Configuration compileModsConfig = project.getConfigurations().maybeCreate(entry.getSourceConfiguration());
|
|
|
|
compileModsConfig.setTransitive(true);
|
|
|
|
Configuration compileModsMappedConfig = project.getConfigurations().maybeCreate(entry.getRemappedConfiguration());
|
|
|
|
compileModsMappedConfig.setTransitive(false); // Don't get transitive deps of already remapped mods
|
|
|
|
|
2020-12-24 20:58:30 +00:00
|
|
|
extendsFrom(entry.getTargetConfiguration(project.getConfigurations()), entry.getRemappedConfiguration(), project);
|
2019-11-02 20:23:27 +00:00
|
|
|
|
2019-05-28 07:23:19 +00:00
|
|
|
if (entry.isOnModCompileClasspath()) {
|
2020-12-24 20:58:30 +00:00
|
|
|
extendsFrom(Constants.Configurations.MOD_COMPILE_CLASSPATH, entry.getSourceConfiguration(), project);
|
|
|
|
extendsFrom(Constants.Configurations.MOD_COMPILE_CLASSPATH_MAPPED, entry.getRemappedConfiguration(), project);
|
2019-05-28 07:23:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-24 20:58:30 +00:00
|
|
|
extendsFrom(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME, Constants.Configurations.MINECRAFT_NAMED, project);
|
|
|
|
extendsFrom(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME, Constants.Configurations.MINECRAFT_NAMED, project);
|
|
|
|
extendsFrom(JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME, Constants.Configurations.MINECRAFT_NAMED, project);
|
|
|
|
extendsFrom(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME, Constants.Configurations.MINECRAFT_NAMED, project);
|
2018-12-30 23:42:49 +00:00
|
|
|
|
2020-12-24 20:58:30 +00:00
|
|
|
extendsFrom(Constants.Configurations.LOADER_DEPENDENCIES, Constants.Configurations.MINECRAFT_DEPENDENCIES, project);
|
|
|
|
extendsFrom(Constants.Configurations.MINECRAFT_NAMED, Constants.Configurations.LOADER_DEPENDENCIES, project);
|
2019-12-11 14:42:02 +00:00
|
|
|
|
2021-01-17 18:34:22 +00:00
|
|
|
extendsFrom(JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, Constants.Configurations.MAPPINGS_FINAL, project);
|
2021-02-14 13:56:22 +00:00
|
|
|
|
|
|
|
extendsFrom(JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES, project);
|
2020-05-22 13:38:25 +00:00
|
|
|
}
|
|
|
|
|
2016-08-17 16:38:54 +00:00
|
|
|
/**
|
2019-11-02 20:23:27 +00:00
|
|
|
* Permit to add a Maven repository to a target project.
|
2016-08-17 16:38:54 +00:00
|
|
|
*
|
2020-07-26 20:32:10 +00:00
|
|
|
* @param target The target project
|
2019-11-11 16:52:13 +00:00
|
|
|
* @param name The name of the repository
|
|
|
|
* @param url The URL of the repository
|
2016-08-17 16:38:54 +00:00
|
|
|
* @return An object containing the name and the URL of the repository that can be modified later
|
|
|
|
*/
|
2020-12-24 20:58:30 +00:00
|
|
|
public static MavenArtifactRepository addMavenRepo(Project target, final String name, final String url) {
|
2016-08-17 16:38:54 +00:00
|
|
|
return target.getRepositories().maven(repo -> {
|
|
|
|
repo.setName(name);
|
|
|
|
repo.setUrl(url);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-12-24 20:58:30 +00:00
|
|
|
public static void configureCompile(Project project) {
|
2016-08-17 16:38:54 +00:00
|
|
|
JavaPluginConvention javaModule = (JavaPluginConvention) project.getConvention().getPlugins().get("java");
|
|
|
|
|
|
|
|
SourceSet main = javaModule.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
|
|
|
|
|
|
|
|
Javadoc javadoc = (Javadoc) project.getTasks().getByName(JavaPlugin.JAVADOC_TASK_NAME);
|
|
|
|
javadoc.setClasspath(main.getOutput().plus(main.getCompileClasspath()));
|
|
|
|
|
|
|
|
project.afterEvaluate(project1 -> {
|
|
|
|
LoomGradleExtension extension = project1.getExtensions().getByType(LoomGradleExtension.class);
|
|
|
|
|
2016-08-29 10:08:23 +00:00
|
|
|
project1.getRepositories().flatDir(flatDirectoryArtifactRepository -> {
|
2019-04-21 09:18:45 +00:00
|
|
|
flatDirectoryArtifactRepository.dir(extension.getRootProjectBuildCache());
|
2016-08-29 10:08:23 +00:00
|
|
|
flatDirectoryArtifactRepository.setName("UserLocalCacheFiles");
|
|
|
|
});
|
|
|
|
|
2020-12-21 19:33:23 +00:00
|
|
|
project1.getRepositories().maven(mavenArtifactRepository -> {
|
|
|
|
mavenArtifactRepository.setUrl(extension.getRemappedModCache());
|
|
|
|
mavenArtifactRepository.setName("UserLocalRemappedMods");
|
2018-12-22 13:44:34 +00:00
|
|
|
});
|
|
|
|
|
2018-06-18 15:16:03 +00:00
|
|
|
project1.getRepositories().maven(mavenArtifactRepository -> {
|
2018-12-09 07:21:32 +00:00
|
|
|
mavenArtifactRepository.setName("Fabric");
|
|
|
|
mavenArtifactRepository.setUrl("https://maven.fabricmc.net/");
|
2018-06-18 15:16:03 +00:00
|
|
|
});
|
|
|
|
|
2016-08-17 16:38:54 +00:00
|
|
|
project1.getRepositories().maven(mavenArtifactRepository -> {
|
|
|
|
mavenArtifactRepository.setName("Mojang");
|
|
|
|
mavenArtifactRepository.setUrl("https://libraries.minecraft.net/");
|
|
|
|
});
|
|
|
|
|
|
|
|
project1.getRepositories().mavenCentral();
|
|
|
|
|
2018-11-04 21:28:46 +00:00
|
|
|
LoomDependencyManager dependencyManager = new LoomDependencyManager();
|
|
|
|
extension.setDependencyManager(dependencyManager);
|
2016-08-17 16:38:54 +00:00
|
|
|
|
2020-12-24 20:58:30 +00:00
|
|
|
dependencyManager.addProvider(new MinecraftProvider(project));
|
|
|
|
dependencyManager.addProvider(new MappingsProvider(project));
|
|
|
|
dependencyManager.addProvider(new LaunchProvider(project));
|
2019-04-22 11:41:16 +00:00
|
|
|
|
2018-11-04 21:28:46 +00:00
|
|
|
dependencyManager.handleDependencies(project1);
|
2018-10-29 11:55:30 +00:00
|
|
|
|
2018-11-04 21:28:46 +00:00
|
|
|
project1.getTasks().getByName("idea").finalizedBy(project1.getTasks().getByName("genIdeaWorkspace"));
|
2018-12-12 13:43:42 +00:00
|
|
|
project1.getTasks().getByName("eclipse").finalizedBy(project1.getTasks().getByName("genEclipseRuns"));
|
2020-04-26 13:04:49 +00:00
|
|
|
project1.getTasks().getByName("cleanEclipse").finalizedBy(project1.getTasks().getByName("cleanEclipseRuns"));
|
2018-11-05 12:00:54 +00:00
|
|
|
|
2021-02-11 18:50:25 +00:00
|
|
|
SetupIntelijRunConfigs.setup(project1);
|
2018-12-19 23:05:19 +00:00
|
|
|
|
2018-12-30 11:03:25 +00:00
|
|
|
// Enables the default mod remapper
|
2018-11-06 09:36:35 +00:00
|
|
|
if (extension.remapMod) {
|
|
|
|
AbstractArchiveTask jarTask = (AbstractArchiveTask) project1.getTasks().getByName("jar");
|
2019-05-10 22:53:50 +00:00
|
|
|
RemapJarTask remapJarTask = (RemapJarTask) project1.getTasks().findByName("remapJar");
|
2018-11-06 09:36:35 +00:00
|
|
|
|
2019-06-11 02:20:57 +00:00
|
|
|
assert remapJarTask != null;
|
2019-11-02 20:23:27 +00:00
|
|
|
|
2019-06-11 02:20:57 +00:00
|
|
|
if (!remapJarTask.getInput().isPresent()) {
|
2019-07-24 20:34:27 +00:00
|
|
|
jarTask.setClassifier("dev");
|
|
|
|
remapJarTask.setClassifier("");
|
|
|
|
remapJarTask.getInput().set(jarTask.getArchivePath());
|
2019-05-10 22:53:50 +00:00
|
|
|
}
|
|
|
|
|
2020-06-29 14:25:05 +00:00
|
|
|
extension.getUnmappedModCollection().from(jarTask);
|
2019-06-11 02:20:57 +00:00
|
|
|
remapJarTask.getAddNestedDependencies().set(true);
|
2020-05-11 11:48:04 +00:00
|
|
|
remapJarTask.getRemapAccessWidener().set(true);
|
2019-05-11 16:38:01 +00:00
|
|
|
|
2019-10-22 19:29:25 +00:00
|
|
|
project1.getArtifacts().add("archives", remapJarTask);
|
|
|
|
remapJarTask.dependsOn(jarTask);
|
2018-11-06 09:36:35 +00:00
|
|
|
project1.getTasks().getByName("build").dependsOn(remapJarTask);
|
2019-04-21 23:25:03 +00:00
|
|
|
|
2020-12-27 16:25:30 +00:00
|
|
|
project.getTasks().withType(RemapJarTask.class).forEach(task -> {
|
|
|
|
if (task.getAddNestedDependencies().getOrElse(false)) {
|
|
|
|
NestedJars.getRequiredTasks(project1).forEach(task::dependsOn);
|
2019-04-21 23:25:03 +00:00
|
|
|
}
|
2020-12-27 16:25:30 +00:00
|
|
|
});
|
2018-12-22 13:37:16 +00:00
|
|
|
|
2020-06-27 19:18:32 +00:00
|
|
|
SourceRemapper remapper = null;
|
|
|
|
Task parentTask = project1.getTasks().getByName("build");
|
|
|
|
|
|
|
|
if (extension.isShareCaches()) {
|
|
|
|
Project rootProject = project.getRootProject();
|
|
|
|
|
|
|
|
if (extension.isRootProject()) {
|
|
|
|
SourceRemapper sourceRemapper = new SourceRemapper(rootProject, false);
|
|
|
|
JarRemapper jarRemapper = new JarRemapper();
|
|
|
|
|
|
|
|
remapJarTask.jarRemapper = jarRemapper;
|
|
|
|
|
|
|
|
rootProject.getTasks().register("remapAllSources", RemapAllSourcesTask.class, task -> {
|
|
|
|
task.sourceRemapper = sourceRemapper;
|
|
|
|
task.doLast(t -> sourceRemapper.remapAll());
|
|
|
|
});
|
|
|
|
|
|
|
|
parentTask = rootProject.getTasks().getByName("remapAllSources");
|
|
|
|
|
2020-06-28 11:51:29 +00:00
|
|
|
rootProject.getTasks().register("remapAllJars", AbstractLoomTask.class, task -> {
|
2020-06-27 19:18:32 +00:00
|
|
|
task.doLast(t -> {
|
|
|
|
try {
|
|
|
|
jarRemapper.remap();
|
|
|
|
} catch (IOException e) {
|
|
|
|
throw new RuntimeException("Failed to remap jars", e);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
parentTask = rootProject.getTasks().getByName("remapAllSources");
|
|
|
|
remapper = ((RemapAllSourcesTask) parentTask).sourceRemapper;
|
|
|
|
|
|
|
|
remapJarTask.jarRemapper = ((RemapJarTask) rootProject.getTasks().getByName("remapJar")).jarRemapper;
|
2020-11-15 16:05:35 +00:00
|
|
|
|
|
|
|
project1.getTasks().getByName("build").dependsOn(parentTask);
|
|
|
|
project1.getTasks().getByName("build").dependsOn(rootProject.getTasks().getByName("remapAllJars"));
|
|
|
|
rootProject.getTasks().getByName("remapAllJars").dependsOn(project1.getTasks().getByName("remapJar"));
|
2020-06-27 19:18:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-12-22 13:37:16 +00:00
|
|
|
try {
|
|
|
|
AbstractArchiveTask sourcesTask = (AbstractArchiveTask) project1.getTasks().getByName("sourcesJar");
|
|
|
|
|
2019-05-10 22:53:50 +00:00
|
|
|
RemapSourcesJarTask remapSourcesJarTask = (RemapSourcesJarTask) project1.getTasks().findByName("remapSourcesJar");
|
|
|
|
remapSourcesJarTask.setInput(sourcesTask.getArchivePath());
|
|
|
|
remapSourcesJarTask.setOutput(sourcesTask.getArchivePath());
|
|
|
|
remapSourcesJarTask.doLast(task -> project1.getArtifacts().add("archives", remapSourcesJarTask.getOutput()));
|
2018-12-22 13:37:16 +00:00
|
|
|
remapSourcesJarTask.dependsOn(project1.getTasks().getByName("sourcesJar"));
|
2020-06-27 19:18:32 +00:00
|
|
|
|
|
|
|
if (extension.isShareCaches()) {
|
|
|
|
remapSourcesJarTask.setSourceRemapper(remapper);
|
|
|
|
}
|
|
|
|
|
|
|
|
parentTask.dependsOn(remapSourcesJarTask);
|
2020-07-26 20:32:10 +00:00
|
|
|
} catch (UnknownTaskException ignored) {
|
2018-12-22 13:37:16 +00:00
|
|
|
// pass
|
|
|
|
}
|
2018-12-12 06:10:30 +00:00
|
|
|
} else {
|
|
|
|
AbstractArchiveTask jarTask = (AbstractArchiveTask) project1.getTasks().getByName("jar");
|
2020-06-29 14:25:05 +00:00
|
|
|
extension.getUnmappedModCollection().from(jarTask);
|
2016-10-12 09:44:31 +00:00
|
|
|
}
|
2020-06-23 18:22:36 +00:00
|
|
|
|
2020-10-21 07:57:13 +00:00
|
|
|
// Disable some things used by log4j via the mixin AP that prevent it from being garbage collected
|
|
|
|
System.setProperty("log4j2.disable.jmx", "true");
|
|
|
|
System.setProperty("log4j.shutdownHookEnabled", "false");
|
2021-02-13 18:04:16 +00:00
|
|
|
System.setProperty("log4j.skipJansi", "true");
|
2020-10-21 07:57:13 +00:00
|
|
|
|
|
|
|
project.getLogger().info("Configuring compiler arguments for Java");
|
2020-06-23 18:22:36 +00:00
|
|
|
new JavaApInvoker(project).configureMixin();
|
|
|
|
|
|
|
|
if (project.getPluginManager().hasPlugin("scala")) {
|
2020-10-21 07:57:13 +00:00
|
|
|
project.getLogger().info("Configuring compiler arguments for Scala");
|
2020-06-23 18:22:36 +00:00
|
|
|
new ScalaApInvoker(project).configureMixin();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (project.getPluginManager().hasPlugin("org.jetbrains.kotlin.kapt")) {
|
2020-10-21 07:57:13 +00:00
|
|
|
project.getLogger().info("Configuring compiler arguments for Kapt plugin");
|
2020-06-23 18:22:36 +00:00
|
|
|
new KaptApInvoker(project).configureMixin();
|
|
|
|
}
|
2016-10-12 09:22:08 +00:00
|
|
|
});
|
2020-06-23 18:22:36 +00:00
|
|
|
|
|
|
|
if (project.getPluginManager().hasPlugin("org.jetbrains.kotlin.kapt")) {
|
|
|
|
// If loom is applied after kapt, then kapt will use the AP arguments too early for loom to pass the arguments we need for mixin.
|
|
|
|
throw new IllegalArgumentException("fabric-loom must be applied BEFORE kapt in the plugins { } block.");
|
|
|
|
}
|
2016-08-29 10:08:23 +00:00
|
|
|
}
|
2019-03-30 20:08:25 +00:00
|
|
|
|
2020-12-24 20:58:30 +00:00
|
|
|
private static void extendsFrom(String a, String b, Project project) {
|
|
|
|
project.getConfigurations().getByName(a).extendsFrom(project.getConfigurations().getByName(b));
|
2019-04-21 16:42:51 +00:00
|
|
|
}
|
2016-08-15 10:22:14 +00:00
|
|
|
}
|