Use Properties from the root project in the subprojects


I have a multi-project environment. In the root project I get the patchlevel from a file I would then use these in the subprojects to generate the versionProperty

root build.gradle

task readversionInfo() {
	def versionPropsFile = file('')
    if (versionPropsFile.canRead()) {
        def Properties versionProps = new Properties()
        versionProps.load(new FileInputStream(versionPropsFile))

        ext.patchlevel = versionProps['PATCHLEVEL'].toInteger() + 1
        versionProps['PATCH'] = patchlevel.toString(), null)
    } else {
        throw new GradleException("Could not read!")

build.gradle Subproject

if (project.hasProperty("patchlevel")	{
	println "Patchlevel is set"
	version = "${moduleversion}.${ext.patchlevel}.${}"
} else	{
	println "Patchlevel is not set"
	version = "${moduleversion}.0.${}"