android - 将编译器标志添加到标准的 android build.xml

标签 android ant

我想在构建 android 应用程序时将 -Xlint:deprecated 添加到 java 编译器。
我在 javac 标签中看到了 compilerarg 标签,但是为标准项目生成的 build.xml 没有这样的标签。 有什么提示吗?

最佳答案

完整的构建脚本位于 YOUR_SDK_FOLDER/platforms/SDKVERSION/templates/android_rules.xml

您使用此文件的副本修改您的 build.xml 并自定义它。不确定它是否会到达您想要的位置 - 但这是一个开始

<!-- Execute the Android Setup task that will setup some properties specific to the target,
             and import the rules files.
             To customize the rules, copy/paste them below the task, and disable import by setting
             the import attribute to false:
                <setup import="false" />

             This will ensure that the properties are setup correctly but that your customized
             targets are used.
        -->

关于android - 将编译器标志添加到标准的 android build.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2852254/

相关文章:

java - 如何从一台机器针对另一台机器运行ant脚本?

maven-2 - 现有 Ant 构建文件的简单 Mavenization

java - 用于构建 Protocol Buffer 文件的 Ant 目标

C# 如何添加一个ListView ClickListener

java - Android UI 测试崩溃但应用运行正常

java - 如何在 android studio 中找到数组中项目的编号?

android - 如何使用 ant 在设备上运行 android 应用程序

android - Dex 无法在新的 Android 平台工具 (V8) 上处理路径中的空格

android - Phonegap/Cordova 不显示启动画面

安卓开发: [HOW TO] intercept daily alarm and dismiss programmatically