Fix extract inheritance not using proper classpath and update buildscript for FG asm changes.

This commit is contained in:
LexManos 2019-08-14 16:13:15 -07:00
parent 4323c6d845
commit 88595dd26b
1 changed files with 40 additions and 31 deletions

View File

@ -8,6 +8,7 @@ buildscript {
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
classpath 'org.ow2.asm:asm:7.1'
classpath 'org.ow2.asm:asm-tree:7.1'
}
}
import groovy.json.JsonSlurper
@ -36,8 +37,6 @@ import org.apache.tools.ant.filters.ReplaceTokens
import de.undercouch.gradle.tasks.download.Download
import org.gradle.plugins.ide.eclipse.model.SourceFolder
import org.objectweb.asm.ClassReader
import org.objectweb.asm.ClassWriter
import org.objectweb.asm.tree.ClassNode
plugins {
id 'net.minecrell.licenser' version '0.4'
@ -187,6 +186,7 @@ project(':forge') {
// Essentially, the same as the old, except dropping the first number, and the builds are no longer unique.
MCP_ARTIFACT = project(':mcp').mcp.config
SPECIAL_SOURCE = 'net.md-5:SpecialSource:1.8.5'
VERSION_JSON = project(':mcp').file('build/mcp/downloadJson/version.json')
}
def getVersion = {
@ -244,30 +244,9 @@ project(':forge') {
}
cpw_forge_client {
parent runs.forge_client
taskName 'cpw_forge_client'
main 'net.minecraftforge.userdev.LaunchTesting'
workingDirectory project.file('run')
environment 'target', 'fmldevclient'
environment 'assetIndex', '{asset_index}'
environment 'assetDirectory', downloadAssets.output
environment 'nativesDirectory', extractNatives.output
environment 'MC_VERSION', MC_VERSION
environment 'MCP_VERSION', MCP_VERSION
environment 'FORGE_GROUP', project.group
environment 'FORGE_SPEC', SPEC_VERSION
environment 'FORGE_VERSION', project.version.substring(MC_VERSION.length() + 1).toString()
environment 'LAUNCHER_VERSION', SPEC_VERSION
property 'terminal.ansi', 'true'
property 'forge.logging.noansi', 'false'
property 'org.lwjgl.system.SharedLibraryExtractDirectory', 'lwjgl_dll'
ideaModule "${rootProject.name}.${project.name}.userdev"
source sourceSets.main
source sourceSets.userdev
}
forge_test_client {
@ -370,12 +349,12 @@ project(':forge') {
'Implementation-Vendor': 'Forge'
] as LinkedHashMap,
'net/minecraftforge/fml/mclanguageprovider/': [
'Specification-Title': 'Mod Language Provider',
'Specification-Vendor': 'Forge Development LLC',
'Specification-Version': '1',
'Implementation-Title': 'Minecraft Language Mod Provider',
'Implementation-Version': '1',
'Implementation-Vendor': 'Forge'
'Specification-Title': 'Mod Language Provider',
'Specification-Vendor': 'Forge Development LLC',
'Specification-Version': '1',
'Implementation-Title': 'Minecraft Language Mod Provider',
'Implementation-Version': '1',
'Implementation-Vendor': 'Forge'
] as LinkedHashMap,
'net/minecraftforge/fml/loading/': [
'Specification-Title': 'Launcher',
@ -565,8 +544,38 @@ project(':forge') {
}
}
task extractInheritance(type: ExtractInheritance, dependsOn: genJoinedBinPatches) {
task downloadLibraries(dependsOn: ':mcp:setupMCP') {
inputs.file VERSION_JSON
doLast {
def json = new JsonSlurper().parseText(VERSION_JSON.text)
json.libraries.each {lib ->
def artifacts = [lib.downloads.artifact] + lib.downloads.get('classifiers', [:]).values()
artifacts.each{ art ->
def target = file('build/libraries/' + art.path)
if (!target.exists()) {
download {
src art.url
dest target
}
}
}
}
}
}
task extractInheritance(type: ExtractInheritance, dependsOn: [genJoinedBinPatches, downloadLibraries]) {
input { genJoinedBinPatches.cleanJar }
doFirst {
def json = new JsonSlurper().parseText(VERSION_JSON.text)
json.libraries.each {lib ->
def artifacts = [lib.downloads.artifact] + lib.downloads.get('classifiers', [:]).values()
artifacts.each{ art ->
def target = file('build/libraries/' + art.path)
if (target.exists())
addLibrary(target)
}
}
}
}
task checkATs(dependsOn: genJoinedBinPatches) {
inputs.file { genJoinedBinPatches.cleanJar }