Reputation: 109
I am trying to concat the value which is there in my version.properties
file but it is not concatenating to the value in my build.gradle
file.
Below is my code snippet.
task dist(type: Zip) {
baseName = 'ml'
appendix = 'cicd'
def props = new Properties()
file("version.properties").withInputStream { props.load(it)
into("${baseName}-${appendix}-${version}-${props.getProperty("VERSION_BUILD")}")
}
Upvotes: 1
Views: 795
Reputation: 7600
You can't have the same type of quotation mark inside a quoted string. Either move the code in the GString to a variable outside, escape the quotes or use single quotes inside the double quotes. I find the first approach more readable.
def versionBuild = props.getProperty("VERSION_BUILD")
into("${baseName}-${appendix}-${version}-${versionBuild}")
Upvotes: 2