请注意,如果您使用默认的Eclipse构建,它可能会在eclipse中使用特殊配置的“Ant”模块。您可以通过检查Eclipse/Prefs中的'Window/Preferences/Ant'部分来检查Eclipse/Ant的协调程度....
一个解决方案是使Eclipse/Ant的协作更加明确, 'build.xml'文件是项目的一部分(项目级构建文件,而不是从$ SDK/ROOT文件夹生成时复制的默认文件)。
请参阅here并阅读底部here的注释以更好地了解如何使用项目级别“build.xml”文件。
一旦你消化的是,该解决方案如下会更有意义......
--Solution--
修改版本和你“的build.xml”的调试节文件内容如下:
<!-- **************** Debug specific targets *************** -->
...
<target name="-set-debug-mode" depends="-setup">
...
<!-- API modify belo for build-typ -->
<copy file="config/strings.xml" todir="res/values">
<filterset>
<filter token="CONFIG.API" value="${config.db.api}"/>
<filter token="CONFIG.REST" value="${config.db.rest}"/>
</filterset>
</copy>
...
<!-- *************** Release specific targets ************** -->
...
<target name="-set-release-mode" depends="-set-mode-check">
...
<!-- API modify belo for build-typ -->
<copy file="config/strings.xml" todir="res/values">
<filterset>
<filter token="CONFIG.API" value="${config.db.api.prod}"/>
<filter token="CONFIG.REST" value="${config.db.rest.prod}"/>
</filterset>
</copy>
,并在你的根文件夹中的“ant.properties”文件,把属性值的API密钥和什么...
# API condition builds dev|prod in DB @parse.com
config.db.api=some_key_val
config.db.rest=some_k2_val
config.db.api.prod=some_k3_val
config.db.rest.prod=some_k4_val
而且在资源XML是的“复制”目标的构建命令绑在一起,它...
'config/strings.xml'
<string name="default_value_parse_key_appId">@[email protected]</string>
<string name="default_value_parse_key_rest">@[email protected]</string>
您使用的是什么样的构建系统? (maven,ant,gradle ...) – Fredszaq
无论日食使用:) – ericosg