ghidra/gradle/support/loadApplicationProperties.gradle

31 lines
1.5 KiB
Groovy

/*****************************************************************************************
*
* Reads the Ghidra/application.properties file and sets properties for the version,
* release name, and distro prefix (ghidira_<version>)
*
*****************************************************************************************/
def ghidraProps = new Properties()
file("Ghidra/application.properties").withReader { reader ->
ghidraProps.load(reader)
version = ghidraProps.getProperty('application.version')
project.ext.RELEASE_VERSION = version
project.ext.RELEASE_NAME = ghidraProps.getProperty('application.release.name')
project.ext.JAVA_COMPILER = ghidraProps.getProperty('application.java.compiler')
project.ext.GRADLE_MINIMUM_VERSION = ghidraProps.getProperty('application.gradle.min')
project.ext.DISTRO_PREFIX = "ghidra_${version}_${RELEASE_NAME}"
// Build dates may or may not be already present in the application.properties file.
// If they are not present, we will set the dates so Gradle can use them, and we will
// indicate that the build dates need to be injected into the build's final
// application.properties file when it is copied.
project.ext.BUILD_DATE = ghidraProps.getProperty('application.build.date')
project.ext.BUILD_DATE_SHORT = ghidraProps.getProperty('application.build.date.short')
project.ext.BUILD_DATES_NEEDED = false
if (BUILD_DATE == null) {
project.ext.BUILD_DATE = getCurrentDateTimeLong()
project.ext.BUILD_DATE_SHORT = getCurrentDate()
project.ext.BUILD_DATES_NEEDED = true
}
}