mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 05:27:43 -05:00
@@ -37,6 +37,7 @@ import org.gradle.api.file.ConfigurableFileCollection;
|
||||
import org.gradle.api.file.RegularFileProperty;
|
||||
import org.gradle.api.provider.ListProperty;
|
||||
import org.gradle.api.provider.Property;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.tasks.SourceSet;
|
||||
import org.gradle.api.publish.maven.MavenPublication;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
@@ -219,7 +220,7 @@ public interface LoomGradleExtensionAPI {
|
||||
|
||||
boolean isSilentMojangMappingsLicenseEnabled();
|
||||
|
||||
Property<ModPlatform> getPlatform();
|
||||
Provider<ModPlatform> getPlatform();
|
||||
|
||||
default boolean isForge() {
|
||||
return getPlatform().get() == ModPlatform.FORGE;
|
||||
|
||||
@@ -95,7 +95,7 @@ public final class MavenPublication {
|
||||
|
||||
if (hasSoftwareComponent(publication) || EXCLUDED_PUBLICATIONS.contains(publication)) {
|
||||
continue;
|
||||
} else if (!reportedDeprecation.get()) {
|
||||
} else if (!reportedDeprecation.get() && !LoomGradleExtension.get(project).isForge()) {
|
||||
DeprecationHelper deprecationHelper = LoomGradleExtension.get(project).getDeprecationHelper();
|
||||
deprecationHelper.warn("Loom is applying dependency data manually to publications instead of using a software component (from(components[\"java\"])). This is deprecated and will be removed in Loom 0.12.");
|
||||
reportedDeprecation.set(true);
|
||||
|
||||
@@ -46,6 +46,7 @@ import org.gradle.api.file.RegularFileProperty;
|
||||
import org.gradle.api.plugins.JavaPluginConvention;
|
||||
import org.gradle.api.provider.ListProperty;
|
||||
import org.gradle.api.provider.Property;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.publish.maven.MavenPublication;
|
||||
import org.gradle.api.tasks.SourceSet;
|
||||
|
||||
@@ -91,7 +92,7 @@ public abstract class LoomGradleExtensionApiImpl implements LoomGradleExtensionA
|
||||
// ===================
|
||||
// Architectury Loom
|
||||
// ===================
|
||||
private Property<ModPlatform> platform;
|
||||
private Provider<ModPlatform> platform;
|
||||
public List<String> mixinConfigs = new ArrayList<>(); // FORGE: Passed to Minecraft
|
||||
public Set<File> accessTransformers = new HashSet<>();
|
||||
public boolean useFabricMixin = true; // FORGE: Use Fabric Mixin for better refmap resolutions
|
||||
@@ -125,7 +126,7 @@ public abstract class LoomGradleExtensionApiImpl implements LoomGradleExtensionA
|
||||
this.versionParser = new ModVersionParser(project);
|
||||
|
||||
this.deprecationHelper = new DeprecationHelper.ProjectBased(project);
|
||||
this.platform = project.getObjects().property(ModPlatform.class).convention(project.provider(Suppliers.memoize(() -> {
|
||||
this.platform = project.provider(Suppliers.memoize(() -> {
|
||||
Object platformProperty = project.findProperty(PLATFORM_PROPERTY);
|
||||
|
||||
if (platformProperty != null) {
|
||||
@@ -140,7 +141,7 @@ public abstract class LoomGradleExtensionApiImpl implements LoomGradleExtensionA
|
||||
}
|
||||
|
||||
return ModPlatform.FABRIC;
|
||||
})::get));
|
||||
})::get);
|
||||
this.supportsInclude = new LazyBool(() -> Boolean.parseBoolean(Objects.toString(project.findProperty(INCLUDE_PROPERTY))));
|
||||
this.launchConfigs = project.container(LaunchProviderSettings.class,
|
||||
baseName -> new LaunchProviderSettings(project, baseName));
|
||||
@@ -241,7 +242,7 @@ public abstract class LoomGradleExtensionApiImpl implements LoomGradleExtensionA
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property<ModPlatform> getPlatform() {
|
||||
public Provider<ModPlatform> getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ import org.gradle.api.file.ConfigurableFileCollection;
|
||||
import org.gradle.api.file.RegularFileProperty;
|
||||
import org.gradle.api.provider.ListProperty;
|
||||
import org.gradle.api.provider.Property;
|
||||
import org.gradle.api.provider.Provider;
|
||||
import org.gradle.api.publish.maven.MavenPublication;
|
||||
import org.gradle.api.tasks.SourceSet;
|
||||
|
||||
@@ -175,7 +176,7 @@ public class MinecraftGradleExtension implements LoomGradleExtensionAPI {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property<ModPlatform> getPlatform() {
|
||||
public Provider<ModPlatform> getPlatform() {
|
||||
reportDeprecation();
|
||||
return parent.getPlatform();
|
||||
}
|
||||
|
||||
@@ -41,8 +41,6 @@ public enum ModPlatform {
|
||||
}
|
||||
|
||||
public static void assertPlatform(LoomGradleExtensionAPI extension, ModPlatform platform) {
|
||||
extension.getPlatform().finalizeValue();
|
||||
|
||||
if (extension.getPlatform().get() != platform) {
|
||||
String msg = "Loom is not running on %s.%nYou can switch to it by adding 'loom.platform = %s' to your gradle.properties";
|
||||
String name = platform.name().toLowerCase(Locale.ROOT);
|
||||
|
||||
Reference in New Issue
Block a user