Use FG1.2 fork with Gradle 4.9 fixes so we can build everything at once

This commit is contained in:
Jonas Herzig
2019-05-07 17:55:59 +02:00
parent 362f61a337
commit 7b97d9ea85
10 changed files with 58 additions and 170 deletions

View File

@@ -8,9 +8,8 @@ pipeline:
commands: commands:
- curl --fail --create-dirs -o $HOME/.gradle/init.d/mirror.gradle https://maven.johni0702.de/config/gradle - curl --fail --create-dirs -o $HOME/.gradle/init.d/mirror.gradle https://maven.johni0702.de/config/gradle
- git config --global user.email "replaymod@drone" && git config --global user.name "Drone" - git config --global user.email "replaymod@drone" && git config --global user.name "Drone"
- ./gradlew -PworkAroundBuildOrder=1 --parallel shadowJar :1.8:setCoreVersion - ./gradlew :jGui:1.7.10:setupCIWorkspace :1.7.10:setupCIWorkspace
- ./gradlew --old-gradle :1.7.10:setupCIWorkspace :jGui:1.7.10:setupCIWorkspace - ./gradlew --parallel
- ./gradlew --old-gradle -PignoreDirty=1 :1.7.10:shadowJar :shadowJar
archive: archive:
image: plugins/s3 image: plugins/s3
acl: public-read acl: public-read

View File

@@ -1 +1 @@
eyJhbGciOiJIUzI1NiJ9.cGlwZWxpbmU6CiAgY2xvbmU6CiAgICBpbWFnZTogcGx1Z2lucy9naXQKICAgIHRhZ3M6IHRydWUKICAgIHJlY3Vyc2l2ZTogdHJ1ZQogIGJ1aWxkOgogICAgaW1hZ2U6IG1hdmVuOjMuMy45LWpkay04CiAgICBjb21tYW5kczoKICAgICAgLSBjdXJsIC0tZmFpbCAtLWNyZWF0ZS1kaXJzIC1vICRIT01FLy5ncmFkbGUvaW5pdC5kL21pcnJvci5ncmFkbGUgaHR0cHM6Ly9tYXZlbi5qb2huaTA3MDIuZGUvY29uZmlnL2dyYWRsZQogICAgICAtIGdpdCBjb25maWcgLS1nbG9iYWwgdXNlci5lbWFpbCAicmVwbGF5bW9kQGRyb25lIiAmJiBnaXQgY29uZmlnIC0tZ2xvYmFsIHVzZXIubmFtZSAiRHJvbmUiCiAgICAgIC0gLi9ncmFkbGV3I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UiCiAgICAgIC0gLi9ncmFkbGV3IDpqR3VpOjEuNy4xMDpzZXR1cENJV29ya3NwYWNlIDoxLjcuMTA6c2V0dXBDSVdvcmtzcGFjZQogICAgICAtIC4vZ3JhZGxldyAtLXBhcmFsbGVsCiAgYXJjaGl2ZToKICAgIGltYWdlOiBwbHVnaW5zL3MzCiAgICBhY2w6IHB1YmxpYy1yZWFkCiAgICByZWdpb246ICJ1cy1lYXN0LTEiCiAgICBidWNrZXQ6ICJyZXBsYXltb2QiCiAgICBwYXRoX3N0eWxlOiB0cnVlCiAgICBzb3VyY2U6IGJ1aWxkL2xpYnMvKgogICAgc3RyaXBfcHJlZml4OiBidWlsZC9saWJzLwogICAgdGFyZ2V0OiAvCg.PkpQ-mlJA2h-lzJrF1ioDuflwUN5_gCZ5gpEs4rZrnY

View File

@@ -8,10 +8,6 @@ After the initial clone, running `./gradlew setupDecompWorkspace` is necessary.
This will also be necessary if the `replaymod_at.cfg` file has been changed (getting errors about code that is trying This will also be necessary if the `replaymod_at.cfg` file has been changed (getting errors about code that is trying
to access private fields is a good indication that this has happened). to access private fields is a good indication that this has happened).
**Note**: ForgeGradle 1.2 (used for 1.7.10) is not compatible with Gradle 4.
As such, you need to use an older version (Gradle 3.x) to build the ReplayMod for 1.7.10.
An easy way to do that is to pass `--old-gradle` as the first argument to the Gradle wrapper shell script: `./gradlew --old-gradle build`
### No IDE ### No IDE
You can build the mod by running `./gradlew build`. You can then find the final jar files in `versions/$MCVERSION/build/libs/`. You can build the mod by running `./gradlew build`. You can then find the final jar files in `versions/$MCVERSION/build/libs/`.
You can also build single versions by running `./gradlew :1.8:build` (builds the MC 1.8 version). You can also build single versions by running `./gradlew :1.8:build` (builds the MC 1.8 version).
@@ -122,4 +118,4 @@ Bug numbers in commits such as `(fixes #42)` refer to Bugzilla unless noted othe
## License ## License
The ReplayMod is provided under the terms of the GNU General Public License Version 3 or (at your option) any later version. The ReplayMod is provided under the terms of the GNU General Public License Version 3 or (at your option) any later version.
See `LICENSE.md` for the full license text. See `LICENSE.md` for the full license text.

View File

@@ -26,7 +26,7 @@ if (releaseCommit == currentCommit) {
def diff = command('git', 'log', '--format=oneline', "$releaseCommit..$currentCommit").size() def diff = command('git', 'log', '--format=oneline', "$releaseCommit..$currentCommit").size()
version = "$latestVersion-$diff-g${currentCommit.substring(0, 7)}" version = "$latestVersion-$diff-g${currentCommit.substring(0, 7)}"
} }
if (gitDescribe().endsWith('*') && !project.hasProperty('ignoreDirty')) { if (gitDescribe().endsWith('*')) {
version = "$version-dirty" version = "$version-dirty"
} }
@@ -61,24 +61,6 @@ subprojects {
} }
} }
// Workaround specific to CI build to guarantee correct ordering of
// ./gradlew --parallel shadowJar :1.8:setCoreVersion
// TODO properly fix the ordering in preprocessor
if (project.hasProperty('workAroundBuildOrder')) {
evaluationDependsOnChildren()
def rmTasks = project(':1.8').tasks
def jGuiTasks = project(':jGui:1.8').tasks
subprojects.forEach {
def shadowTask = it.tasks.findByName('shadowJar')
if (shadowTask != null) {
rmTasks.setCoreVersionJava.mustRunAfter shadowTask
rmTasks.setCoreVersionResources.mustRunAfter shadowTask
jGuiTasks.setCoreVersionJava.mustRunAfter shadowTask
jGuiTasks.setCoreVersionResources.mustRunAfter shadowTask
}
}
}
def gitDescribe() { def gitDescribe() {
try { try {
def stdout = new ByteArrayOutputStream() def stdout = new ByteArrayOutputStream()

Binary file not shown.

View File

@@ -1,6 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5.1-all.zip
distributionSha256Sum=69d99ade952de3727b65a88f3188ee72231ff4e28c2d00aacfc96a42c6d6f303

7
gradlew vendored
View File

@@ -65,12 +65,7 @@ cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`" APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null cd "$SAVED" >/dev/null
if [ "$1" == "--old-gradle" ]; then CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
shift
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper-old.jar
else
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
fi
# Determine the Java command to use to start the JVM. # Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then

2
jGui

Submodule jGui updated: fe401d8e73...2af56311f2

View File

@@ -3,46 +3,33 @@ def coreMcVersion = f.exists() ? f.readLines().first() as int : 11302
def jGuiVersions = [] def jGuiVersions = []
def replayModVersions = [] def replayModVersions = []
if (gradle.gradleVersion.startsWith('3.')) { if (coreMcVersion > 10710) {
if (coreMcVersion <= 10800) { // allow 1.8 only to run The Preprocessor jGuiVersions += ['core']
jGuiVersions += ['core'] replayModVersions += ['core']
replayModVersions += ['core']
}
jGuiVersions += [
'1.8', // allow 1.8 only to run The Preprocessor
'1.7.10',
]
replayModVersions += [
'1.8', // allow 1.8 only to run The Preprocessor
'1.7.10',
]
} else {
if (coreMcVersion > 10710) {
jGuiVersions += ['core']
replayModVersions += ['core']
}
jGuiVersions += [
'1.8',
'1.8.9',
'1.9.4',
'1.12',
'1.13.2',
'1.14',
]
replayModVersions += [
'1.8',
'1.8.9',
'1.9.4',
'1.10.2',
'1.11',
'1.11.2',
'1.12',
'1.12.1',
'1.12.2',
'1.13.2',
'1.14',
]
} }
jGuiVersions += [
'1.7.10',
'1.8',
'1.8.9',
'1.9.4',
'1.12',
'1.13.2',
'1.14',
]
replayModVersions += [
'1.7.10',
'1.8',
'1.8.9',
'1.9.4',
'1.10.2',
'1.11',
'1.11.2',
'1.12',
'1.12.1',
'1.12.2',
'1.13.2',
'1.14',
]
include ':jGui' include ':jGui'
jGuiVersions.each { version -> jGuiVersions.each { version ->

View File

@@ -32,12 +32,10 @@ buildscript {
} }
dependencies { dependencies {
if (!gradle.gradleVersion.startsWith('3.')) { classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.2'
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.2' // Gradle 4+ only
}
if (mcVersion >= 11400) { if (mcVersion >= 11400) {
classpath 'fabric-loom:fabric-loom.gradle.plugin:0.2.2-SNAPSHOT' classpath 'fabric-loom:fabric-loom.gradle.plugin:0.2.2-SNAPSHOT'
} else { } else if (mcVersion >= 10800) {
classpath 'org.ow2.asm:asm:6.0' classpath 'org.ow2.asm:asm:6.0'
classpath('com.github.SpongePowered:MixinGradle:dcfaf61'){ // 0.6 classpath('com.github.SpongePowered:MixinGradle:dcfaf61'){ // 0.6
// Because forgegradle requires 6.0 (not -debug-all) while mixingradle depends on 5.0 // Because forgegradle requires 6.0 (not -debug-all) while mixingradle depends on 5.0
@@ -50,9 +48,10 @@ buildscript {
mcVersion >= 10904 ? '2.2-SNAPSHOT' : mcVersion >= 10904 ? '2.2-SNAPSHOT' :
mcVersion >= 10809 ? '2.1-SNAPSHOT' : mcVersion >= 10809 ? '2.1-SNAPSHOT' :
mcVersion >= 10800 ? '2.0-SNAPSHOT' : mcVersion >= 10800 ? '2.0-SNAPSHOT' :
mcVersion >= 10710 ? '1.2-SNAPSHOT' :
'invalid' 'invalid'
) )
} else {
classpath 'com.github.Team-Fruit:ForgeGradle:3be8636'
} }
classpath 'com.github.replaymod:preprocessor:9d3202c' classpath 'com.github.replaymod:preprocessor:9d3202c'
} }
@@ -69,9 +68,7 @@ def jGuiVersion = project.name
if (['1.10.2', '1.11', '1.11.2'].contains(jGuiVersion)) jGuiVersion = '1.9.4' 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' if (['1.12.1', '1.12.2'].contains(jGuiVersion)) jGuiVersion = '1.12'
if (!gradle.gradleVersion.startsWith('3.')) { apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.github.johnrengelman.shadow'
}
if (mcVersion >= 10800) { if (mcVersion >= 10800) {
if (FABRIC) { if (FABRIC) {
@@ -238,10 +235,8 @@ dependencies {
if (!FABRIC) { if (!FABRIC) {
// compile 'com.github.SpongePowered:Mixin:404f5da' // 0.7.5-SNAPSHOT // compile 'com.github.SpongePowered:Mixin:404f5da' // 0.7.5-SNAPSHOT
// ^ mixin doesn't compile on jitpack, so we'll have to depend on the SNAPSHOT and build it manually for reprod // ^ mixin doesn't compile on jitpack, so we'll have to depend on the SNAPSHOT and build it manually for reprod
if (!gradle.gradleVersion.startsWith('3.')) { annotationProcessor 'org.spongepowered:mixin:0.7.8-SNAPSHOT'
annotationProcessor 'org.spongepowered:mixin:0.7.8-SNAPSHOT' compileOnly 'org.spongepowered:mixin:0.7.8-SNAPSHOT'
compileOnly 'org.spongepowered:mixin:0.7.8-SNAPSHOT'
}
shade('org.spongepowered:mixin:0.7.8-SNAPSHOT') { shade('org.spongepowered:mixin:0.7.8-SNAPSHOT') {
transitive = false // deps should all be bundled with MC transitive = false // deps should all be bundled with MC
} }
@@ -273,9 +268,7 @@ dependencies {
shadow files(project(":jGui:$jGuiVersion").tasks.preshadowJar.archivePath) // include pre-shadowed lwjgl_util shadow files(project(":jGui:$jGuiVersion").tasks.preshadowJar.archivePath) // include pre-shadowed lwjgl_util
} }
if (!gradle.gradleVersion.startsWith('3.')) { annotationProcessor 'org.projectlombok:lombok:1.16.6'
annotationProcessor 'org.projectlombok:lombok:1.16.6'
}
compile 'org.projectlombok:lombok:1.16.6' // runtime only for @SneakyThrows which isn't used compile 'org.projectlombok:lombok:1.16.6' // runtime only for @SneakyThrows which isn't used
testCompile 'junit:junit:4.11' testCompile 'junit:junit:4.11'
@@ -325,93 +318,35 @@ task configureRelocation() {
} }
pkgs pkgs
}.flatten().unique() }.flatten().unique()
if (mcVersion >= 10800) { pkgs.each { pkg ->
pkgs.each { pkg -> def pkgName = pkg.replace('/', '.')
def pkgName = pkg.replace('/', '.') shadowJar.relocate pkgName, 'com.replaymod.lib.' + pkgName
shadowJar.relocate pkgName, 'com.replaymod.lib.' + pkgName
}
} else {
def extraSrg = tasks.reobf.extraSrg
pkgs.each { pkg ->
extraSrg << "PK: $pkg com/replaymod/lib/$pkg".toString()
}
} }
} }
} }
if (!gradle.gradleVersion.startsWith('3.')) { // Gradle 4 (never used for 1.7.10)
tasks.removeByName('shadowJar') // we want to base our shadowed jar on the reobfJar output, not the sourceSet output
task shadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
from { tasks.jar.archivePath }
afterEvaluate { dependsOn FABRIC ? tasks.remapJar : tasks.reobfJar }
manifest.inheritFrom tasks.jar.manifest
from project.configurations.shade tasks.removeByName('shadowJar') // we want to base our shadowed jar on the reobfJar output, not the sourceSet output
configurations = [project.configurations.shadow] task shadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
exclude 'META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'module-info.class' from { tasks.jar.archivePath }
afterEvaluate { dependsOn FABRIC ? tasks.remapJar : (mcVersion >= 10800 ? tasks.reobfJar : tasks.reobf) }
manifest.inheritFrom tasks.jar.manifest
dependsOn tasks.configureRelocation from project.configurations.shade
configurations = [project.configurations.shadow]
exclude 'META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'module-info.class'
// No need to shadow netty, MC provides it dependsOn tasks.configureRelocation
relocate 'com.github.steveice10.netty', 'io.netty'
exclude 'com/github/steveice10/netty/**'
minimize { // No need to shadow netty, MC provides it
exclude(dependency('.*spongepowered:mixin:.*')) relocate 'com.github.steveice10.netty', 'io.netty'
} exclude 'com/github/steveice10/netty/**'
}
} else if (mcVersion >= 10800) {
// Neither Gradle 4 nor MC 1.7.10, we do not support building jars in this configuration, it
// is only supported to allow the preprocessor to convert the source from 1.8 to 1.7.10
task shadowJar() {
doFirst { throw new UnsupportedOperationException('1.8+ jars require Gradle 4') }
}
} else {
tasks.reobf.dependsOn tasks.configureRelocation
// Dummy task so "./gradlew shadowJar" also works on 1.7.10 minimize {
task shadowJar(type: Jar) { exclude(dependency('.*spongepowered:mixin:.*'))
from { zipTree(tasks.jar.archivePath) }
afterEvaluate { manifest = tasks.jar.manifest }
dependsOn tasks.reobf
} }
} }
tasks.assemble.dependsOn tasks.shadowJar tasks.assemble.dependsOn tasks.shadowJar
if (mcVersion <= 10710) // anything above uses shadowJar
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
dependsOn configurations.compile
dependsOn configurations.shade
dependsOn configurations.relocate
from project.mixinRefMap
def shade = { files(configurations.relocate + configurations.shade) }
def noticeDir = file("$buildDir/NOTICE")
doFirst {
noticeDir.deleteDir()
noticeDir.mkdirs()
shade().collect { it.isDirectory() ? fileTree(it) : zipTree(it) }.each {
it.matching { include '**/NOTICE*' }.each {
new File(noticeDir, 'NOTICE.txt') << it.getText('UTF-8') + '\n'
}
}
}
from noticeDir
from ({shade().collect { it.isDirectory() ? it : zipTree(it) }}) {
exclude '**/NOTICE*'
eachFile {
if (getName() == 'LICENSE.txt') {
setName(getFile().getParentFile().getName().split('.jar_')[0].tokenize('-')[0] + '-LICENSE.txt')
}
}
}
}
jar { jar {
classifier = 'raw' classifier = 'raw'