Merge remote-tracking branch 'FabricMC/dev/0.10' into dev/0.10.0

This commit is contained in:
shedaniel
2021-10-30 18:54:16 +08:00
14 changed files with 260 additions and 7 deletions

View File

@@ -103,6 +103,10 @@ public final class CompileConfiguration {
}
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);
@@ -110,6 +114,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())
@@ -210,6 +216,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.");

View File

@@ -209,7 +209,7 @@ public abstract class GenerateSourcesTask extends AbstractLoomTask {
try (IPCClient ipcClient = new IPCClient(ipcPath)) {
doDecompile(new ThreadedSimpleProgressLogger(ipcClient));
} catch (Exception e) {
throw new RuntimeException("Failed to setup IPC Client", e);
throw new RuntimeException("Failed to decompile", e);
}
}

View File

@@ -50,7 +50,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() {
@@ -82,6 +83,13 @@ public class Constants {
public static final String FORGE_EXTRA = "forgeExtra";
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() {
}