FINERACT-1166: Fix build to work outside git repository

This commit is contained in:
Petri Tuomola
2020-10-03 16:24:47 +02:00
committed by Michael Vorburger ⛑️
parent 0bc246b6b3
commit 20bf4d6939
+12 -2
View File
@@ -201,11 +201,16 @@ import org.apache.tools.ant.filters.ReplaceTokens
task prepareInputYaml(dependsOn: 'generateGitProperties') {
doLast {
if(project.ext.properties.containsKey("gitProps"))
version = project.ext.gitProps['git.commit.id.describe']
else
version = "unknown"
copy {
from file('config/swagger/fineract-input.yaml.template')
into file('config/swagger')
rename { String filename -> return 'fineract-input.yaml' }
filter(ReplaceTokens, tokens: [VERSION: project.ext.gitProps['git.commit.id.describe']])
filter(ReplaceTokens, tokens: [VERSION: version])
}
}
}
@@ -955,11 +960,16 @@ dependencies {
task prepareConfigJson(dependsOn: 'generateGitProperties') {
doLast {
if(project.ext.properties.containsKey("gitProps"))
version = project.ext.gitProps['git.commit.id.describe']
else
version = "unknown"
copy {
from file('config/swagger/config.json.template')
into file('config/swagger')
rename { String filename -> return 'config.json' }
filter(ReplaceTokens, tokens: [VERSION: project.ext.gitProps['git.commit.id.describe']])
filter(ReplaceTokens, tokens: [VERSION: version])
}
}
}