android ant -预编译与预构建
我正在开发一个 android 项目,我们用 ant 构建我们的版本。在更改代码中的 versionName
和其他一些标志时,我们使用 Android-ant 目标 -pre-compile
。您还可以使用 -pre-build
android-ant 目标。
有谁知道这两个目标之间的区别?
I'm working on an android project where we build our releases with ant. We use the Android-ant target -pre-compile
when changing the versionName
and some other flags in the code. There is also a -pre-build
android-ant target you can use.
Does anyone know the difference between those two targets?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 SDK 的 ant tools 文件夹中的 build.xml,我们发现:
-pre-compile 和 -pre-build 默认情况下都是空目标,因此不执行任何操作。唯一的区别是 -pre-build 将在 -code-gen (不为空)之前运行,而 -pre-compile 在其之后运行。
Looking at the build.xml in the SDK's ant tools folder we have:
Both -pre-compile and -pre-build are empty targets by default and therefore do nothing. The only difference is that -pre-build will run before -code-gen (which is not empty), whilst -pre-compile runs after it.
预编译通常用于预处理目的,但没有人会真正愿意再使用这些 J2ME 技术。
例如,预构建可以是检查资源的地方。
Pre compile is often used for preprocessing purposes but no one would really want to live with those J2ME techs anymore.
Prebuild could be the place for checking your resources for instance.