91573d9Update jGui, ReplayStudio and Translationsd71358bAdd confirmation dialog before overwriting path presets (fixes #65)1a55983Move addCallback method from integration test Utils to main Utils18c5bcdBe more cooperative with other mods on the ingame menu (fixes #42)c054fe8Register keys for simplepathing only once (fixes #63)f13297cFix default interpolator handling in keyframe gui and after loading (fixes #64)391f304Show error popup if entity tracker fails to load0e0eaaaFix entity tracker being set even if it failed loading (fixes #50)a34bbbcFix NPE when spectating a player without a camera entity60879fbChange local class to be an inner class because Srg2Source breaks with itdfafbecLoad translations from github repo, only reload language not all resource packs8a6ec51Add missing tooltips to player overview and various missing chat messages5677fc5Re-add warning to replay editor748a91eFix missing tooltips on fav/like/dislike buttons in replay centeree24866Fix upload replay button not being updated when name/tags changedba085cMove translations into separate repo3f0e3e7Fix NPE when receiving Replay|Restrict messages (fixes #16 GH)40e1d85Fix crash when saving the last keyframe in the edit gui (fixes #61)03aada1Update Mixin to 0.6.8 (fixes #9 GH)0c1dc65Fix interpolator being lost when moving keyframe to the end (fixes #62)fcbbbc9Add integration test. Run with ./gradlew runIntegrationTestfe6ded0Fix movement of keyframe via GuiEditKeyframe not updating selected keyframef58fa8fFix Login GUI not respecting other GUIs opened on startup4fc3a31Fix OpenEye being installed into working dir instead of mcDataDir
292 lines
8.7 KiB
Groovy
Executable File
292 lines
8.7 KiB
Groovy
Executable File
import groovy.json.JsonOutput
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
maven {
|
|
name = "forge"
|
|
url = "http://files.minecraftforge.net/maven"
|
|
}
|
|
maven {
|
|
name = "sponge"
|
|
url = "https://repo.spongepowered.org/maven"
|
|
}
|
|
maven {
|
|
name = "sonatype"
|
|
url = "https://oss.sonatype.org/content/repositories/snapshots/"
|
|
}
|
|
}
|
|
dependencies {
|
|
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
|
|
classpath 'org.spongepowered:mixingradle:0.3-SNAPSHOT'
|
|
}
|
|
}
|
|
|
|
apply plugin: 'net.minecraftforge.gradle.forge'
|
|
apply plugin: 'org.spongepowered.mixin'
|
|
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
|
|
version = gitDescribe()
|
|
group= "com.replaymod"
|
|
archivesBaseName = "replaymod"
|
|
|
|
minecraft {
|
|
coreMod = 'com.replaymod.core.LoadingPlugin'
|
|
version = '1.8.9-11.15.1.1722'
|
|
runDir = "eclipse"
|
|
mappings = "stable_22"
|
|
replace '@MOD_VERSION@', project.version
|
|
replace '@MC_VERSION@', project.minecraft.version
|
|
}
|
|
|
|
repositories {
|
|
maven {
|
|
name = "SpongePowered Repo"
|
|
url = "http://repo.spongepowered.org/maven/"
|
|
}
|
|
maven {
|
|
url 'https://repo.spacehq.org/content/repositories/snapshots/'
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
shade
|
|
compile.extendsFrom shade
|
|
}
|
|
|
|
dependencies {
|
|
compile 'org.projectlombok:lombok:1.16.4'
|
|
|
|
compile 'org.spongepowered:mixin:0.6.8-SNAPSHOT'
|
|
shade 'com.googlecode.mp4parser:isoparser:1.1.7'
|
|
shade 'org.apache.commons:commons-exec:1.3'
|
|
shade 'com.google.apis:google-api-services-youtube:v3-rev178-1.22.0'
|
|
shade 'com.google.api-client:google-api-client-gson:1.20.0'
|
|
shade 'com.google.api-client:google-api-client-java6:1.20.0'
|
|
shade 'com.google.oauth-client:google-oauth-client-jetty:1.20.0'
|
|
|
|
shade 'org.aspectj:aspectjrt:1.8.2'
|
|
|
|
compile project(':ReplayStudio')
|
|
|
|
testCompile 'junit:junit:4.11'
|
|
}
|
|
|
|
tasks['idea'].dependsOn ':ReplayStudio:preshadowJar'
|
|
|
|
jar {
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
|
|
dependsOn configurations.compile
|
|
dependsOn configurations.shade
|
|
dependsOn ':ReplayStudio:shadowJar'
|
|
|
|
def shade = {files(
|
|
configurations.compile.findAll {it.name.startsWith 'mixin-'}
|
|
+ configurations.shade
|
|
+ getTasks().getByPath(':ReplayStudio:shadowJar').outputs.files
|
|
)}
|
|
|
|
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*'
|
|
// exclude everything taken in from jGui for running the mod in a dev environment
|
|
exclude { new File(file('jGui/src/main/resources'), it.relativePath.pathString).exists() }
|
|
eachFile {
|
|
if (getName() == 'LICENSE.txt') {
|
|
setName(getFile().getParentFile().getName().split('-')[0] + '-LICENSE.txt')
|
|
}
|
|
}
|
|
}
|
|
|
|
manifest {
|
|
attributes 'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker',
|
|
'TweakOrder': '0',
|
|
'FMLAT': 'replaymod_at.cfg'
|
|
}
|
|
}
|
|
|
|
def gitDescribe() {
|
|
try {
|
|
def stdout = new ByteArrayOutputStream()
|
|
exec {
|
|
commandLine 'git', 'describe', '--always', '--dirty=*'
|
|
standardOutput = stdout
|
|
}
|
|
return stdout.toString().trim()
|
|
} catch (e) {
|
|
return "unknown"
|
|
}
|
|
}
|
|
|
|
processResources
|
|
{
|
|
// this will ensure that this task is redone when the versions change.
|
|
inputs.property "version", project.version
|
|
inputs.property "mcversion", project.minecraft.version
|
|
|
|
// replace stuff in mcmod.info, nothing else
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
include 'mcmod.info'
|
|
|
|
// replace version and mcversion
|
|
expand 'version': project.version, 'mcversion': project.minecraft.version
|
|
}
|
|
|
|
// copy everything else, thats not the mcmod.info
|
|
from(sourceSets.main.resources.srcDirs) {
|
|
exclude 'mcmod.info'
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main {
|
|
// Directly include jGui into main build
|
|
// This could also be done by including it as a gradle subproject, however
|
|
// doing so caused classpath issues on some IntelliJ versions.
|
|
java {
|
|
srcDir 'jGui/src/main/java'
|
|
}
|
|
resources {
|
|
srcDir 'jGui/src/main/resources'
|
|
}
|
|
refMap = "mixins.replaymod.refmap.json"
|
|
}
|
|
integrationTest {
|
|
compileClasspath += main.runtimeClasspath + main.output
|
|
java {
|
|
srcDir file('src/integration-test/java')
|
|
}
|
|
resources.srcDir file('src/integration-test/resources')
|
|
}
|
|
}
|
|
|
|
task copySrg(type: Copy, dependsOn: 'genSrgs') {
|
|
from {project.tasks.genSrgs.mcpToSrg}
|
|
into 'build'
|
|
}
|
|
|
|
setupDecompWorkspace.dependsOn copySrg
|
|
setupDevWorkspace.dependsOn copySrg
|
|
project.tasks.idea.dependsOn copySrg
|
|
|
|
task runIntegrationTest(type: JavaExec, dependsOn: ["makeStart", "jar"]) {
|
|
main = 'GradleStart'
|
|
standardOutput = System.out
|
|
errorOutput = System.err
|
|
workingDir file(minecraft.runDir)
|
|
|
|
def testDir = new File(minecraft.runDir, "integration-test")
|
|
doFirst {
|
|
testDir.deleteDir()
|
|
testDir.mkdirs()
|
|
}
|
|
|
|
doLast {
|
|
testDir.deleteDir()
|
|
}
|
|
|
|
afterEvaluate {
|
|
def runClient = tasks.getByName("runClient")
|
|
runIntegrationTest.jvmArgs = runClient.jvmArgs + "-Dfml.noGrab=true"
|
|
runIntegrationTest.args = runClient.args + "--gameDir" + testDir.canonicalPath
|
|
runIntegrationTest.classpath runClient.classpath + sourceSets.integrationTest.output
|
|
}
|
|
}
|
|
|
|
def generateVersionsJson() {
|
|
// List all tags
|
|
def stdout = new ByteArrayOutputStream()
|
|
project.exec {
|
|
commandLine 'git', 'for-each-ref', '--sort=taggerdate', '--format=%(refname:short)', 'refs/tags'
|
|
standardOutput = stdout
|
|
}
|
|
def versions = stdout.toString().tokenize('\n').reverse()
|
|
def mcVersions = versions.collect {it.substring(0, it.indexOf('-'))}.unique().reverse()
|
|
|
|
def root = [
|
|
homepage: 'https://www.replaymod.com/download/',
|
|
promos: [:]
|
|
]
|
|
mcVersions.forEach { mcVersion ->
|
|
def mcVersionRoot = [:]
|
|
def latest
|
|
def recommended
|
|
versions.forEach {
|
|
def (thisMcVersion, modVersion, preVersion) = it.tokenize('-')
|
|
if (thisMcVersion == mcVersion) {
|
|
mcVersionRoot[it] = "See https://github.com/ReplayMod/ReplayMod/releases/$it"
|
|
if (latest == null) latest = it
|
|
if (preVersion == null) {
|
|
if (recommended == null) recommended = it
|
|
}
|
|
}
|
|
}
|
|
root[mcVersion] = mcVersionRoot
|
|
root.promos[mcVersion + '-latest'] = latest
|
|
if (recommended != null) {
|
|
root.promos[mcVersion + '-recommended'] = recommended
|
|
}
|
|
}
|
|
root
|
|
}
|
|
|
|
task doRelease() {
|
|
doLast {
|
|
// Parse version
|
|
def version = project.releaseVersion as String
|
|
if (project.version.endsWith('*')) {
|
|
throw new InvalidUserDataException('Git working tree is dirty. Make sure to commit all changes.')
|
|
}
|
|
def (mcVersion, modVersion, preVersion) = version.tokenize('-')
|
|
preVersion = preVersion != null && preVersion.startsWith('b') ? preVersion.substring(1) : null
|
|
|
|
// Create new tag
|
|
if (preVersion != null) {
|
|
project.exec {
|
|
commandLine 'git', 'tag',
|
|
'-m', "Pre-release $preVersion of $modVersion for Minecraft $mcVersion",
|
|
"$mcVersion-$modVersion-b$preVersion"
|
|
}
|
|
} else {
|
|
project.exec {
|
|
commandLine 'git', 'tag',
|
|
'-m', "Release $modVersion for Minecraft $mcVersion",
|
|
"$mcVersion-$modVersion"
|
|
}
|
|
}
|
|
|
|
// Switch to master branch to update versions.json
|
|
project.exec { commandLine 'git', 'checkout', 'master' }
|
|
|
|
// Generate versions.json content
|
|
def versionsRoot = generateVersionsJson()
|
|
def versionsJson = JsonOutput.prettyPrint(JsonOutput.toJson(versionsRoot))
|
|
|
|
// Write versions.json
|
|
new File('versions.json').write(versionsJson)
|
|
|
|
// Commit changes
|
|
project.exec { commandLine 'git', 'add', 'versions.json' }
|
|
project.exec { commandLine 'git', 'commit', '-m', "Update versions.json for $version" }
|
|
|
|
// Return to previous branch
|
|
project.exec { commandLine 'git', 'checkout', '-' }
|
|
}
|
|
}
|
|
|
|
defaultTasks 'build'
|