mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-04 07:17:19 +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 = {
|
||||
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 {
|
||||
|
@ -9,29 +9,6 @@ project.ext.assetsDir = new File("../core/assets")
|
||||
def PACKR_DIR = "$System.env.PACKR_DIR"
|
||||
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 = {
|
||||
if (project.hasProperty("platform")) {
|
||||
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
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
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
|
||||
|
@ -31,6 +31,8 @@ task dist(type: Jar) {
|
||||
from files(sourceSets.main.output.resourcesDir)
|
||||
from {configurations.compile.collect {zipTree(it)}}
|
||||
from files(project.assetsDir);
|
||||
|
||||
writeVersion()
|
||||
|
||||
manifest {
|
||||
attributes 'Main-Class': project.mainClassName
|
||||
|
Reference in New Issue
Block a user