mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-01 21:17:46 -05:00
Add dev config with default jar task on it, to aid with depending on … (#525)
* Add dev config with default jar task on it, to aid with depending on sub projects. * Rename to `namedElements` * Update src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com> Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>
This commit is contained in:
@@ -57,6 +57,10 @@ public final class CompileConfiguration {
|
||||
extension.createLazyConfiguration(Constants.Configurations.MINECRAFT).configure(configuration -> configuration.setTransitive(false));
|
||||
extension.createLazyConfiguration(Constants.Configurations.INCLUDE).configure(configuration -> configuration.setTransitive(false)); // Dont get transitive deps
|
||||
extension.createLazyConfiguration(Constants.Configurations.MAPPING_CONSTANTS);
|
||||
extension.createLazyConfiguration(Constants.Configurations.NAMED_ELEMENTS).configure(configuration -> {
|
||||
configuration.setCanBeConsumed(true);
|
||||
configuration.setCanBeResolved(false);
|
||||
});
|
||||
|
||||
extendsFrom(JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME, Constants.Configurations.MAPPING_CONSTANTS, project);
|
||||
|
||||
@@ -147,6 +151,9 @@ public final class CompileConfiguration {
|
||||
}
|
||||
});
|
||||
|
||||
// Add the "dev" jar to the "namedElements" configuration
|
||||
p.artifacts(artifactHandler -> artifactHandler.add(Constants.Configurations.NAMED_ELEMENTS, p.getTasks().getByName("jar")));
|
||||
|
||||
if (p.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.");
|
||||
|
||||
@@ -72,6 +72,7 @@ public class Constants {
|
||||
public static final String LOOM_DEVELOPMENT_DEPENDENCIES = "loomDevelopmentDependencies";
|
||||
public static final String MAPPING_CONSTANTS = "mappingsConstants";
|
||||
public static final String UNPICK_CLASSPATH = "unpick";
|
||||
public static final String NAMED_ELEMENTS = "namedElements";
|
||||
|
||||
private Configurations() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user