【发布时间】:2012-01-21 15:18:30
【问题描述】:
这 4 个文件(build.xml、local.properties、projects.properties、proguard.cfg)是在运行时自动生成的:
android 更新项目 --name TestApp --target 10 -p .
更新了 project.properties
更新了 local.properties
添加文件 ./build.xml
更新文件 ./proguard.cfg
但我希望“auto-gen”build.xml 也包含以下“预编译”代码,有没有办法做到这一点?是否有一些“包含”文件或“模板”文件可以包含它?
<target name="config">
<property name="config-target-path" value="${source.dir}/com/androidengineer/antbuild"/>
<!-- Copy the configuration file, replacing tokens in the file. -->
<copy file="config/Config.java" todir="${config-target-path}"
overwrite="true" encoding="utf-8">
<filterset>
<filter token="CONFIG.LOGGING" value="${config.logging}"/>
</filterset>
</copy>
</target>
【问题讨论】:
-
尝试将该代码粘贴到您的 build.xml 中,然后修改“编译”目标(可能是另一个名称),例如
... -
嗨,我的意思是“build.xml”是在运行“android update”时自动生成的。我不能在那里粘贴该代码。这是我的问题,我想知道我是否可以将该代码粘贴到其他地方,但在“android 更新”运行时仍然能够包含在内。
-
build.xml生成后会立即运行吗?
-
可能会延迟,但是是的,现在它在生成后立即运行。