如何在 Eclipse 中的同一工作区下为多个项目创建 ANT 文件?
考虑过使用 Jenkins,但 Jenkins 在每个项目中使用 Ant Emulator 插件创建了一个 build.xml 文件,并且不允许我在构建时直接插入我的 keystore 参数。
我的想法是,最终我希望我工作区中的所有项目都使用自动化工具进行签名。
谢谢!
最佳答案
在 Eclipse 中,在 Package Explorer View 中,选择您的项目,然后右键单击 ==> Export,选择“General > Ant Buildfiles”。在下一个对话框中,选中或取消选中您的选项,然后单击“完成”,将为每个选定的项目生成一个 build.xml 文件。
那么您所需要的只是一个 build.xml,它将为所有项目调用 Ant 构建,如下所示:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project basedir="." default="build-all" name="all-projects">
<target description="Build all projects" name="build-all">
<ant antfile="build.xml" target="build-project" dir="./MyProject1" inheritAll="false"/>
<ant antfile="build.xml" target="build-project" dir="./MyProject2" inheritAll="false"/>
...
<ant antfile="build.xml" target="build-project" dir="./MyProjectN" inheritAll="false"/>
</target>
</project>
关于android - 为工作区中的每个项目创建 ant build.xml 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21532620/