记录
请教GcsSloop,感谢解惑
Android Gradle文件下获取自定义properties文件,并且获取值或者修改值
如下getui.properties
为自定义的properties文件,默认取当前Module下路径,若是在工程下寻找这样的文件路径rootProject.getRootDir().getAbsolutePath() + "/getui.properties"
groovy
def getGeTui() {
File propFile = file("getui.properties")
if (propFile.exists()) {
def Properties props = new Properties()
props.load(new FileInputStream(propFile))
//修改getui.properties文件下GETUI的值为'xxxxxxxx'
props['GETUI'] = "xxxxxxxx"
propFile.setWritable(true)
props.store(new FileOutputStream(propFile), "")
//获取值
return props['GETUI']
} else {
return "No File"
}
}
最后构建的时候,主App的和底层Library的debug release的执行的顺序,或者说合并的顺序?