可变string.xml我有在String.xml访问Java或从摇篮
<string name="id">4</string>
一个字符串值,我有其中包含一个变量
public static int Id=1;
现在什么一类我需要的是我想要在Gradle中获取这两个值中的任何一个,它将检查条件并根据条件重命名我的应用程序。下面给出的是gradle这个代码的一部分
def identifier //here i need to get value from the java or xml
switch(identifier)
{
case 1:
temp="ApplicationNewName";break;
}
newName=newName.replace("-release",temp);
output.output.File=new File(output.outputFile.parent,newName);
我的问题是,我可以访问在gradle这个文件Java文件或XML字符串初始化变量?
考虑,解释你的代码是如何解答的问题。 –