Open pun-ky opened 5 years ago
How do you read the version.properties in gradle? I think it's now parsed by default. You configured the release plugin with the file to use but it is not configuring the project for you. The gradle.properties is always parsed by gradle and the project.version is set. If you move the version out into another properties file you have to parse it and set the project.version on your own. The configuration of release {} is only there to tell the release plugin where and what must be changed to update the version.
Ok. I know that however I was suspecting that you might want to handle that case. It is not trivial that one change / customizing properties file affects version not set to projects.
The release plugin can handle the version to be somewhere else but like I said it's just gradle that needs to know too. The problem here is that you still expect the project.version to be set but this is a gradle internal thing and if you want to have custom like that you need to do a bit more like loading that properties file in your build.gradle.
See this https://stackoverflow.com/a/37101792/1372349 how to load them easily
You can then do
project.version = props.getProperty("version")
in your build gradle. I would do this at the very beginning that it is set as early as possible.
apply from properties file is not available when using kotlin dsl. I will ask gradle team about that missing feature available in groovy dsl. Yep I can load it by myself but it will not look so good...
how about second question
release { afterEvaluate { buildTasks = listOf(":aem:assembly:full:build") } }
plugin could internally do afterEvaluate
... so that release plugin DSL will look more nice in case of referencing subproject task
Hi!
ends with
however if I put version to
gradle.properties
file andthen the version is set correctly. why customizing versionPropertyFile property is not affecting version applied to project?
second thing, I need to wrap setting buildTasks into
afterEvaluate
to avoidyes it is pointing to subproject intentionally. should that be also supported without a need of wrapping into
afterEvaluate
?