Add modCompileOnlyApi, modRuntimeOnly; deprecate modRuntime (#458)
parent
f9a06cbd41
commit
a0c2d877af
|
@ -151,6 +151,11 @@ public class ModCompileRemapper {
|
|||
for (ModDependencyInfo info : modDependencies) {
|
||||
project.getDependencies().add(info.targetConfig.getName(), info.getRemappedNotation());
|
||||
}
|
||||
|
||||
// Report deprecation warnings
|
||||
if (entry.replacedWith() != null && !modDependencies.isEmpty()) {
|
||||
extension.getDeprecationHelper().replaceWithInLoom0_11(entry.sourceConfiguration(), entry.replacedWith());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,8 +26,13 @@ package net.fabricmc.loom.configuration;
|
|||
|
||||
import org.gradle.api.artifacts.ConfigurationContainer;
|
||||
import org.gradle.api.plugins.JavaPlugin;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public record RemappedConfigurationEntry(String sourceConfiguration, String targetConfiguration, boolean isOnModCompileClasspath, String mavenScope, @Nullable String replacedWith) {
|
||||
public RemappedConfigurationEntry(String sourceConfiguration, String targetConfiguration, boolean isOnModCompileClasspath, String mavenScope) {
|
||||
this(sourceConfiguration, targetConfiguration, isOnModCompileClasspath, mavenScope, null);
|
||||
}
|
||||
|
||||
public record RemappedConfigurationEntry(String sourceConfiguration, String targetConfiguration, boolean isOnModCompileClasspath, String mavenScope) {
|
||||
public boolean hasMavenScope() {
|
||||
return mavenScope != null && !mavenScope.isEmpty();
|
||||
}
|
||||
|
|
|
@ -45,8 +45,10 @@ public class Constants {
|
|||
public static final List<RemappedConfigurationEntry> MOD_COMPILE_ENTRIES = ImmutableList.of(
|
||||
new RemappedConfigurationEntry("modApi", JavaPlugin.API_CONFIGURATION_NAME, true, "compile"),
|
||||
new RemappedConfigurationEntry("modImplementation", JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, true, "runtime"),
|
||||
new RemappedConfigurationEntry("modRuntime", JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, false, ""),
|
||||
new RemappedConfigurationEntry("modCompileOnly", JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME, true, "")
|
||||
new RemappedConfigurationEntry("modRuntime", JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, false, "", "modRuntimeOnly"),
|
||||
new RemappedConfigurationEntry("modCompileOnly", JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME, true, ""),
|
||||
new RemappedConfigurationEntry("modCompileOnlyApi", JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME, true, "compile"),
|
||||
new RemappedConfigurationEntry("modRuntimeOnly", JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME, false, "runtime")
|
||||
);
|
||||
|
||||
private Constants() {
|
||||
|
|
Loading…
Reference in New Issue