2016-08-17 15:23:28 -04:00
|
|
|
buildscript {
|
2016-10-02 11:58:41 -04:00
|
|
|
repositories {
|
|
|
|
jcenter()
|
2016-10-19 04:58:14 -04:00
|
|
|
maven {
|
2019-06-28 17:55:20 -04:00
|
|
|
name "Fabric Repository"
|
|
|
|
url 'https://maven.fabricmc.net'
|
2016-10-19 04:58:14 -04:00
|
|
|
}
|
2016-10-02 11:58:41 -04:00
|
|
|
}
|
|
|
|
dependencies {
|
2020-06-03 14:47:17 -04:00
|
|
|
classpath "cuchaz:enigma-cli:${project.enigma_version}"
|
|
|
|
classpath "net.fabricmc:stitch:${project.stitch_version}"
|
2019-06-13 03:39:42 -04:00
|
|
|
classpath "commons-io:commons-io:2.6"
|
2020-04-18 14:43:54 -04:00
|
|
|
classpath 'de.undercouch:gradle-download-task:4.0.4'
|
2020-07-12 07:07:45 -04:00
|
|
|
classpath 'net.fabricmc:tiny-remapper:0.3.1.72'
|
2020-04-18 14:43:54 -04:00
|
|
|
classpath 'net.fabricmc:mappingpoet:0.1.0+build.2'
|
2016-10-02 11:58:41 -04:00
|
|
|
}
|
2016-08-17 15:23:28 -04:00
|
|
|
}
|
|
|
|
|
2018-12-08 07:32:48 -05:00
|
|
|
plugins {
|
2020-04-18 14:43:54 -04:00
|
|
|
id 'de.undercouch.download' version '4.0.4'
|
2019-12-11 06:52:21 -05:00
|
|
|
id 'base'
|
2018-12-08 07:32:48 -05:00
|
|
|
id 'maven-publish'
|
2020-04-07 16:13:29 -04:00
|
|
|
id 'java' // for jd gen
|
2018-12-08 07:32:48 -05:00
|
|
|
}
|
2018-10-27 10:16:43 -04:00
|
|
|
|
2020-08-07 12:43:19 -04:00
|
|
|
def minecraft_version = "1_16_combat-0"
|
|
|
|
|
|
|
|
//Used as this is an experimental build.
|
|
|
|
def version_manifest_url = "https://raw.githubusercontent.com/MultiMC/meta-upstream/master/mojang/versions/1_16_combat-0.json";
|
2016-09-09 08:47:32 -04:00
|
|
|
|
|
|
|
def ENV = System.getenv()
|
2018-11-15 11:57:32 -05:00
|
|
|
// Fetch build number from Jenkins
|
|
|
|
def build_number = ENV.BUILD_NUMBER ?: "local"
|
|
|
|
|
2019-04-10 12:20:44 -04:00
|
|
|
def yarnVersion = "${minecraft_version}+build.$build_number"
|
2016-09-09 08:47:32 -04:00
|
|
|
|
2018-12-08 07:32:48 -05:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven {
|
2019-06-28 17:55:20 -04:00
|
|
|
name "Fabric Repository"
|
|
|
|
url 'https://maven.fabricmc.net'
|
2018-12-08 07:32:48 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
enigmaRuntime {
|
|
|
|
resolutionStrategy {
|
|
|
|
cacheDynamicVersionsFor 0, "seconds"
|
|
|
|
cacheChangingModulesFor 0, "seconds"
|
|
|
|
}
|
|
|
|
}
|
2020-04-07 16:13:29 -04:00
|
|
|
javadocClasspath
|
2018-12-08 07:32:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2020-06-03 14:47:17 -04:00
|
|
|
enigmaRuntime "cuchaz:enigma-swing:${project.enigma_version}"
|
|
|
|
enigmaRuntime "net.fabricmc:stitch:${project.stitch_version}"
|
2020-04-07 16:13:29 -04:00
|
|
|
javadocClasspath "net.fabricmc:fabric-loader:0.8.2+build.194"
|
|
|
|
javadocClasspath "com.google.code.findbugs:jsr305:3.0.2"
|
2018-12-08 07:32:48 -05:00
|
|
|
}
|
|
|
|
|
2019-05-12 21:45:52 -04:00
|
|
|
def setupGroup = "jar setup"
|
|
|
|
def yarnGroup = "yarn"
|
|
|
|
def buildMappingGroup = "mapping build"
|
|
|
|
def mapJarGroup = "jar mapping"
|
2018-10-27 10:16:43 -04:00
|
|
|
def mappingsDir = file("mappings")
|
|
|
|
def cacheFilesMinecraft = file(".gradle/minecraft")
|
2018-10-31 09:05:19 -04:00
|
|
|
def tempDir = file(".gradle/temp")
|
2018-10-27 10:16:43 -04:00
|
|
|
def mergedFile = file("${minecraft_version}-merged.jar")
|
2019-01-09 15:28:08 -05:00
|
|
|
def intermediaryJar = file("${minecraft_version}-intermediary.jar")
|
2019-05-12 21:45:52 -04:00
|
|
|
def yarnJar = file("${minecraft_version}-yarn.jar")
|
2019-01-09 15:28:08 -05:00
|
|
|
def namedJar = file("${minecraft_version}-named.jar")
|
2018-10-27 10:16:43 -04:00
|
|
|
def versionFile = new File(cacheFilesMinecraft, "${minecraft_version}.json")
|
|
|
|
def clientJar = new File(cacheFilesMinecraft, "${minecraft_version}-client.jar")
|
|
|
|
def serverJar = new File(cacheFilesMinecraft, "${minecraft_version}-server.jar")
|
2019-06-28 17:55:20 -04:00
|
|
|
def libraries = new File(cacheFilesMinecraft, "libraries")
|
2018-10-30 07:29:43 -04:00
|
|
|
def libs = new File("build/libs/")
|
2018-10-27 10:16:43 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
|
|
|
|
import com.google.common.hash.Hashing
|
|
|
|
import com.google.common.collect.Iterables
|
2019-06-28 16:12:16 -04:00
|
|
|
import cuchaz.enigma.command.CheckMappingsCommand
|
2019-06-28 17:55:20 -04:00
|
|
|
import cuchaz.enigma.command.ComposeMappingsCommand
|
2019-06-28 16:12:16 -04:00
|
|
|
import cuchaz.enigma.command.ConvertMappingsCommand
|
2019-11-24 05:53:08 -05:00
|
|
|
import cuchaz.enigma.command.MapSpecializedMethodsCommand
|
2019-05-12 21:45:52 -04:00
|
|
|
import groovy.io.FileType
|
|
|
|
import groovy.json.JsonSlurper
|
2018-10-31 12:54:00 -04:00
|
|
|
import net.fabricmc.stitch.commands.CommandMergeTiny
|
2019-05-07 11:56:34 -04:00
|
|
|
import net.fabricmc.stitch.commands.CommandProposeFieldNames
|
2019-06-28 18:17:32 -04:00
|
|
|
import net.fabricmc.stitch.commands.CommandReorderTiny
|
2019-04-18 17:22:36 -04:00
|
|
|
import net.fabricmc.stitch.commands.CommandRewriteIntermediary
|
2019-11-07 06:38:33 -05:00
|
|
|
import net.fabricmc.stitch.commands.tinyv2.CommandProposeV2FieldNames
|
2020-03-09 15:28:16 -04:00
|
|
|
import net.fabricmc.stitch.commands.tinyv2.CommandMergeTinyV2
|
|
|
|
import net.fabricmc.stitch.commands.tinyv2.CommandReorderTinyV2
|
2018-10-31 12:53:07 -04:00
|
|
|
import net.fabricmc.stitch.merge.JarMerger
|
2018-10-27 10:16:43 -04:00
|
|
|
import net.fabricmc.tinyremapper.OutputConsumerPath
|
|
|
|
import net.fabricmc.tinyremapper.TinyRemapper
|
|
|
|
import net.fabricmc.tinyremapper.TinyUtils
|
2019-05-12 21:45:52 -04:00
|
|
|
import org.apache.commons.io.FileUtils
|
|
|
|
|
2019-06-29 07:08:36 -04:00
|
|
|
import java.nio.charset.StandardCharsets
|
2019-11-07 06:38:33 -05:00
|
|
|
import java.nio.file.FileSystems
|
|
|
|
import java.nio.file.Files
|
|
|
|
import java.nio.file.Path
|
2018-11-15 11:57:32 -05:00
|
|
|
import java.util.zip.GZIPOutputStream
|
2016-08-17 15:23:28 -04:00
|
|
|
|
|
|
|
boolean validateChecksum(File file, String checksum) {
|
|
|
|
if (file != null) {
|
2019-11-07 06:38:33 -05:00
|
|
|
def hash = com.google.common.io.Files.asByteSource(file).hash(Hashing.sha1())
|
2016-08-17 15:23:28 -04:00
|
|
|
def builder = new StringBuilder()
|
|
|
|
hash.asBytes().each {
|
|
|
|
builder.append(Integer.toString((it & 0xFF) + 0x100, 16).substring(1))
|
|
|
|
}
|
|
|
|
return builder.toString().equals(checksum)
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
def getManifestVersion(File manifestFile, String minecraft_version) {
|
|
|
|
def manifest = manifestFile.exists() ? new JsonSlurper().parseText(FileUtils.readFileToString(manifestFile)) : null
|
2019-11-07 06:38:33 -05:00
|
|
|
return manifest != null ? manifest.versions.stream().filter({
|
|
|
|
it.id.equals(minecraft_version)
|
|
|
|
}).findFirst() : java.util.Optional.empty()
|
2018-10-27 10:16:43 -04:00
|
|
|
}
|
|
|
|
|
2020-08-07 12:43:19 -04:00
|
|
|
task downloadWantedVersionManifest() {
|
2019-05-12 21:45:52 -04:00
|
|
|
group = setupGroup
|
2018-10-27 10:16:43 -04:00
|
|
|
|
|
|
|
outputs.file versionFile
|
|
|
|
|
|
|
|
doLast {
|
2020-08-07 12:43:19 -04:00
|
|
|
FileUtils.copyURLToFile(new URL(version_manifest_url), versionFile)
|
2018-10-27 10:16:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2016-08-17 15:23:28 -04:00
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
task downloadMcJars(dependsOn: downloadWantedVersionManifest) {
|
2019-05-12 21:45:52 -04:00
|
|
|
group = setupGroup
|
2018-10-27 10:16:43 -04:00
|
|
|
inputs.files versionFile
|
2016-08-17 15:23:28 -04:00
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
outputs.files(clientJar, serverJar)
|
2016-08-17 15:23:28 -04:00
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
outputs.upToDateWhen {
|
2016-08-17 15:23:28 -04:00
|
|
|
def version = new JsonSlurper().parseText(FileUtils.readFileToString(versionFile))
|
2018-10-27 10:16:43 -04:00
|
|
|
return clientJar.exists() && serverJar.exists() && validateChecksum(clientJar, version.downloads.client.sha1) && validateChecksum(serverJar, version.downloads.server.sha1)
|
|
|
|
}
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
if (!versionFile.exists()) {
|
|
|
|
throw new RuntimeException("Can't download the jars without the ${versionFile.name} file!")
|
|
|
|
}
|
2016-08-17 15:23:28 -04:00
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
//reload in case it changed
|
|
|
|
def version = new JsonSlurper().parseText(FileUtils.readFileToString(versionFile))
|
|
|
|
|
|
|
|
logger.lifecycle(":downloading minecraft jars")
|
2016-08-17 15:23:28 -04:00
|
|
|
|
2020-03-09 15:28:16 -04:00
|
|
|
download {
|
|
|
|
src new URL(version.downloads.client.url)
|
|
|
|
dest clientJar
|
|
|
|
overwrite false
|
2016-08-17 15:23:28 -04:00
|
|
|
}
|
|
|
|
|
2020-03-09 15:28:16 -04:00
|
|
|
download {
|
|
|
|
src new URL(version.downloads.server.url)
|
|
|
|
dest serverJar
|
|
|
|
overwrite false
|
2016-08-17 15:23:28 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-07 13:12:34 -05:00
|
|
|
task downloadIntermediary(type: Download) {
|
2019-06-28 17:55:20 -04:00
|
|
|
group = buildMappingGroup
|
2019-11-07 13:12:34 -05:00
|
|
|
def url = "https://github.com/FabricMC/intermediary/raw/master/mappings/${minecraft_version}.tiny"
|
2019-11-07 13:15:42 -05:00
|
|
|
src com.google.common.net.UrlEscapers.urlFragmentEscaper().escape(url)
|
2019-11-07 13:12:34 -05:00
|
|
|
dest new File(cacheFilesMinecraft, "${minecraft_version}-intermediary.tiny")
|
2019-06-28 17:55:20 -04:00
|
|
|
}
|
|
|
|
|
2020-03-09 15:28:16 -04:00
|
|
|
task downloadIntermediaryV2(type: Download) {
|
|
|
|
group = buildMappingGroup
|
|
|
|
def url = "https://maven.fabricmc.net/net/fabricmc/intermediary/${minecraft_version}/intermediary-${minecraft_version}-v2.jar"
|
|
|
|
src com.google.common.net.UrlEscapers.urlFragmentEscaper().escape(url)
|
|
|
|
dest new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-v2.jar")
|
|
|
|
}
|
|
|
|
|
|
|
|
task extractIntermediaryV2(dependsOn: downloadIntermediaryV2, type: Copy) {
|
|
|
|
def output = new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-v2.tiny")
|
|
|
|
from({ zipTree(downloadIntermediaryV2.dest) }) {
|
|
|
|
include 'mappings/mappings.tiny'
|
|
|
|
rename 'mappings.tiny', "../${output.name}"
|
|
|
|
}
|
|
|
|
into output.parentFile
|
|
|
|
}
|
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
task mergeJars(dependsOn: downloadMcJars) {
|
2019-05-12 21:45:52 -04:00
|
|
|
group = setupGroup
|
2018-10-27 10:16:43 -04:00
|
|
|
inputs.files downloadMcJars.outputs.files.files
|
|
|
|
outputs.file(mergedFile)
|
2016-08-17 15:23:28 -04:00
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":merging jars")
|
2019-11-07 06:38:33 -05:00
|
|
|
def client = inputs.files.files.find { it.name.endsWith("-client.jar") }
|
|
|
|
def server = inputs.files.files.find { it.name.endsWith("-server.jar") }
|
2018-12-22 06:56:35 -05:00
|
|
|
def merged = mergedFile
|
2016-08-17 15:23:28 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
if (merged.exists()) {
|
2019-01-16 13:37:56 -05:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-08-17 15:23:28 -04:00
|
|
|
def jarMerger = new JarMerger(client, server, merged)
|
|
|
|
jarMerger.merge()
|
|
|
|
jarMerger.close()
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-06-28 17:55:20 -04:00
|
|
|
task downloadMcLibs(dependsOn: downloadWantedVersionManifest) {
|
|
|
|
group = setupGroup
|
|
|
|
inputs.files versionFile
|
|
|
|
|
2019-07-02 17:36:55 -04:00
|
|
|
outputs.dir(libraries)
|
2019-06-28 17:55:20 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
outputs.upToDateWhen { false }
|
2016-08-17 15:23:28 -04:00
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
doLast {
|
2019-06-28 17:55:20 -04:00
|
|
|
if (!versionFile.exists()) {
|
|
|
|
throw new RuntimeException("Can't download the jars without the ${versionFile.name} file!")
|
|
|
|
}
|
|
|
|
|
2019-06-29 07:08:36 -04:00
|
|
|
def version = new JsonSlurper().parseText(FileUtils.readFileToString(versionFile, StandardCharsets.UTF_8))
|
2019-06-28 17:55:20 -04:00
|
|
|
|
|
|
|
logger.lifecycle(":downloading minecraft libraries")
|
|
|
|
|
|
|
|
if (!libraries.exists()) {
|
|
|
|
libraries.mkdirs()
|
|
|
|
}
|
|
|
|
|
|
|
|
version.libraries.each {
|
|
|
|
def downloadUrl = it.downloads.artifact.url
|
|
|
|
|
|
|
|
download {
|
|
|
|
src downloadUrl
|
|
|
|
dest new File(libraries, downloadUrl.substring(downloadUrl.lastIndexOf("/") + 1))
|
|
|
|
overwrite false
|
|
|
|
}
|
2018-10-27 10:16:43 -04:00
|
|
|
}
|
2016-08-17 15:23:28 -04:00
|
|
|
}
|
|
|
|
}
|
2016-09-08 18:42:45 -04:00
|
|
|
|
2019-11-07 13:12:34 -05:00
|
|
|
task invertIntermediary(dependsOn: downloadIntermediary, type: FileOutput) {
|
2019-05-12 21:45:52 -04:00
|
|
|
group = buildMappingGroup
|
2019-11-07 13:12:34 -05:00
|
|
|
def v1Input = downloadIntermediary.dest
|
2016-09-21 08:52:54 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
output = new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-inverted.tiny")
|
|
|
|
outputs.file(output)
|
2019-06-28 17:55:20 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
outputs.upToDateWhen { false }
|
2016-10-19 04:58:14 -04:00
|
|
|
|
2019-06-28 17:55:20 -04:00
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":building inverted intermediary")
|
2019-11-07 06:38:33 -05:00
|
|
|
|
|
|
|
String[] v1Args = [
|
|
|
|
v1Input.getAbsolutePath(),
|
|
|
|
output.getAbsolutePath(),
|
|
|
|
"intermediary", "official"
|
2018-10-27 10:16:43 -04:00
|
|
|
]
|
2016-10-19 04:58:14 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
new CommandReorderTiny().run(v1Args)
|
2018-10-27 10:16:43 -04:00
|
|
|
}
|
2016-10-19 04:58:14 -04:00
|
|
|
}
|
|
|
|
|
2020-03-09 15:28:16 -04:00
|
|
|
task invertIntermediaryv2(dependsOn: extractIntermediaryV2, type: FileOutput) {
|
|
|
|
group = buildMappingGroup
|
|
|
|
def v2Input = new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-v2.tiny")
|
|
|
|
|
|
|
|
output = new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-inverted-v2.tiny")
|
|
|
|
outputs.file(output)
|
|
|
|
|
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":building inverted intermediary v2")
|
|
|
|
|
|
|
|
String[] v2Args = [
|
|
|
|
v2Input.getAbsolutePath(),
|
|
|
|
output.getAbsolutePath(),
|
|
|
|
"intermediary", "official"
|
|
|
|
]
|
|
|
|
|
|
|
|
new CommandReorderTinyV2().run(v2Args)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-07 13:12:34 -05:00
|
|
|
task patchIntermediary(dependsOn: [mergeJars, downloadIntermediary]) {
|
2019-05-12 21:45:52 -04:00
|
|
|
group = buildMappingGroup
|
2020-03-09 15:28:16 -04:00
|
|
|
def intermediaryTinyInput = downloadIntermediary.outputs.files.singleFile
|
2019-04-18 17:22:36 -04:00
|
|
|
|
|
|
|
def outputFile = new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-full.tiny")
|
|
|
|
outputs.file(outputFile)
|
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
outputs.upToDateWhen { false }
|
2019-04-18 17:22:36 -04:00
|
|
|
|
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":patching intermediary")
|
|
|
|
String[] args = [
|
2019-11-07 06:38:33 -05:00
|
|
|
mergedFile.getAbsolutePath(),
|
|
|
|
intermediaryTinyInput.getAbsolutePath(),
|
|
|
|
outputFile.getAbsolutePath(),
|
|
|
|
"--writeAll"
|
2019-04-18 17:22:36 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
new CommandRewriteIntermediary().run(args)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-07 13:12:34 -05:00
|
|
|
task mapIntermediaryJar(dependsOn: [downloadMcLibs, downloadIntermediary, mergeJars]) {
|
2019-06-28 17:55:20 -04:00
|
|
|
group = mapJarGroup
|
|
|
|
inputs.files downloadMcLibs.outputs.files.files
|
|
|
|
outputs.file(intermediaryJar)
|
|
|
|
|
|
|
|
//Force the task to always run
|
2019-11-07 06:38:33 -05:00
|
|
|
outputs.upToDateWhen { false }
|
2019-06-28 17:55:20 -04:00
|
|
|
|
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":mapping minecraft to intermediary")
|
2019-11-07 13:12:34 -05:00
|
|
|
def tinyInput = downloadIntermediary.dest
|
2019-06-28 17:55:20 -04:00
|
|
|
mapJar(intermediaryJar, mergedFile, tinyInput, libraries, "official", "intermediary")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task setupYarn(dependsOn: mapIntermediaryJar) {
|
|
|
|
group = yarnGroup
|
|
|
|
}
|
|
|
|
|
|
|
|
task yarn(dependsOn: setupYarn) {
|
|
|
|
group = yarnGroup
|
|
|
|
doLast {
|
|
|
|
ant.setLifecycleLogLevel "WARN"
|
|
|
|
ant.java(
|
2020-06-03 14:47:17 -04:00
|
|
|
classname: 'cuchaz.enigma.gui.Main',
|
2019-11-07 06:38:33 -05:00
|
|
|
classpath: configurations.enigmaRuntime.asPath,
|
|
|
|
fork: true,
|
|
|
|
spawn: true
|
2019-06-28 17:55:20 -04:00
|
|
|
) {
|
|
|
|
jvmarg(value: "-Xmx2048m")
|
|
|
|
arg(value: '-jar')
|
|
|
|
arg(value: intermediaryJar.getAbsolutePath())
|
|
|
|
arg(value: '-mappings')
|
|
|
|
arg(value: mappingsDir.getAbsolutePath())
|
|
|
|
arg(value: '-profile')
|
|
|
|
arg(value: 'enigma_profile.json')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task checkMappings {
|
|
|
|
group = buildMappingGroup
|
|
|
|
inputs.dir mappingsDir
|
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":checking mappings")
|
|
|
|
|
|
|
|
String[] args = [
|
2019-11-07 06:38:33 -05:00
|
|
|
mergedFile.getAbsolutePath(),
|
|
|
|
mappingsDir.getAbsolutePath()
|
2019-06-28 17:55:20 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
new CheckMappingsCommand().run(args)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-24 05:53:08 -05:00
|
|
|
task buildYarnTiny(dependsOn: mapIntermediaryJar, type: WithV2FileOutput) {
|
2019-05-12 21:45:52 -04:00
|
|
|
group = buildMappingGroup
|
2018-10-27 10:16:43 -04:00
|
|
|
inputs.dir mappingsDir
|
|
|
|
if (!libs.exists()) {
|
|
|
|
libs.mkdirs()
|
|
|
|
}
|
2018-10-31 09:05:19 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
v1Output = new File(tempDir, "yarn-mappings.tiny")
|
|
|
|
v2Output = new File(tempDir, "yarn-mappings-v2.tiny")
|
|
|
|
|
|
|
|
outputs.upToDateWhen { false }
|
2018-10-31 09:05:19 -04:00
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":generating tiny mappings")
|
|
|
|
|
2019-11-24 05:53:08 -05:00
|
|
|
new MapSpecializedMethodsCommand().run(
|
|
|
|
intermediaryJar.getAbsolutePath(),
|
|
|
|
"enigma",
|
|
|
|
mappingsDir.getAbsolutePath(),
|
|
|
|
"tinyv2:intermediary:named",
|
|
|
|
v2Output.getAbsolutePath()
|
|
|
|
)
|
|
|
|
|
|
|
|
new ConvertMappingsCommand().run(
|
|
|
|
"tinyv2",
|
|
|
|
v2Output.getAbsolutePath(),
|
|
|
|
"tiny:intermediary:named",
|
|
|
|
v1Output.getAbsolutePath())
|
2018-10-31 09:05:19 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-28 17:55:20 -04:00
|
|
|
task mergeTiny(dependsOn: ["buildYarnTiny", "invertIntermediary"], type: FileOutput) {
|
2019-05-12 21:45:52 -04:00
|
|
|
group = buildMappingGroup
|
2019-11-07 06:38:33 -05:00
|
|
|
def yarnTinyInput = buildYarnTiny.v1Output
|
|
|
|
def intermediaryTinyInput = invertIntermediary.output
|
2018-10-31 09:05:19 -04:00
|
|
|
|
2019-06-28 18:17:32 -04:00
|
|
|
def unorderedResultMappings = new File(tempDir, "mappings-unordered.tiny")
|
2019-11-07 06:38:33 -05:00
|
|
|
output = new File(tempDir, "mappings.tiny")
|
|
|
|
outputs.file(output)
|
2018-10-31 09:05:19 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
outputs.upToDateWhen { false }
|
2018-10-27 10:16:43 -04:00
|
|
|
|
2018-10-31 09:05:19 -04:00
|
|
|
doLast {
|
2018-12-09 16:14:34 -05:00
|
|
|
logger.lifecycle(":merging yarn and intermediary")
|
2018-10-31 09:05:19 -04:00
|
|
|
String[] args = [
|
2019-11-07 06:38:33 -05:00
|
|
|
intermediaryTinyInput.getAbsolutePath(),
|
|
|
|
yarnTinyInput.getAbsolutePath(),
|
|
|
|
unorderedResultMappings.getAbsolutePath(),
|
|
|
|
"intermediary",
|
|
|
|
"official"
|
2018-10-31 09:05:19 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
new CommandMergeTiny().run(args)
|
2019-06-28 18:17:32 -04:00
|
|
|
|
|
|
|
logger.lifecycle(":reordering merged intermediary")
|
|
|
|
String[] args2 = [
|
2019-11-07 06:38:33 -05:00
|
|
|
unorderedResultMappings.getAbsolutePath(),
|
|
|
|
output.getAbsolutePath(),
|
|
|
|
"official", "intermediary", "named"
|
2019-06-28 18:17:32 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
new CommandReorderTiny().run(args2)
|
2018-10-31 09:05:19 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
task tinyJar(type: Jar, dependsOn: mergeTiny) {
|
2019-05-12 21:45:52 -04:00
|
|
|
group = buildMappingGroup
|
2019-11-07 06:38:33 -05:00
|
|
|
outputs.upToDateWhen { false }
|
2019-12-11 06:52:21 -05:00
|
|
|
archiveFileName = "yarn-${yarnVersion}.jar"
|
|
|
|
destinationDirectory.set(file("build/libs"))
|
2018-11-02 12:02:21 -04:00
|
|
|
classifier = ""
|
2019-11-07 06:38:33 -05:00
|
|
|
from(mergeTiny.output) {
|
2018-11-02 11:07:46 -04:00
|
|
|
rename { "mappings/mappings.tiny" }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
task compressTiny(dependsOn: [tinyJar, mergeTiny], type: FileOutput) {
|
2019-05-12 21:45:52 -04:00
|
|
|
group = buildMappingGroup
|
2018-12-09 16:14:34 -05:00
|
|
|
def outputFile = new File(libs, "yarn-tiny-${yarnVersion}.gz")
|
2018-10-31 09:05:19 -04:00
|
|
|
outputs.file(outputFile)
|
2019-11-07 06:38:33 -05:00
|
|
|
output = outputFile
|
2018-10-31 09:05:19 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
def inputFile = mergeTiny.output
|
2018-10-27 10:16:43 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
outputs.upToDateWhen { false }
|
2018-10-31 09:05:19 -04:00
|
|
|
|
|
|
|
doLast {
|
2018-10-27 10:16:43 -04:00
|
|
|
logger.lifecycle(":compressing tiny mappings")
|
|
|
|
|
|
|
|
def buffer = new byte[1024]
|
|
|
|
def fileOutputStream = new FileOutputStream(outputFile)
|
|
|
|
def outputStream = new GZIPOutputStream(fileOutputStream)
|
|
|
|
def fileInputStream = new FileInputStream(inputFile)
|
|
|
|
|
|
|
|
def length
|
|
|
|
while ((length = fileInputStream.read(buffer)) > 0) {
|
|
|
|
outputStream.write(buffer, 0, length)
|
|
|
|
}
|
|
|
|
|
|
|
|
fileInputStream.close()
|
|
|
|
outputStream.finish()
|
|
|
|
outputStream.close()
|
|
|
|
}
|
|
|
|
}
|
2016-09-21 08:52:54 -04:00
|
|
|
|
2018-11-02 12:17:55 -04:00
|
|
|
clean.doFirst {
|
|
|
|
delete tempDir, cacheFilesMinecraft
|
|
|
|
}
|
|
|
|
|
2020-03-09 15:28:16 -04:00
|
|
|
tasks.build.dependsOn "compressTiny","tinyJar","v2UnmergedYarnJar", "v2MergedYarnJar"
|
2016-10-02 11:58:41 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
task mapYarnJar(dependsOn: [compressTiny, mapIntermediaryJar]) {
|
2019-06-28 17:55:20 -04:00
|
|
|
group = mapJarGroup
|
|
|
|
inputs.files downloadMcLibs.outputs.files.files
|
|
|
|
outputs.file(yarnJar)
|
2016-09-21 08:52:54 -04:00
|
|
|
|
2019-06-28 17:55:20 -04:00
|
|
|
//Force the task to always run
|
2019-11-07 06:38:33 -05:00
|
|
|
outputs.upToDateWhen { false }
|
2016-09-21 08:52:54 -04:00
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
doLast {
|
2019-06-28 17:55:20 -04:00
|
|
|
logger.lifecycle(":mapping minecraft to yarn")
|
2018-10-27 10:16:43 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
File tinyInput = compressTiny.output
|
2019-06-28 17:55:20 -04:00
|
|
|
mapJar(yarnJar, intermediaryJar, tinyInput, libraries, "intermediary", "named")
|
2018-10-27 10:16:43 -04:00
|
|
|
}
|
2016-09-21 08:52:54 -04:00
|
|
|
}
|
|
|
|
|
2019-11-07 13:12:34 -05:00
|
|
|
task exportMappingsOfficial(dependsOn: downloadIntermediary) {
|
|
|
|
def composeInput = downloadIntermediary.dest
|
2018-10-27 10:37:37 -04:00
|
|
|
|
2018-10-27 10:16:43 -04:00
|
|
|
doLast {
|
2019-06-28 17:55:20 -04:00
|
|
|
logger.lifecycle(":exporting mappings")
|
|
|
|
String[] args = [
|
2019-11-07 06:38:33 -05:00
|
|
|
"tiny",
|
|
|
|
composeInput.getAbsolutePath(),
|
|
|
|
"enigma",
|
|
|
|
file("mappings/").getAbsolutePath(),
|
|
|
|
"enigma",
|
|
|
|
file("mappings_official/").getAbsolutePath(),
|
|
|
|
"right"
|
2019-06-28 17:55:20 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
new ComposeMappingsCommand().run(args)
|
2019-01-09 15:28:08 -05:00
|
|
|
}
|
|
|
|
}
|
2018-10-27 10:16:43 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
task importMappingsOfficial(dependsOn: invertIntermediary) {
|
|
|
|
def composeInput = invertIntermediary.output
|
2018-10-27 10:16:43 -04:00
|
|
|
|
2019-01-09 15:28:08 -05:00
|
|
|
doLast {
|
2019-06-28 17:55:20 -04:00
|
|
|
logger.lifecycle(":importing mappings")
|
|
|
|
String[] args = [
|
2019-11-07 06:38:33 -05:00
|
|
|
"tiny",
|
|
|
|
composeInput.getAbsolutePath(),
|
|
|
|
"enigma",
|
|
|
|
file("mappings_official/").getAbsolutePath(),
|
|
|
|
"enigma",
|
|
|
|
file("mappings/").getAbsolutePath(),
|
|
|
|
"right"
|
2019-06-28 17:55:20 -04:00
|
|
|
]
|
2018-10-27 10:16:43 -04:00
|
|
|
|
2019-06-28 17:55:20 -04:00
|
|
|
new ComposeMappingsCommand().run(args)
|
2018-10-27 10:16:43 -04:00
|
|
|
}
|
2018-10-31 12:53:07 -04:00
|
|
|
}
|
2018-10-30 07:29:43 -04:00
|
|
|
|
2019-05-12 21:45:52 -04:00
|
|
|
task buildTinyWithEnum(dependsOn: "mergeTiny", type: FileOutput) {
|
|
|
|
group = buildMappingGroup
|
2019-11-07 06:38:33 -05:00
|
|
|
def noEnum = mergeTiny.output
|
|
|
|
output = new File(tempDir, "named-with-enum.tiny")
|
2019-05-12 21:45:52 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
outputs.file(output)
|
2019-05-12 21:45:52 -04:00
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":seeking auto-mappable fields")
|
|
|
|
String[] argsPropose = [
|
2019-11-07 06:38:33 -05:00
|
|
|
mergedFile.getAbsolutePath(), // must use official jar
|
|
|
|
noEnum.getAbsolutePath(),
|
|
|
|
output.getAbsolutePath()
|
2019-05-12 21:45:52 -04:00
|
|
|
]
|
|
|
|
|
|
|
|
new CommandProposeFieldNames().run(argsPropose)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-12 16:09:52 -04:00
|
|
|
task mapNamedJar(dependsOn: ["mergeV2", mapIntermediaryJar]) {
|
2019-05-12 21:45:52 -04:00
|
|
|
group = mapJarGroup
|
|
|
|
inputs.files downloadMcLibs.outputs.files.files
|
|
|
|
outputs.file(namedJar)
|
|
|
|
|
|
|
|
//Force the task to always run
|
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":mapping minecraft to named")
|
|
|
|
|
2020-07-12 07:07:45 -04:00
|
|
|
mapJar(namedJar, intermediaryJar, mergeV2.output, libraries, "intermediary", "named")
|
2019-11-07 06:38:33 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
task insertAutoGeneratedEnumMappings(dependsOn : [buildYarnTiny,mapIntermediaryJar], type : FileOutput){
|
|
|
|
group = buildMappingGroup
|
|
|
|
def noEnumV2 = buildYarnTiny.v2Output
|
|
|
|
output = new File(tempDir, "unmerged-named-v2-with-enum.tiny")
|
|
|
|
|
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":seeking auto-mappable fields for unmerged mappings")
|
|
|
|
|
|
|
|
String[] argsProposeV2 = [
|
|
|
|
intermediaryJar.getAbsolutePath(), // must use intermediary jar
|
|
|
|
noEnumV2.getAbsolutePath(),
|
2019-11-11 08:22:24 -05:00
|
|
|
output.getAbsolutePath(),
|
|
|
|
"false" // don't replace existing names right now
|
2019-11-07 06:38:33 -05:00
|
|
|
]
|
|
|
|
|
|
|
|
new CommandProposeV2FieldNames().run(argsProposeV2)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-09 15:28:16 -04:00
|
|
|
task mergeV2(dependsOn: ["v2UnmergedYarnJar", "invertIntermediaryv2"], type: FileOutput) {
|
|
|
|
def mergedV2 = new File(tempDir, "merged-v2.tiny");
|
|
|
|
|
|
|
|
output = new File(tempDir, "merged-reordered-v2.tiny")
|
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
logger.lifecycle(":merging yarn and intermediary v2")
|
|
|
|
String[] args = [
|
|
|
|
invertIntermediaryv2.output.getAbsolutePath(),
|
|
|
|
insertAutoGeneratedEnumMappings.output.getAbsolutePath(),
|
|
|
|
mergedV2.getAbsolutePath(),
|
|
|
|
"intermediary",
|
|
|
|
"official"
|
|
|
|
]
|
|
|
|
|
|
|
|
new CommandMergeTinyV2().run(args)
|
|
|
|
|
|
|
|
//Reorder the mappings to match the output of loom
|
|
|
|
args = [
|
|
|
|
mergedV2.getAbsolutePath(),
|
|
|
|
output.getAbsolutePath(),
|
|
|
|
"official",
|
|
|
|
"intermediary",
|
|
|
|
"named"
|
|
|
|
]
|
|
|
|
new CommandReorderTinyV2().run(args)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
task v2UnmergedYarnJar(dependsOn: insertAutoGeneratedEnumMappings, type: Jar) {
|
|
|
|
def mappings = insertAutoGeneratedEnumMappings.output
|
|
|
|
group = "mapping build"
|
|
|
|
outputs.upToDateWhen { false }
|
2019-12-11 06:52:21 -05:00
|
|
|
archiveFileName = "yarn-${yarnVersion}-v2.jar"
|
2019-11-07 06:38:33 -05:00
|
|
|
|
|
|
|
from(file(mappings)) {
|
|
|
|
rename mappings.name, "mappings/mappings.tiny"
|
2019-05-12 21:45:52 -04:00
|
|
|
}
|
2019-12-11 06:52:21 -05:00
|
|
|
destinationDirectory.set(file("build/libs"))
|
2019-05-12 21:45:52 -04:00
|
|
|
}
|
|
|
|
|
2020-03-09 15:28:16 -04:00
|
|
|
task v2MergedYarnJar(dependsOn: ["mergeV2"], type: Jar) {
|
|
|
|
def mappings = mergeV2.output
|
|
|
|
group = "mapping build"
|
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
archiveFileName = "yarn-${yarnVersion}-mergedv2.jar"
|
|
|
|
|
|
|
|
from(file(mappings)) {
|
|
|
|
rename mappings.name, "mappings/mappings.tiny"
|
|
|
|
}
|
|
|
|
destinationDirectory.set(file("build/libs"))
|
|
|
|
}
|
2019-05-12 21:45:52 -04:00
|
|
|
|
2020-04-07 16:13:29 -04:00
|
|
|
def fakeSourceDir = file(".gradle/temp/fakeSource")
|
|
|
|
task genFakeSource(dependsOn: ["buildYarnTiny", "mapNamedJar"]) {
|
|
|
|
group = "javadoc generation"
|
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
|
|
|
|
doLast {
|
|
|
|
String[] args = [
|
|
|
|
buildYarnTiny.v2Output.getAbsolutePath(),
|
|
|
|
namedJar.getAbsolutePath(),
|
|
|
|
fakeSourceDir.getAbsolutePath()
|
|
|
|
]
|
|
|
|
|
|
|
|
net.fabricmc.mappingpoet.Main.main(args)
|
|
|
|
|
|
|
|
logger.lifecycle ":Fake source generated"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-18 09:55:18 -04:00
|
|
|
javadoc {
|
2020-04-07 16:13:29 -04:00
|
|
|
dependsOn genFakeSource
|
|
|
|
dependsOn downloadMcLibs
|
|
|
|
group = "javadoc generation"
|
|
|
|
outputs.upToDateWhen { false }
|
|
|
|
options {
|
|
|
|
source = "8"
|
|
|
|
encoding = 'UTF-8'
|
|
|
|
charSet = 'UTF-8'
|
|
|
|
memberLevel = JavadocMemberLevel.PRIVATE
|
|
|
|
links(
|
|
|
|
'https://guava.dev/releases/21.0/api/docs/',
|
|
|
|
'https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.0/',
|
|
|
|
'https://logging.apache.org/log4j/2.x/log4j-api/apidocs/',
|
|
|
|
// jsr305 need to come before jdk or the anno links are broken
|
|
|
|
'https://www.javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.2/',
|
|
|
|
'https://javadoc.lwjgl.org/',
|
|
|
|
'http://fastutil.di.unimi.it/docs/',
|
|
|
|
'https://commons.apache.org/proper/commons-logging/javadocs/api-1.1.3/',
|
|
|
|
'https://commons.apache.org/proper/commons-lang/javadocs/api-3.5',
|
|
|
|
'https://commons.apache.org/proper/commons-io/javadocs/api-2.5',
|
|
|
|
'https://commons.apache.org/proper/commons-codec/archives/1.10/apidocs',
|
|
|
|
'https://commons.apache.org/proper/commons-compress/javadocs/api-1.8.1/',
|
|
|
|
'https://docs.oracle.com/javase/8/docs/api/'
|
|
|
|
// Need to add loader jd publication for env annotations!
|
|
|
|
)
|
|
|
|
// Disable the crazy super-strict doclint tool in Java 8
|
|
|
|
addStringOption('Xdoclint:none', '-quiet')
|
|
|
|
}
|
|
|
|
source fakeSourceDir
|
|
|
|
classpath = configurations.javadocClasspath.plus downloadMcLibs.outputs.files.asFileTree
|
|
|
|
}
|
|
|
|
|
|
|
|
task javadocJar(type: Jar, dependsOn: ["javadoc"]) {
|
|
|
|
group = "javadoc generation"
|
|
|
|
|
|
|
|
from javadoc.destinationDir
|
|
|
|
|
|
|
|
archiveVersion.set yarnVersion
|
|
|
|
classifier = 'javadoc'
|
|
|
|
}
|
|
|
|
|
2018-10-30 07:29:43 -04:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
maven(MavenPublication) {
|
|
|
|
groupId 'net.fabricmc'
|
2018-12-09 16:14:34 -05:00
|
|
|
artifactId "yarn"
|
|
|
|
version yarnVersion
|
2018-10-30 07:29:43 -04:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
artifact(compressTiny.output) {
|
2018-10-30 07:29:43 -04:00
|
|
|
classifier "tiny"
|
2018-11-15 11:57:32 -05:00
|
|
|
builtBy compressTiny
|
2018-10-30 07:29:43 -04:00
|
|
|
}
|
2019-11-07 06:38:33 -05:00
|
|
|
artifact(tinyJar)
|
|
|
|
artifact(v2UnmergedYarnJar) {
|
|
|
|
classifier "v2"
|
|
|
|
}
|
2020-03-09 15:28:16 -04:00
|
|
|
artifact(v2MergedYarnJar) {
|
|
|
|
classifier "mergedv2"
|
|
|
|
}
|
2020-04-07 16:13:29 -04:00
|
|
|
artifact javadocJar
|
2018-10-30 07:29:43 -04:00
|
|
|
}
|
2019-11-07 06:38:33 -05:00
|
|
|
|
2018-10-30 07:29:43 -04:00
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
url "http://mavenupload.modmuss50.me/"
|
|
|
|
if (project.hasProperty('mavenPass')) {
|
|
|
|
credentials {
|
|
|
|
username 'buildslave'
|
|
|
|
password project.getProperty('mavenPass')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
void mapJar(File output, File input, File mappings, File libraries, String from, String to) {
|
2019-01-09 15:28:08 -05:00
|
|
|
if (output.exists()) {
|
|
|
|
output.delete()
|
|
|
|
}
|
|
|
|
|
|
|
|
def remapper = TinyRemapper.newRemapper()
|
2019-11-07 06:38:33 -05:00
|
|
|
.withMappings(TinyUtils.createTinyMappingProvider(mappings.toPath(), from, to))
|
|
|
|
.renameInvalidLocals(true)
|
|
|
|
.rebuildSourceFilenames(true)
|
|
|
|
.build()
|
|
|
|
|
2019-01-09 15:28:08 -05:00
|
|
|
try {
|
|
|
|
def outputConsumer = new OutputConsumerPath(output.toPath())
|
|
|
|
outputConsumer.addNonClassFiles(input.toPath())
|
2019-04-15 10:39:14 -04:00
|
|
|
remapper.readInputs(input.toPath())
|
2019-01-09 15:28:08 -05:00
|
|
|
|
2019-11-07 06:38:33 -05:00
|
|
|
libraries.eachFileRecurse(FileType.FILES) { file ->
|
2019-04-15 10:39:14 -04:00
|
|
|
remapper.readClassPath(file.toPath())
|
2019-01-09 15:28:08 -05:00
|
|
|
}
|
2019-04-15 10:39:14 -04:00
|
|
|
remapper.apply(outputConsumer)
|
2019-01-09 15:28:08 -05:00
|
|
|
outputConsumer.close()
|
2019-01-16 13:37:56 -05:00
|
|
|
remapper.finish()
|
2019-01-09 15:28:08 -05:00
|
|
|
} catch (Exception e) {
|
2019-01-16 13:37:56 -05:00
|
|
|
remapper.finish()
|
2019-05-12 21:45:52 -04:00
|
|
|
throw new RuntimeException("Failed to remap jar", e)
|
2019-01-09 15:28:08 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-30 07:29:43 -04:00
|
|
|
class FileOutput extends DefaultTask {
|
2019-11-07 06:38:33 -05:00
|
|
|
@OutputFile
|
|
|
|
File output
|
2018-10-31 12:54:00 -04:00
|
|
|
}
|
2019-11-07 06:38:33 -05:00
|
|
|
|
|
|
|
class WithV2FileOutput extends DefaultTask {
|
|
|
|
@OutputFile
|
|
|
|
File v1Output
|
|
|
|
@OutputFile
|
|
|
|
File v2Output
|
2020-03-20 18:57:01 -04:00
|
|
|
}
|