2024-11-11 10:49:11 +00:00
|
|
|
File templatesFolder = new File("$rootProject.projectDir.absolutePath${File.separatorChar}gradle${File.separatorChar}templates")
|
|
|
|
|
|
|
|
Map properties = new HashMap<String, String>()
|
|
|
|
|
|
|
|
if (templatesFolder.exists() && templatesFolder.isDirectory()) {
|
|
|
|
templatesFolder.listFiles().each {
|
|
|
|
properties[it.name - ".gradle"] = it.absolutePath
|
|
|
|
}
|
|
|
|
}
|
2020-12-02 15:50:52 +00:00
|
|
|
|
2024-11-11 10:49:11 +00:00
|
|
|
properties["projectByName"] = { name ->
|
|
|
|
for (subproject in rootProject.subprojects) {
|
|
|
|
if (subproject.name == name) {
|
|
|
|
return subproject
|
2020-12-02 15:50:52 +00:00
|
|
|
}
|
2024-11-11 10:49:11 +00:00
|
|
|
}
|
|
|
|
return null
|
|
|
|
}
|
2020-12-02 15:50:52 +00:00
|
|
|
|
2024-11-11 10:49:11 +00:00
|
|
|
properties["internalProject"] = { name ->
|
|
|
|
projectByName("$name")
|
|
|
|
}
|
2020-12-02 15:50:52 +00:00
|
|
|
|
2024-11-11 10:49:11 +00:00
|
|
|
allprojects {
|
|
|
|
ext {
|
|
|
|
releaseMode = (project.hasProperty('RELEASE_MODE') && project.property('RELEASE_MODE') == "true") || System.getenv('RELEASE_MODE') == "true"
|
2020-12-02 15:50:52 +00:00
|
|
|
|
2024-11-11 10:49:11 +00:00
|
|
|
properties.forEach { k, v ->
|
|
|
|
it[k] = v
|
|
|
|
}
|
2020-12-02 15:50:52 +00:00
|
|
|
}
|
|
|
|
}
|