mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 13:37:45 -05:00
Bump to 0.9.1 and fix conflicts
Signed-off-by: shedaniel <daniel@shedaniel.me>
This commit is contained in:
@@ -22,7 +22,7 @@ tasks.withType(JavaCompile).configureEach {
|
||||
|
||||
group = "dev.architectury"
|
||||
archivesBaseName = project.name
|
||||
def baseVersion = '0.9.0'
|
||||
def baseVersion = '0.9.1'
|
||||
def runNumber = System.getenv("GITHUB_RUN_NUMBER") ?: "9999"
|
||||
|
||||
def isSnapshot = System.getenv("PR_NUM") != null
|
||||
|
||||
@@ -37,7 +37,6 @@ 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.Property;
|
||||
import org.gradle.api.tasks.SourceSet;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* This file is part of fabric-loom, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2021 FabricMC
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package net.fabricmc.loom.configuration.providers.minecraft.tr;
|
||||
|
||||
import org.cadixdev.mercury.Mercury;
|
||||
|
||||
public class MercuryUtils {
|
||||
public static Mercury copyMercury(Mercury mercury) {
|
||||
Mercury copy = new Mercury();
|
||||
copy.getClassPath().addAll(mercury.getClassPath());
|
||||
copy.getContext().putAll(mercury.getContext());
|
||||
copy.getProcessors().addAll(mercury.getProcessors());
|
||||
copy.setEncoding(mercury.getEncoding());
|
||||
copy.setFlexibleAnonymousClassMemberLookups(mercury.isFlexibleAnonymousClassMemberLookups());
|
||||
copy.setGracefulClasspathChecks(mercury.isGracefulClasspathChecks());
|
||||
copy.setGracefulJavadocClasspathChecks(mercury.isGracefulJavadocClasspathChecks());
|
||||
copy.setSourceCompatibility(mercury.getSourceCompatibility());
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,15 @@
|
||||
|
||||
package net.fabricmc.loom.extension;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -34,11 +43,9 @@ import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Dependency;
|
||||
import org.gradle.api.file.ConfigurableFileCollection;
|
||||
import org.gradle.api.file.RegularFileProperty;
|
||||
import org.gradle.api.plugins.BasePluginConvention;
|
||||
import org.gradle.api.provider.ListProperty;
|
||||
import org.gradle.api.provider.Property;
|
||||
import org.gradle.api.plugins.JavaPluginConvention;
|
||||
import org.gradle.api.provider.Property;
|
||||
import org.gradle.api.tasks.SourceSet;
|
||||
|
||||
import net.fabricmc.loom.api.LoomGradleExtensionAPI;
|
||||
@@ -169,24 +176,6 @@ public abstract class LoomGradleExtensionApiImpl implements LoomGradleExtensionA
|
||||
return remapArchives;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRefmapName() {
|
||||
if (refmapName == null || refmapName.isEmpty()) {
|
||||
String defaultRefmapName;
|
||||
|
||||
if (getProject().getRootProject() == getProject()) {
|
||||
defaultRefmapName = getProject().getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName() + "-refmap.json";
|
||||
} else {
|
||||
defaultRefmapName = getProject().getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName() + "-" + getProject().getPath().replaceFirst(":", "").replace(':', '_') + "-refmap.json";
|
||||
}
|
||||
|
||||
getProject().getLogger().info("Could not find refmap definition, will be using default name: " + defaultRefmapName);
|
||||
refmapName = defaultRefmapName;
|
||||
}
|
||||
|
||||
return refmapName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runs(Action<NamedDomainObjectContainer<RunConfigSettings>> action) {
|
||||
action.execute(runConfigs);
|
||||
|
||||
@@ -24,6 +24,12 @@
|
||||
|
||||
package net.fabricmc.loom.extension;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.gradle.api.Action;
|
||||
import org.gradle.api.NamedDomainObjectContainer;
|
||||
import org.gradle.api.artifacts.Dependency;
|
||||
@@ -31,14 +37,18 @@ 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.tasks.SourceSet;
|
||||
|
||||
import net.fabricmc.loom.api.LoomGradleExtensionAPI;
|
||||
import net.fabricmc.loom.api.MixinApExtensionAPI;
|
||||
import net.fabricmc.loom.api.decompilers.LoomDecompiler;
|
||||
import net.fabricmc.loom.configuration.ide.RunConfig;
|
||||
import net.fabricmc.loom.configuration.ide.RunConfigSettings;
|
||||
import net.fabricmc.loom.configuration.launch.LaunchProviderSettings;
|
||||
import net.fabricmc.loom.configuration.processors.JarProcessor;
|
||||
import net.fabricmc.loom.configuration.providers.mappings.LayeredMappingSpecBuilder;
|
||||
import net.fabricmc.loom.util.DeprecationHelper;
|
||||
import net.fabricmc.loom.util.ModPlatform;
|
||||
|
||||
public class MinecraftGradleExtension implements LoomGradleExtensionAPI {
|
||||
private final LoomGradleExtensionAPI parent;
|
||||
@@ -131,4 +141,124 @@ public class MinecraftGradleExtension implements LoomGradleExtensionAPI {
|
||||
reportDeprecation();
|
||||
return parent.getCustomMinecraftManifest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void silentMojangMappingsLicense() {
|
||||
reportDeprecation();
|
||||
parent.silentMojangMappingsLicense();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSilentMojangMappingsLicenseEnabled() {
|
||||
reportDeprecation();
|
||||
return parent.isSilentMojangMappingsLicenseEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Property<ModPlatform> getPlatform() {
|
||||
reportDeprecation();
|
||||
return parent.getPlatform();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsInclude() {
|
||||
reportDeprecation();
|
||||
return parent.supportsInclude();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setGenerateSrgTiny(Boolean generateSrgTiny) {
|
||||
reportDeprecation();
|
||||
parent.setGenerateSrgTiny(generateSrgTiny);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldGenerateSrgTiny() {
|
||||
reportDeprecation();
|
||||
return parent.shouldGenerateSrgTiny();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void launches(Action<NamedDomainObjectContainer<LaunchProviderSettings>> action) {
|
||||
reportDeprecation();
|
||||
parent.launches(action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NamedDomainObjectContainer<LaunchProviderSettings> getLaunchConfigs() {
|
||||
reportDeprecation();
|
||||
return parent.getLaunchConfigs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getDataGenMods() {
|
||||
reportDeprecation();
|
||||
return parent.getDataGenMods();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void localMods(Action<SourceSetConsumer> action) {
|
||||
reportDeprecation();
|
||||
parent.localMods(action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Supplier<SourceSet>> getForgeLocalMods() {
|
||||
reportDeprecation();
|
||||
return parent.getForgeLocalMods();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dataGen(Action<DataGenConsumer> action) {
|
||||
reportDeprecation();
|
||||
parent.dataGen(action);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTasksBeforeRun() {
|
||||
reportDeprecation();
|
||||
return parent.getTasksBeforeRun();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mixinConfig(String... config) {
|
||||
reportDeprecation();
|
||||
parent.mixinConfig(config);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMixinConfigs() {
|
||||
reportDeprecation();
|
||||
return parent.getMixinConfigs();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accessTransformer(Object file) {
|
||||
reportDeprecation();
|
||||
parent.accessTransformer(file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<File> getAccessTransformers() {
|
||||
reportDeprecation();
|
||||
return parent.getAccessTransformers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseFabricMixin() {
|
||||
reportDeprecation();
|
||||
return parent.isUseFabricMixin();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUseFabricMixin(boolean useFabricMixin) {
|
||||
reportDeprecation();
|
||||
parent.setUseFabricMixin(useFabricMixin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Consumer<RunConfig>> getSettingsPostEdit() {
|
||||
reportDeprecation();
|
||||
return parent.getSettingsPostEdit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,11 @@ public class MixinApExtensionImpl extends MixinApExtensionApiImpl implements Mix
|
||||
|
||||
private String getDefaultMixinRefmapName() {
|
||||
String defaultRefmapName = getProject().getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName() + "-refmap.json";
|
||||
|
||||
if (getProject().getRootProject() != getProject()) {
|
||||
defaultRefmapName = getProject().getConvention().getPlugin(BasePluginConvention.class).getArchivesBaseName() + "-" + getProject().getPath().replaceFirst(":", "").replace(':', '_') + "-refmap.json";
|
||||
}
|
||||
|
||||
getProject().getLogger().info("Could not find refmap definition, will be using default name: " + defaultRefmapName);
|
||||
return defaultRefmapName;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import net.fabricmc.loom.util.Constants;
|
||||
|
||||
public abstract class AbstractLoomTask extends DefaultTask {
|
||||
public AbstractLoomTask() {
|
||||
setGroup(Constants.TASK_CATEGORY);
|
||||
setGroup(Constants.TaskGroup.FABRIC);
|
||||
}
|
||||
|
||||
@Internal
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Deque;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -51,7 +52,6 @@ import org.zeroturnaround.zip.ZipUtil;
|
||||
import net.fabricmc.loom.LoomGradleExtension;
|
||||
import net.fabricmc.loom.configuration.RemappedConfigurationEntry;
|
||||
import net.fabricmc.loom.configuration.providers.mappings.MappingsProviderImpl;
|
||||
import net.fabricmc.loom.configuration.providers.minecraft.tr.MercuryUtils;
|
||||
import net.fabricmc.lorenztiny.TinyMappingsReader;
|
||||
import net.fabricmc.mapping.tree.TinyTree;
|
||||
import net.fabricmc.stitch.util.StitchUtil;
|
||||
@@ -114,13 +114,13 @@ public class SourceRemapper {
|
||||
{
|
||||
// We have to build the Mercury instances on the main thread as createMercuryRemapper resolves gradle stuff
|
||||
// TODO refactor this a bit to not do that.
|
||||
var mercuryQueue = new ConcurrentLinkedDeque<Mercury>();
|
||||
Deque<Mercury> mercuryQueue = new ConcurrentLinkedDeque<>();
|
||||
|
||||
final var remapper = createMercuryRemapper();
|
||||
final var inputClasspath = getInputClasspath(project);
|
||||
final SourceProcessor remapper = createMercuryRemapper();
|
||||
final Set<Path> inputClasspath = getInputClasspath(project);
|
||||
|
||||
for (int i = 0; i < threads; i++) {
|
||||
Mercury mercury = createMercuryWithClassPath(project, toNamed);
|
||||
Mercury mercury = createMercuryWithClassPath(project, to.equals("named"));
|
||||
mercury.getProcessors().add(remapper);
|
||||
mercury.getClassPath().addAll(inputClasspath);
|
||||
|
||||
@@ -277,17 +277,17 @@ public class SourceRemapper {
|
||||
}
|
||||
|
||||
public static Mercury createMercuryWithClassPath(Project project, boolean toNamed) {
|
||||
var mercury = new Mercury();
|
||||
Mercury mercury = new Mercury();
|
||||
mercury.setGracefulClasspathChecks(true);
|
||||
|
||||
var classpath = mercury.getClassPath();
|
||||
List<Path> classpath = mercury.getClassPath();
|
||||
classpath.addAll(getCompileClasspath(project, toNamed));
|
||||
|
||||
return mercury;
|
||||
}
|
||||
|
||||
private static Set<Path> getCompileClasspath(Project project, boolean toNamed) {
|
||||
var classpath = new HashSet<Path>();
|
||||
Set<Path> classpath = new HashSet<>();
|
||||
|
||||
for (File file : project.getConfigurations().getByName(Constants.Configurations.LOADER_DEPENDENCIES).getFiles()) {
|
||||
classpath.add(file.toPath());
|
||||
@@ -311,7 +311,7 @@ public class SourceRemapper {
|
||||
private static Set<Path> getInputClasspath(Project project) {
|
||||
LoomGradleExtension extension = LoomGradleExtension.get(project);
|
||||
|
||||
var classpath = new HashSet<Path>();
|
||||
Set<Path> classpath = new HashSet<Path>();
|
||||
|
||||
for (File file : extension.getUnmappedModCollection()) {
|
||||
Path path = file.toPath();
|
||||
@@ -324,6 +324,13 @@ public class SourceRemapper {
|
||||
classpath.add(extension.getMinecraftMappedProvider().getMappedJar().toPath());
|
||||
classpath.add(extension.getMinecraftMappedProvider().getIntermediaryJar().toPath());
|
||||
|
||||
if (extension.isForge()) {
|
||||
classpath.add(extension.getMinecraftMappedProvider().getSrgJar().toPath());
|
||||
classpath.add(extension.getMinecraftMappedProvider().getForgeMappedJar().toPath());
|
||||
classpath.add(extension.getMinecraftMappedProvider().getForgeIntermediaryJar().toPath());
|
||||
classpath.add(extension.getMinecraftMappedProvider().getForgeSrgJar().toPath());
|
||||
}
|
||||
|
||||
Set<File> files = project.getConfigurations()
|
||||
.detachedConfiguration(project.getDependencies().create(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS))
|
||||
.resolve();
|
||||
|
||||
Reference in New Issue
Block a user