mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-22 21:19:46 +00:00
Gradle script automatically updates update.json
This commit is contained in:
2 files changed
+22
-8
No files matched your search
+20
-6
@@ -1,3 +1,6 @@
|
||||
import groovy.json.JsonSlurper
|
||||
import groovy.json.JsonOutput
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -115,8 +118,22 @@ task incrementBuildNumber(dependsOn: 'reobfJar') << {
|
||||
|
||||
file('web/versions.ini').append("\n${version}=${minecraft.version}")
|
||||
file("${config.dir_repo}/version/${minecraft.version}.txt").write("${version}")
|
||||
|
||||
def updateJsonFile = file('version/update.json')
|
||||
def updateJson = new JsonSlurper().parse(updateJsonFile) as Map
|
||||
|
||||
// Add to version section
|
||||
updateJson."${minecraft.version}"."${version}" = "See https://github.com/williewillus/Botania/releases/${version}"
|
||||
|
||||
// Update promos
|
||||
updateJson.promos."${minecraft.version}-latest" = "${version}"
|
||||
updateJson.promos."${minecraft.version}-recommended" = "${version}"
|
||||
|
||||
|
||||
updateJsonFile.write(JsonOutput.prettyPrint(JsonOutput.toJson(updateJson)))
|
||||
}
|
||||
|
||||
/* Unused - Forgecraft and web server stuff
|
||||
// I have no idea what I'm doing
|
||||
task wtfGradle2(type: Copy) {
|
||||
from(jar.destinationDir)
|
||||
@@ -154,9 +171,7 @@ task sort(type: Delete) {
|
||||
delete "${config.dir_output}/${deobfJar.archiveName}", "${config.dir_output}/wtf"
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the upload task from the build.xml
|
||||
*/
|
||||
// This is the upload task from the build.xml
|
||||
task upload() << {
|
||||
scp('/files') {
|
||||
fileset(file: jar.archivePath)
|
||||
@@ -172,9 +187,7 @@ task upload() << {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is deply_web task
|
||||
*/
|
||||
// This is deploy_web task
|
||||
task deployWeb << {
|
||||
scp('/') {
|
||||
fileset(dir: 'web') //everything from the web directory
|
||||
@@ -202,6 +215,7 @@ def scp(String dir, Closure antFileset = {}) {
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
def parseConfig(File config) {
|
||||
config.withReader {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#Mon Sep 14 12:28:28 PDT 2015
|
||||
#Sat May 28 11:56:22 CDT 2016
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-all.zip
|
||||
Reference in new issue
Block a user