downgrade to gradle 4.9, fix tiny-remapper deprecations, restore old dev/noclassifier behaviour for default RemapJarTask settings

dev/0.11
asie 2019-07-24 22:34:27 +02:00
parent dba326147a
commit ac9c7fc103
10 changed files with 19 additions and 17 deletions

View File

@ -12,7 +12,7 @@ targetCompatibility = 1.8
group = 'net.fabricmc' group = 'net.fabricmc'
archivesBaseName = project.name archivesBaseName = project.name
version = '0.2.5-SNAPSHOT' version = '0.2.290-SNAPSHOT'
def build = "local" def build = "local"
def ENV = System.getenv() def ENV = System.getenv()
@ -57,7 +57,7 @@ dependencies {
// Testing // Testing
testImplementation(gradleTestKit()) testImplementation(gradleTestKit())
testImplementation("org.spockframework:spock-core:1.3-groovy-2.5") testImplementation("org.spockframework:spock-core:1.3-groovy-2.4")
} }
jar { jar {
@ -67,12 +67,12 @@ jar {
} }
task sourcesJar(type: Jar, dependsOn: classes) { task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources' classifier = 'sources'
from sourceSets.main.allSource from sourceSets.main.allSource
} }
task javadocJar(type: Jar, dependsOn: javadoc) { task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc' classifier = 'javadoc'
from javadoc.destinationDir from javadoc.destinationDir
} }

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-rc-3-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip

View File

@ -311,13 +311,14 @@ public class AbstractPlugin implements Plugin<Project> {
assert remapJarTask != null; assert remapJarTask != null;
if (!remapJarTask.getInput().isPresent()) { if (!remapJarTask.getInput().isPresent()) {
remapJarTask.getArchiveClassifier().set("remapped"); jarTask.setClassifier("dev");
remapJarTask.getInput().set(jarTask.getArchiveFile()); remapJarTask.setClassifier("");
remapJarTask.getInput().set(jarTask.getArchivePath());
} }
remapJarTask.getAddNestedDependencies().set(true); remapJarTask.getAddNestedDependencies().set(true);
remapJarTask.doLast(task -> project1.getArtifacts().add("archives", remapJarTask.getArchiveFile())); remapJarTask.doLast(task -> project1.getArtifacts().add("archives", remapJarTask.getArchivePath()));
remapJarTask.dependsOn(project1.getTasks().getByName("jar")); remapJarTask.dependsOn(project1.getTasks().getByName("jar"));
project1.getTasks().getByName("build").dependsOn(remapJarTask); project1.getTasks().getByName("build").dependsOn(remapJarTask);

View File

@ -33,6 +33,7 @@ import net.fabricmc.tinyremapper.OutputConsumerPath;
import net.fabricmc.tinyremapper.TinyRemapper; import net.fabricmc.tinyremapper.TinyRemapper;
import net.fabricmc.tinyremapper.TinyUtils; import net.fabricmc.tinyremapper.TinyUtils;
import org.gradle.api.Project; import org.gradle.api.Project;
import org.gradle.api.file.RegularFile;
import org.gradle.api.file.RegularFileProperty; import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.provider.Property; import org.gradle.api.provider.Property;
import org.gradle.api.tasks.Input; import org.gradle.api.tasks.Input;
@ -53,7 +54,7 @@ public class RemapJarTask extends Jar {
public RemapJarTask() { public RemapJarTask() {
super(); super();
input = getProject().getObjects().fileProperty(); input = getProject().getLayout().fileProperty();
addNestedDependencies = getProject().getObjects().property(Boolean.class); addNestedDependencies = getProject().getObjects().property(Boolean.class);
} }
@ -62,7 +63,7 @@ public class RemapJarTask extends Jar {
Project project = getProject(); Project project = getProject();
LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class); LoomGradleExtension extension = project.getExtensions().getByType(LoomGradleExtension.class);
Path input = this.getInput().getAsFile().get().toPath(); Path input = this.getInput().getAsFile().get().toPath();
Path output = this.getArchiveFile().get().getAsFile().toPath(); Path output = this.getArchivePath().toPath();
if (!Files.exists(input)) { if (!Files.exists(input)) {
throw new FileNotFoundException(input.toString()); throw new FileNotFoundException(input.toString());
@ -98,7 +99,7 @@ public class RemapJarTask extends Jar {
TinyRemapper remapper = remapperBuilder.build(); TinyRemapper remapper = remapperBuilder.build();
try (OutputConsumerPath outputConsumer = new OutputConsumerPath(output)) { try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(output).build()) {
outputConsumer.addNonClassFiles(input); outputConsumer.addNonClassFiles(input);
remapper.readClassPath(classpath); remapper.readClassPath(classpath);
remapper.readInputs(input); remapper.readInputs(input);

View File

@ -66,7 +66,7 @@ public class MapJarsTiny {
.rebuildSourceFilenames(true) .rebuildSourceFilenames(true)
.build(); .build();
try (OutputConsumerPath outputConsumer = new OutputConsumerPath(output)) { try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(output).build()) {
outputConsumer.addNonClassFiles(input); outputConsumer.addNonClassFiles(input);
remapper.readClassPath(classpath); remapper.readClassPath(classpath);
remapper.readInputs(input); remapper.readInputs(input);

View File

@ -167,7 +167,7 @@ public class ModProcessor {
.withMappings(TinyRemapperMappingsHelper.create(mappingsProvider.getMappings(), fromM, toM)) .withMappings(TinyRemapperMappingsHelper.create(mappingsProvider.getMappings(), fromM, toM))
.build(); .build();
try (OutputConsumerPath outputConsumer = new OutputConsumerPath(Paths.get(output.getAbsolutePath()))) { try (OutputConsumerPath outputConsumer = new OutputConsumerPath.Builder(Paths.get(output.getAbsolutePath())).build()) {
outputConsumer.addNonClassFiles(inputPath); outputConsumer.addNonClassFiles(inputPath);
remapper.readClassPath(modCompiles.toArray(new Path[0])); remapper.readClassPath(modCompiles.toArray(new Path[0]));
remapper.readClassPath(mc); remapper.readClassPath(mc);

View File

@ -107,7 +107,7 @@ public class NestedJars {
for (Task task : remapJarTasks.isEmpty() ? jarTasks : remapJarTasks) { for (Task task : remapJarTasks.isEmpty() ? jarTasks : remapJarTasks) {
if (task instanceof RemapJarTask) { if (task instanceof RemapJarTask) {
fileList.add(((RemapJarTask) task).getArchiveFile().get().getAsFile()); fileList.add(((RemapJarTask) task).getArchivePath());
} else if (task instanceof AbstractArchiveTask) { } else if (task instanceof AbstractArchiveTask) {
fileList.add(((AbstractArchiveTask) task).getArchivePath()); fileList.add(((AbstractArchiveTask) task).getArchivePath());
} }

View File

@ -37,7 +37,7 @@ class EmptyBuildFunctionalTest extends Specification {
.withProjectDir(testProjectDir.root) .withProjectDir(testProjectDir.root)
.withArguments('build') .withArguments('build')
.withPluginClasspath() .withPluginClasspath()
.withGradleVersion("5.1.1") .withGradleVersion("4.9")
.build() .build()
then: then:

View File

@ -62,7 +62,7 @@ class MixinBuildFunctionalTest extends Specification {
.withProjectDir(testProjectDir.root) .withProjectDir(testProjectDir.root)
.withArguments('build') .withArguments('build')
.withPluginClasspath() .withPluginClasspath()
.withGradleVersion("5.1.1") .withGradleVersion("4.9")
.build() .build()
then: then:

View File

@ -47,7 +47,7 @@ class SimpleBuildFunctionalTest extends Specification {
.withProjectDir(testProjectDir.root) .withProjectDir(testProjectDir.root)
.withArguments('build') .withArguments('build')
.withPluginClasspath() .withPluginClasspath()
.withGradleVersion("5.1.1") .withGradleVersion("4.9")
.build() .build()
then: then: