gpt4 book ai didi

组装时Android-gradle更改属性文件

转载 作者:行者123 更新时间:2023-12-03 06:19:44 24 4
gpt4 key购买 nike

我读到了

ant.propertyfile(
file:"/projectPath/application.properties") {
entry(key:"app.name", value:'foo')
}
)

但我不知道如何将它应用于我的 assembleRelease 过程。

请问有什么帮助吗?

最佳答案

为调试与发布进行差异构建(差异属性值)的一种方法是:

sourceSets {

debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}

按 build-type 拆分源目录树,然后在那些现在绑定(bind)到 build type 的相应源文件中,您可以从“gradle-properties”文件中引用 diff 属性键:
configDbApiDebug=rc7
configDbRestDebug=Kw7
configDbApiProd=ovv
configDbRestProd=eoj

关于组装时Android-gradle更改属性文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27214524/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com