mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Merge remote-tracking branch 'upstream/dev/1.0' into dev/1.0
This commit is contained in:
@@ -112,7 +112,7 @@ dependencies {
|
||||
implementation ('net.fabricmc:cfr:0.1.1')
|
||||
|
||||
// source code remapping
|
||||
implementation ('dev.architectury:mercury:0.1.1.11')
|
||||
implementation ('dev.architectury:mercury:0.1.2.15')
|
||||
|
||||
// Kotlin
|
||||
implementation('org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.4.2') {
|
||||
|
||||
@@ -103,7 +103,7 @@ public interface LoomGradleExtensionAPI {
|
||||
}
|
||||
|
||||
default List<RemapConfigurationSettings> getRuntimeRemapConfigurations() {
|
||||
return getRemapConfigurations().stream().filter(element -> element.getOnCompileClasspath().get()).toList();
|
||||
return getRemapConfigurations().stream().filter(element -> element.getOnRuntimeClasspath().get()).toList();
|
||||
}
|
||||
|
||||
@ApiStatus.Experimental
|
||||
|
||||
@@ -66,15 +66,17 @@ public abstract class AnnotationProcessorInvoker<T extends Task> {
|
||||
protected final Project project;
|
||||
protected final MixinExtension mixinExtension;
|
||||
protected final Map<SourceSet, T> invokerTasks;
|
||||
private final String name;
|
||||
private final Collection<Configuration> apConfigurations;
|
||||
|
||||
protected AnnotationProcessorInvoker(Project project,
|
||||
Collection<Configuration> apConfigurations,
|
||||
Map<SourceSet, T> invokerTasks) {
|
||||
Collection<Configuration> apConfigurations,
|
||||
Map<SourceSet, T> invokerTasks, String name) {
|
||||
this.project = project;
|
||||
this.mixinExtension = LoomGradleExtension.get(project).getMixin();
|
||||
this.apConfigurations = apConfigurations;
|
||||
this.invokerTasks = invokerTasks;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
protected static Collection<Configuration> getApConfigurations(Project project, Function<SourceSet, String> getApConfigNameFunc) {
|
||||
@@ -95,9 +97,14 @@ public abstract class AnnotationProcessorInvoker<T extends Task> {
|
||||
LoomGradleExtension loom = LoomGradleExtension.get(project);
|
||||
String refmapName = Objects.requireNonNull(MixinExtension.getMixinInformationContainer(sourceSet)).refmapNameProvider().get();
|
||||
Path mappings = loom.getMappingsProvider().getReplacedTarget(loom, loom.getMixin().getRefmapTargetNamespace().get());
|
||||
|
||||
final File mixinMappings = MixinMappingsService.getMixinMappingFile(project, sourceSet);
|
||||
|
||||
task.getOutputs().file(mixinMappings).withPropertyName("mixin-ap-" + sourceSet.getName() + "-" + name).optional();
|
||||
|
||||
Map<String, String> args = new HashMap<>() {{
|
||||
put(Constants.MixinArguments.IN_MAP_FILE_NAMED_INTERMEDIARY, mappings.toFile().getCanonicalPath());
|
||||
put(Constants.MixinArguments.OUT_MAP_FILE_NAMED_INTERMEDIARY, MixinMappingsService.getMixinMappingFile(project, sourceSet).getCanonicalPath());
|
||||
put(Constants.MixinArguments.OUT_MAP_FILE_NAMED_INTERMEDIARY, mixinMappings.getCanonicalPath());
|
||||
put(Constants.MixinArguments.OUT_REFMAP_FILE, getRefmapDestination(task, refmapName));
|
||||
put(Constants.MixinArguments.DEFAULT_OBFUSCATION_ENV, "named:" + IntermediaryNamespaces.replaceMixinIntermediaryNamespace(project, loom.getMixin().getRefmapTargetNamespace().get()));
|
||||
put(Constants.MixinArguments.QUIET, "true");
|
||||
|
||||
@@ -42,7 +42,8 @@ public class GroovyApInvoker extends AnnotationProcessorInvoker<GroovyCompile> {
|
||||
super(
|
||||
project,
|
||||
ImmutableList.of(),
|
||||
getInvokerTasks(project));
|
||||
getInvokerTasks(project),
|
||||
AnnotationProcessorInvoker.GROOVY);
|
||||
}
|
||||
|
||||
private static Map<SourceSet, GroovyCompile> getInvokerTasks(Project project) {
|
||||
|
||||
@@ -41,7 +41,8 @@ public class JavaApInvoker extends AnnotationProcessorInvoker<JavaCompile> {
|
||||
super(
|
||||
project,
|
||||
AnnotationProcessorInvoker.getApConfigurations(project, SourceSet::getAnnotationProcessorConfigurationName),
|
||||
getInvokerTasks(project));
|
||||
getInvokerTasks(project),
|
||||
AnnotationProcessorInvoker.JAVA);
|
||||
}
|
||||
|
||||
private static Map<SourceSet, JavaCompile> getInvokerTasks(Project project) {
|
||||
|
||||
@@ -51,7 +51,8 @@ public class KaptApInvoker extends AnnotationProcessorInvoker<JavaCompile> {
|
||||
super(
|
||||
project,
|
||||
AnnotationProcessorInvoker.getApConfigurations(project, KaptApInvoker::getKaptConfigurationName),
|
||||
getInvokerTasks(project));
|
||||
getInvokerTasks(project),
|
||||
"Kotlin");
|
||||
|
||||
try {
|
||||
dummyRefmapDirectory = Files.createTempDirectory("temp_refmap").toFile();
|
||||
|
||||
@@ -43,7 +43,8 @@ public class ScalaApInvoker extends AnnotationProcessorInvoker<ScalaCompile> {
|
||||
project,
|
||||
// Scala just uses the java AP configuration afaik. This of course assumes the java AP also gets configured.
|
||||
ImmutableList.of(),
|
||||
getInvokerTasks(project));
|
||||
getInvokerTasks(project),
|
||||
AnnotationProcessorInvoker.SCALA);
|
||||
}
|
||||
|
||||
private static Map<SourceSet, ScalaCompile> getInvokerTasks(Project project) {
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
package net.fabricmc.loom.util;
|
||||
|
||||
import org.eclipse.jdt.core.JavaCore;
|
||||
import org.objectweb.asm.Opcodes;
|
||||
|
||||
public class Constants {
|
||||
@@ -36,8 +35,7 @@ public class Constants {
|
||||
public static final String FABRIC_REPOSITORY = "https://maven.fabricmc.net/";
|
||||
|
||||
public static final int ASM_VERSION = Opcodes.ASM9;
|
||||
public static final String MERCURY_SOURCE_VERSION = JavaCore.VERSION_15;
|
||||
// TODO: once we update Mercury: public static final String MERCURY_SOURCE_VERSION = JavaCore.VERSION_17;
|
||||
public static final String MERCURY_SOURCE_VERSION = "17";
|
||||
|
||||
private Constants() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user