How can I define a property and set it in a specific buildType?
I have already tried this:
android {
project.ext.set("apis", "[]")
buildTypes {
release {
...
project.apis = [
[
name : "aaaa",
apiJson: "aaaa",
baseUrl: "aaaa"
],
[
name : "bbbb",
apiJson: "bbbb",
baseUrl: "bbbb"
]
]
}
debug{
...
project.apis = [
[
name : "cccc",
apiJson: "cccc",
baseUrl: "cccc"
],
[
name : "dddd",
apiJson: "dddd",
baseUrl: "dddd"
]
]
}
}
func(apis)
}
From this, "api", always has the values of the last block. How can I dynamically set a property related to my current buildType until Gradle builds?
i solved it in this way: