Add localRuntime and modLocalRuntime configurations (#526)

Closes #481.

Co-authored-by: modmuss50 <modmuss50@gmail.com>
This commit is contained in:
Juuxel
2021-10-30 00:26:59 +03:00
committed by GitHub
parent e409f13b8c
commit 587db4abae
11 changed files with 250 additions and 1 deletions

View File

@@ -68,6 +68,8 @@ public final class CompileConfiguration {
extension.createLazyConfiguration(Constants.Configurations.MAPPINGS_FINAL);
extension.createLazyConfiguration(Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES);
extension.createLazyConfiguration(Constants.Configurations.UNPICK_CLASSPATH);
extension.createLazyConfiguration(Constants.Configurations.LOCAL_RUNTIME);
extendsFrom(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME, Constants.Configurations.LOCAL_RUNTIME, project);
for (RemappedConfigurationEntry entry : Constants.MOD_COMPILE_ENTRIES) {
extension.createLazyConfiguration(entry.sourceConfiguration())

View File

@@ -49,7 +49,8 @@ public class Constants {
new RemappedConfigurationEntry("modRuntime", JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, false, true, "", "modRuntimeOnly"),
new RemappedConfigurationEntry("modCompileOnly", JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME, true, false, ""),
new RemappedConfigurationEntry("modCompileOnlyApi", JavaPlugin.COMPILE_ONLY_API_CONFIGURATION_NAME, true, false, JavaPlugin.API_ELEMENTS_CONFIGURATION_NAME),
new RemappedConfigurationEntry("modRuntimeOnly", JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, false, true, JavaPlugin.RUNTIME_ELEMENTS_CONFIGURATION_NAME)
new RemappedConfigurationEntry("modRuntimeOnly", JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, false, true, JavaPlugin.RUNTIME_ELEMENTS_CONFIGURATION_NAME),
new RemappedConfigurationEntry("modLocalRuntime", Configurations.LOCAL_RUNTIME, false, true, "")
);
private Constants() {
@@ -72,6 +73,12 @@ 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";
/**
* A configuration that behaves like {@code runtimeOnly} but is not
* exposed in {@code runtimeElements} to dependents. A bit like
* {@code testRuntimeOnly}, but for mods.
*/
public static final String LOCAL_RUNTIME = "localRuntime";
public static final String NAMED_ELEMENTS = "namedElements";
private Configurations() {