build: check file exists before getting text

Conflicts:
	jme3-core/build.gradle
cleanup_build_scripts
Kirill Vainer 9 years ago
parent 804c173757
commit 7d4a34f96f
  1. 15
      jme3-core/build.gradle

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

Loading…
Cancel
Save