mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-05 07:47:48 +07:00
Made server write version on build
This commit is contained in:
23
build.gradle
23
build.gradle
@ -42,6 +42,29 @@ allprojects {
|
|||||||
getPackage = {
|
getPackage = {
|
||||||
return project.ext.mainClassName.substring(0, project.ext.mainClassName.indexOf("desktop") - 1)
|
return project.ext.mainClassName.substring(0, project.ext.mainClassName.indexOf("desktop") - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
writeVersion = {
|
||||||
|
def pfile = new File('core/assets/version.properties')
|
||||||
|
def props = new Properties()
|
||||||
|
|
||||||
|
try{
|
||||||
|
pfile.createNewFile()
|
||||||
|
}catch (Exception e){}
|
||||||
|
|
||||||
|
if(pfile.exists()) {
|
||||||
|
|
||||||
|
props.load(new FileInputStream(pfile))
|
||||||
|
|
||||||
|
String code = getBuildVersion()
|
||||||
|
|
||||||
|
props["name"] = appName
|
||||||
|
props["version"] = versionType
|
||||||
|
props["code"] = versionNumber
|
||||||
|
props["build"] = code
|
||||||
|
|
||||||
|
props.store(pfile.newWriter(), "Autogenerated file. Do not modify.")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -9,29 +9,6 @@ project.ext.assetsDir = new File("../core/assets")
|
|||||||
def PACKR_DIR = "$System.env.PACKR_DIR"
|
def PACKR_DIR = "$System.env.PACKR_DIR"
|
||||||
def ICON_DIR = new File("core/assets/sprites/icon.icns")
|
def ICON_DIR = new File("core/assets/sprites/icon.icns")
|
||||||
|
|
||||||
ext.writeVersion = {
|
|
||||||
def pfile = new File('core/assets/version.properties')
|
|
||||||
def props = new Properties()
|
|
||||||
|
|
||||||
try{
|
|
||||||
pfile.createNewFile()
|
|
||||||
}catch (Exception e){}
|
|
||||||
|
|
||||||
if(pfile.exists()) {
|
|
||||||
|
|
||||||
props.load(new FileInputStream(pfile))
|
|
||||||
|
|
||||||
String code = getBuildVersion()
|
|
||||||
|
|
||||||
props["name"] = appName
|
|
||||||
props["version"] = versionType
|
|
||||||
props["code"] = versionNumber
|
|
||||||
props["build"] = code
|
|
||||||
|
|
||||||
props.store(pfile.newWriter(), "Autogenerated file. Do not modify.")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ext.getPlatform = {
|
ext.getPlatform = {
|
||||||
if (project.hasProperty("platform")) {
|
if (project.hasProperty("platform")) {
|
||||||
def lc = platform.toLowerCase()
|
def lc = platform.toLowerCase()
|
||||||
|
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,6 @@
|
|||||||
|
#Thu May 03 13:02:25 EDT 2018
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
|
||||||
|
@ -32,6 +32,8 @@ task dist(type: Jar) {
|
|||||||
from {configurations.compile.collect {zipTree(it)}}
|
from {configurations.compile.collect {zipTree(it)}}
|
||||||
from files(project.assetsDir);
|
from files(project.assetsDir);
|
||||||
|
|
||||||
|
writeVersion()
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Main-Class': project.mainClassName
|
attributes 'Main-Class': project.mainClassName
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user