build: only update version file when it changed

Avoids recompiling jme3-core on every build
define_list_fix
Kirill Vainer 9 years ago
parent c320c919a5
commit 74e398342f
  1. 18
      jme3-core/build.gradle

@ -17,9 +17,9 @@ sourceSets {
}
}
task updateVersionPropertiesFile << {
def verfile = file('src/main/resources/com/jme3/system/version.properties')
verfile.text = "# THIS IS AN AUTO-GENERATED FILE..\n" +
task updateVersionPropertiesFile {
def versionFile = file('src/main/resources/com/jme3/system/version.properties')
def versionFileText = "# THIS IS AN AUTO-GENERATED FILE..\n" +
"# DO NOT MODIFY!\n" +
"build.date=${jmeBuildDate}\n" +
"git.revision=${jmeRevision}\n" +
@ -31,9 +31,13 @@ task updateVersionPropertiesFile << {
"version.full=${jmeFullVersion}\n" +
"version.number=${jmeVersion}\n" +
"version.tag=${jmeVersionTag}"
}
compileJava.dependsOn(updateVersionPropertiesFile)
dependencies {
outputs.upToDateWhen {
versionFile.text == versionFileText
}
doLast {
versionFile.text = versionFileText
}
}
processResources.dependsOn updateVersionPropertiesFile
Loading…
Cancel
Save