Add 1.7.10 version
This commit is contained in:
@@ -34,13 +34,27 @@ buildscript {
|
||||
mcVersion >= 10904 ? '2.2-SNAPSHOT' :
|
||||
mcVersion >= 10809 ? '2.1-SNAPSHOT' :
|
||||
mcVersion >= 10800 ? '2.0-SNAPSHOT' :
|
||||
mcVersion >= 10710 ? '1.2-SNAPSHOT' :
|
||||
'invalid'
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
apply plugin: 'org.spongepowered.mixin'
|
||||
if (mcVersion >= 10800) {
|
||||
apply plugin: 'net.minecraftforge.gradle.forge'
|
||||
apply plugin: 'org.spongepowered.mixin'
|
||||
} else {
|
||||
apply plugin: 'forge'
|
||||
|
||||
ext {
|
||||
// FIXME needed?
|
||||
mixinConfigs = [
|
||||
'compat.shaders', 'extras.playeroverview', 'recording', 'render', 'replay'
|
||||
].collect {"mixins.${it}.replaymod.json"}
|
||||
mixinSrg = new File(project.buildDir, 'tmp/mixins/mixins.srg')
|
||||
mixinRefMap = new File(project.buildDir, 'tmp/mixins/mixins.replaymod.refmap.json')
|
||||
}
|
||||
}
|
||||
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
@@ -52,7 +66,9 @@ group= "com.replaymod"
|
||||
archivesBaseName = "replaymod"
|
||||
|
||||
minecraft {
|
||||
coreMod = 'com.replaymod.core.LoadingPlugin'
|
||||
if (mcVersion >= 10800) {
|
||||
coreMod = 'com.replaymod.core.LoadingPlugin'
|
||||
}
|
||||
runDir = "../../eclipse"
|
||||
|
||||
version = [
|
||||
@@ -65,6 +81,7 @@ minecraft {
|
||||
10904: '1.9.4-12.17.0.1976',
|
||||
10809: '1.8.9-11.15.1.1722',
|
||||
10800: '1.8-11.14.4.1563',
|
||||
10710: '1.7.10-10.13.4.1558-1.7.10',
|
||||
][mcVersion]
|
||||
mappings = [
|
||||
11202: "snapshot_20170615",
|
||||
@@ -76,6 +93,7 @@ minecraft {
|
||||
10904: "snapshot_20160518",
|
||||
10809: "stable_22",
|
||||
10800: "snapshot_nodoc_20141130",
|
||||
10710: "stable_12",
|
||||
][mcVersion]
|
||||
}
|
||||
afterEvaluate {
|
||||
@@ -113,9 +131,9 @@ dependencies {
|
||||
|
||||
shade 'org.aspectj:aspectjrt:1.8.2'
|
||||
|
||||
def studioVersion = project.name
|
||||
def studioVersion = "${(int)(mcVersion/10000)}.${(int)(mcVersion/100)%100}" + (mcVersion%100==0 ? '' : ".${mcVersion%100}")
|
||||
if (studioVersion == '1.8.9') studioVersion = '1.8'
|
||||
shade("com.github.ReplayMod.ReplayStudio:$studioVersion:9fd96a7"){
|
||||
shade("com.github.ReplayMod.ReplayStudio:$studioVersion:24a6ad9"){
|
||||
exclude group: 'com.google.guava', module: 'guava' // provided by MC
|
||||
exclude group: 'org.projectlombok', module: 'lombok' // runtime only for @SneakyThrows which isn't used
|
||||
}
|
||||
@@ -124,6 +142,7 @@ dependencies {
|
||||
if (['1.10.2', '1.11', '1.11.2'].contains(jGuiVersion)) jGuiVersion = '1.9.4'
|
||||
if (['1.12.1', '1.12.2'].contains(jGuiVersion)) jGuiVersion = '1.12'
|
||||
shade(project(":jGui:$jGuiVersion")){
|
||||
transitive = false // FG 1.2 puts all MC deps into the compile configuration and we don't want to shade those
|
||||
exclude group: 'org.projectlombok', module: 'lombok' // runtime only for @SneakyThrows which isn't used
|
||||
}
|
||||
|
||||
@@ -132,6 +151,20 @@ dependencies {
|
||||
testCompile 'junit:junit:4.11'
|
||||
}
|
||||
|
||||
if (mcVersion <= 10710) {
|
||||
// FG 1.2 adds all MC deps to the compile configuration which we don't want
|
||||
afterEvaluate {
|
||||
// Remove them from the compile and runtime configurations
|
||||
configurations.compile.extendsFrom -= [configurations.minecraft, configurations.minecraftDeps]
|
||||
configurations.runtime.extendsFrom -= [configurations.forgeGradleStartClass]
|
||||
// And add them to the source sets instead
|
||||
sourceSets.main.with {
|
||||
compileClasspath += configurations.minecraft + configurations.minecraftDeps
|
||||
runtimeClasspath += configurations.minecraft + configurations.minecraftDeps + configurations.forgeGradleStartClass
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (project.name != 'core') {
|
||||
apply from: '../preprocessor.gradle'
|
||||
|
||||
@@ -164,7 +197,7 @@ if (project.name != 'core') {
|
||||
|
||||
compileJava.dependsOn preprocessJava
|
||||
processResources.dependsOn preprocessResources
|
||||
[deobfMcMCP, deobfMcSRG].each { task ->
|
||||
(mcVersion >= 10800 ? [deobfMcMCP, deobfMcSRG] : [deobfuscateJar, deobfBinJar]).each { task ->
|
||||
task.dependsOn preprocessResources
|
||||
}
|
||||
|
||||
@@ -177,16 +210,17 @@ if (project.name != 'core') {
|
||||
}
|
||||
|
||||
|
||||
def reobfTask = mcVersion >= 10800 ? tasks.reobfJar : tasks.reobf
|
||||
task configureRelocation() {
|
||||
dependsOn tasks.jar
|
||||
dependsOn configurations.shade
|
||||
doLast {
|
||||
def extraSrg = tasks.reobfJar.extraSrgLines
|
||||
def extraSrg = mcVersion >= 10800 ? reobfTask.extraSrgLines : reobfTask.extraSrg
|
||||
files(configurations.shade).filter { it.exists() }.collect {
|
||||
def tree = it.isDirectory() ? fileTree(it) : zipTree(it)
|
||||
def pkgs = [].toSet()
|
||||
tree.visit { file ->
|
||||
if (!file.directory && file.name.endsWith('.class')) {
|
||||
if (!file.directory && file.name.endsWith('.class') && file.path.contains('/')) {
|
||||
def pkg = file.path.substring(0, file.path.lastIndexOf('/'))
|
||||
if (!pkg.startsWith('com/replaymod') && !pkg.startsWith('javax/')) {
|
||||
pkgs << pkg
|
||||
@@ -199,7 +233,14 @@ task configureRelocation() {
|
||||
}
|
||||
}
|
||||
}
|
||||
tasks.reobfJar.dependsOn configureRelocation
|
||||
reobfTask.dependsOn configureRelocation
|
||||
|
||||
if (mcVersion <= 10710) {
|
||||
// Dummy task so "./gradlew reobfJar" also builds 1.7.10
|
||||
task reobfJar() {
|
||||
dependsOn reobf
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
@@ -207,6 +248,10 @@ jar {
|
||||
dependsOn configurations.compile
|
||||
dependsOn configurations.shade
|
||||
|
||||
if (mcVersion <= 10710) {
|
||||
from project.mixinRefMap
|
||||
}
|
||||
|
||||
def shade = {files(
|
||||
configurations.compile.findAll {it.name.startsWith 'mixin-'}
|
||||
+ configurations.shade
|
||||
@@ -237,6 +282,8 @@ jar {
|
||||
attributes 'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
|
||||
'TweakOrder': '0',
|
||||
'FMLCorePluginContainsFMLMod': 'true',
|
||||
// FIXME is this needed? 'MixinConfigs': project.mixinConfigs.join(','),
|
||||
'FMLCorePlugin': 'com.replaymod.core.LoadingPlugin',
|
||||
'FMLAT': 'replaymod_at.cfg'
|
||||
}
|
||||
}
|
||||
@@ -285,13 +332,30 @@ setupDecompWorkspace.dependsOn copySrg
|
||||
setupDevWorkspace.dependsOn copySrg
|
||||
project.tasks.idea.dependsOn copySrg
|
||||
|
||||
if (mcVersion <= 10710) {
|
||||
reobf.doFirst {
|
||||
if (project.mixinSrg.exists()) {
|
||||
addExtraSrgFile project.mixinSrg
|
||||
}
|
||||
}
|
||||
|
||||
compileJava.dependsOn copySrg
|
||||
compileJava {
|
||||
options.compilerArgs += [
|
||||
"-AoutSrgFile=${project.mixinSrg.canonicalPath}",
|
||||
"-AoutRefMapFile=${project.mixinRefMap.canonicalPath}",
|
||||
"-AreobfSrgFile=${project.file('build/mcp-srg.srg').canonicalPath}"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// Mixin uses multiple HashMaps to generate the refmap.
|
||||
// HashMaps are unordered collections and as such do not produce deterministic output.
|
||||
// To fix that, we simply sort the refmap json file.
|
||||
import groovy.json.JsonSlurper
|
||||
import groovy.json.JsonOutput
|
||||
compileJava.doLast {
|
||||
File refmapFile = compileJava.ext.refMapFile
|
||||
File refmapFile = mcVersion >= 10800 ? compileJava.ext.refMapFile : project.mixinRefMap
|
||||
if (refmapFile.exists()) {
|
||||
def ordered
|
||||
ordered = {
|
||||
@@ -324,7 +388,7 @@ import static org.objectweb.asm.Opcodes.ASM5
|
||||
// As a workaround, to use setupCIWorkspace on Drone, we modify the bin jar in-place and remove all parameter annotations.
|
||||
// WARNING: This piece of code ignores any and all gradle conventions and will probably fail horribly when run outside
|
||||
// of a single-use environment (e.g. Drone). Use setupDecompWorkspace for normal use.
|
||||
tasks.deobfMcMCP.doLast {
|
||||
def annotationWorkaround = {
|
||||
println "Applying RuntimeInvisibleParameterAnnotations workaround..."
|
||||
File jar = getOutJar()
|
||||
File tmp = new File((File) getTemporaryDir(), "workaround.jar")
|
||||
@@ -359,6 +423,9 @@ tasks.deobfMcMCP.doLast {
|
||||
jar.delete()
|
||||
tmp.renameTo(jar)
|
||||
}
|
||||
if (mcVersion >= 10809) {
|
||||
tasks.deobfMcMCP.doLast annotationWorkaround
|
||||
}
|
||||
|
||||
task runIntegrationTest(type: JavaExec, dependsOn: ["makeStart", "jar"]) {
|
||||
main = 'GradleStart'
|
||||
|
||||
Reference in New Issue
Block a user