diff options
author | shedaniel <daniel@shedaniel.me> | 2021-07-11 00:21:59 +0800 |
---|---|---|
committer | shedaniel <daniel@shedaniel.me> | 2021-07-11 00:23:30 +0800 |
commit | facd9d61a59aab14ff2f70752bb2343af448e01b (patch) | |
tree | 06bd0500325ad9171e4d0ccacd96f81f007a5a78 /src | |
parent | 9729933433beaec9d8f6eee4077e6b04a1410054 (diff) | |
parent | b24e067215bd36f128210830c508535135a41c58 (diff) | |
download | architectury-loom-facd9d61a59aab14ff2f70752bb2343af448e01b.tar.gz architectury-loom-facd9d61a59aab14ff2f70752bb2343af448e01b.tar.bz2 architectury-loom-facd9d61a59aab14ff2f70752bb2343af448e01b.zip |
Merge remote-tracking branch 'FabricMC/dev/0.9' into dev/0.9
Signed-off-by: shedaniel <daniel@shedaniel.me>
# Conflicts:
# build.gradle
# src/main/java/net/fabricmc/loom/util/SourceRemapper.java
Diffstat (limited to 'src')
7 files changed, 21 insertions, 22 deletions
diff --git a/src/main/java/net/fabricmc/loom/configuration/providers/LaunchProvider.java b/src/main/java/net/fabricmc/loom/configuration/providers/LaunchProvider.java index 6325162c..521bf450 100644 --- a/src/main/java/net/fabricmc/loom/configuration/providers/LaunchProvider.java +++ b/src/main/java/net/fabricmc/loom/configuration/providers/LaunchProvider.java @@ -40,7 +40,6 @@ import java.util.stream.Collectors; import org.apache.commons.io.FileUtils; import org.gradle.api.Project; -import org.gradle.api.artifacts.Dependency; import org.gradle.api.plugins.JavaPlugin; import net.fabricmc.loom.configuration.DependencyProvider; @@ -49,8 +48,6 @@ import net.fabricmc.loom.configuration.launch.LaunchProviderSettings; import net.fabricmc.loom.util.Constants; public class LaunchProvider extends DependencyProvider { - public Dependency annotationDependency; - public LaunchProvider(Project project) { super(project); } @@ -134,7 +131,7 @@ public class LaunchProvider extends DependencyProvider { addDependency(Constants.Dependencies.DEV_LAUNCH_INJECTOR + Constants.Dependencies.Versions.DEV_LAUNCH_INJECTOR, Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES); addDependency(Constants.Dependencies.TERMINAL_CONSOLE_APPENDER + Constants.Dependencies.Versions.TERMINAL_CONSOLE_APPENDER, Constants.Configurations.LOOM_DEVELOPMENT_DEPENDENCIES); - annotationDependency = addDependency(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS, JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME); + addDependency(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS, JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME); if (getExtension().isForge()) { addDependency(Constants.Dependencies.FORGE_RUNTIME + Constants.Dependencies.Versions.FORGE_RUNTIME, JavaPlugin.RUNTIME_ONLY_CONFIGURATION_NAME); diff --git a/src/main/java/net/fabricmc/loom/configuration/sources/ForgeSourcesRemapper.java b/src/main/java/net/fabricmc/loom/configuration/sources/ForgeSourcesRemapper.java index ea3cba27..653ac32d 100644 --- a/src/main/java/net/fabricmc/loom/configuration/sources/ForgeSourcesRemapper.java +++ b/src/main/java/net/fabricmc/loom/configuration/sources/ForgeSourcesRemapper.java @@ -43,14 +43,11 @@ import org.cadixdev.lorenz.MappingSet; import org.cadixdev.mercury.Mercury; import org.cadixdev.mercury.remapper.MercuryRemapper; import org.gradle.api.Project; -import org.gradle.api.artifacts.Dependency; import org.gradle.api.artifacts.ResolvedArtifact; -import org.gradle.api.plugins.JavaPlugin; import org.zeroturnaround.zip.ZipUtil; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.build.ModCompileRemapper; -import net.fabricmc.loom.configuration.providers.LaunchProvider; import net.fabricmc.loom.configuration.providers.minecraft.MinecraftMappedProvider; import net.fabricmc.loom.task.GenerateSourcesTask; import net.fabricmc.loom.util.Constants; @@ -178,9 +175,9 @@ public class ForgeSourcesRemapper { mappings.getOrCreateClassMapping(entry.getKey()).setDeobfuscatedName(entry.getValue()); } - Dependency annotationDependency = extension.getDependencyManager().getProvider(LaunchProvider.class).annotationDependency; - Set<File> files = project.getConfigurations().getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME) - .files(annotationDependency); + Set<File> files = project.getConfigurations() + .detachedConfiguration(project.getDependencies().create(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS)) + .resolve(); for (File file : files) { mercury.getClassPath().add(file.toPath()); diff --git a/src/main/java/net/fabricmc/loom/task/UnpickJarTask.java b/src/main/java/net/fabricmc/loom/task/UnpickJarTask.java index e27d2ff2..7f66aa61 100644 --- a/src/main/java/net/fabricmc/loom/task/UnpickJarTask.java +++ b/src/main/java/net/fabricmc/loom/task/UnpickJarTask.java @@ -47,7 +47,7 @@ public class UnpickJarTask extends JavaExec { public UnpickJarTask() { getOutputs().upToDateWhen(e -> false); classpath(getProject().getConfigurations().getByName(Constants.Configurations.UNPICK_CLASSPATH)); - setMain("daomephsta.unpick.cli.Main"); + getMainClass().set("daomephsta.unpick.cli.Main"); } @Override diff --git a/src/main/java/net/fabricmc/loom/util/SourceRemapper.java b/src/main/java/net/fabricmc/loom/util/SourceRemapper.java index 20a7006e..f3b51303 100644 --- a/src/main/java/net/fabricmc/loom/util/SourceRemapper.java +++ b/src/main/java/net/fabricmc/loom/util/SourceRemapper.java @@ -38,13 +38,10 @@ import org.cadixdev.lorenz.MappingSet; import org.cadixdev.mercury.Mercury; import org.cadixdev.mercury.remapper.MercuryRemapper; import org.gradle.api.Project; -import org.gradle.api.artifacts.Dependency; -import org.gradle.api.plugins.JavaPlugin; import org.zeroturnaround.zip.ZipUtil; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.configuration.RemappedConfigurationEntry; -import net.fabricmc.loom.configuration.providers.LaunchProvider; import net.fabricmc.loom.configuration.providers.mappings.MappingsProviderImpl; import net.fabricmc.loom.configuration.providers.minecraft.tr.MercuryUtils; import net.fabricmc.lorenztiny.TinyMappingsReader; @@ -214,9 +211,9 @@ public class SourceRemapper { m.getClassPath().add(extension.getMinecraftMappedProvider().getSrgJar().toPath()); } - Dependency annotationDependency = extension.getDependencyManager().getProvider(LaunchProvider.class).annotationDependency; - Set<File> files = project.getConfigurations().getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME) - .files(annotationDependency); + Set<File> files = project.getConfigurations() + .detachedConfiguration(project.getDependencies().create(Constants.Dependencies.JETBRAINS_ANNOTATIONS + Constants.Dependencies.Versions.JETBRAINS_ANNOTATIONS)) + .resolve(); for (File file : files) { m.getClassPath().add(file.toPath()); diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/ReproducibleBuildTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/ReproducibleBuildTest.groovy index 1860450c..6a83f2bb 100644 --- a/src/test/groovy/net/fabricmc/loom/test/integration/ReproducibleBuildTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/integration/ReproducibleBuildTest.groovy @@ -49,8 +49,8 @@ class ReproducibleBuildTest extends Specification implements ProjectTestTrait { getOutputHash("fabric-example-mod-1.0.0-sources.jar") in sourceHash // Done for different line endings. where: gradle | modHash | sourceHash - DEFAULT_GRADLE | "6132ffb4117adb7e258f663110552952" | ["be31766e6cafbe4ae3bca9e35ba63169", "7348b0bd87d36d7ec6f3bca9c2b66062"] - PRE_RELEASE_GRADLE | "6132ffb4117adb7e258f663110552952" | ["be31766e6cafbe4ae3bca9e35ba63169", "7348b0bd87d36d7ec6f3bca9c2b66062"] + DEFAULT_GRADLE | "0f954aa060fd8fc005e834c7cd271303" | ["be31766e6cafbe4ae3bca9e35ba63169", "7348b0bd87d36d7ec6f3bca9c2b66062"] + PRE_RELEASE_GRADLE | "0f954aa060fd8fc005e834c7cd271303" | ["be31766e6cafbe4ae3bca9e35ba63169", "7348b0bd87d36d7ec6f3bca9c2b66062"] } String getOutputHash(String name) { diff --git a/src/test/groovy/net/fabricmc/loom/test/integration/UnpickTest.groovy b/src/test/groovy/net/fabricmc/loom/test/integration/UnpickTest.groovy index 2be479ea..d7717a2d 100644 --- a/src/test/groovy/net/fabricmc/loom/test/integration/UnpickTest.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/integration/UnpickTest.groovy @@ -42,17 +42,25 @@ class UnpickTest extends Specification implements ProjectTestTrait { def "unpick decompile"() { when: - def result = create("genSources") + def result = create("genSources", gradle) then: result.task(":genSources").outcome == SUCCESS getClassSource("net/minecraft/block/CakeBlock.java").contains("Block.DEFAULT_SET_BLOCK_STATE_FLAG") + where: + gradle | _ + DEFAULT_GRADLE | _ + PRE_RELEASE_GRADLE | _ } def "unpick build"() { when: - def result = create("build") + def result = create("build", gradle) then: result.task(":build").outcome == SUCCESS + where: + gradle | _ + DEFAULT_GRADLE | _ + PRE_RELEASE_GRADLE | _ } String getClassSource(String classname, String mappings = MAPPINGS) { diff --git a/src/test/groovy/net/fabricmc/loom/test/util/ProjectTestTrait.groovy b/src/test/groovy/net/fabricmc/loom/test/util/ProjectTestTrait.groovy index 0f72662d..932229f8 100644 --- a/src/test/groovy/net/fabricmc/loom/test/util/ProjectTestTrait.groovy +++ b/src/test/groovy/net/fabricmc/loom/test/util/ProjectTestTrait.groovy @@ -29,7 +29,7 @@ import org.gradle.testkit.runner.GradleRunner trait ProjectTestTrait { final static String DEFAULT_GRADLE = "7.0.1" - final static String PRE_RELEASE_GRADLE = "7.2-20210612220215+0000" + final static String PRE_RELEASE_GRADLE = "7.2-20210704221017+0000" static File gradleHome = File.createTempDir() File testProjectDir = File.createTempDir() |