ADT插件会自动创建ant构建文件吗?
几个月前我创建了一个 Android 项目,现在必须使用 Hudson 自动化构建过程。 Android 开发指南提到了在生成项目时创建的 build.xml 文件 (http://developer.android.com/guide/developing/other-ide.html),但我在我的项目中没有看到。我必须手动创建它还是可以运行命令来生成它?
I created an Android project a few months ago and now have to automate the build process with Hudson. The Android dev guide mentions a build.xml file that gets created when you generate a project (http://developer.android.com/guide/developing/other-ide.html) but I dont see one in my project. Will I have to create this by hand or can I run a command to generate it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ADT 插件不会生成 Ant 文件。
当您通过调用
android create project
从命令行创建新项目时,android
命令将生成一个 Ant 文件。您可以创建一个示例项目并从该目录复制build.xml
、build.properties
和local.properties
文件。或者,您可以直接从
$ANDROID_HOME/tools/lib/build.template
复制build.xml
模板,然后更改项目名称。然后只需创建一个
build.properties
文件 - 您可以在其中放置任何 Ant 属性覆盖。此外,您还需要一个
local.properties
文件,但不要将其检查到源代码管理中 - 这是您通过设置sdk 指定
属性。$ANDROID_HOME
目录的位置。 dirThe ADT plugin doesn't generate an Ant file.
The
android
command will generate an Ant file when you create a new project from the command line by callingandroid create project
. You could create an example project and copy thebuild.xml
,build.properties
andlocal.properties
files from that directory.Alternatively, you can just copy the
build.xml
template directly from$ANDROID_HOME/tools/lib/build.template
then just change the project name.Then just create a
build.properties
file — it's where you place any Ant property overrides.Also you need a
local.properties
file, but don't check that into source control — this is where you specify your$ANDROID_HOME
directory by setting thesdk.dir
property.以下将生成一个 build.xml 文件以及一个 local.properties 文件(如果您的项目中不存在)。
android update project --path <项目目录的路径>
The following will generate a build.xml file as well as a local.properties file if one does not exist in your project.
android update project --path <path to your project directory>
您可以使用以下步骤:
$ android update project --path /path/to/my-项目
=>它将生成build.xml
和local.properties
创建文件:
ant.properties
,下面两行打开
build.xml
并根据需要重命名项目名称以
ant 构建方式运行
(调试、发布等...)You can use these steps below:
<path/to/android sdk/tools>
$ android update project --path /path/to/my-project
=> it will generatebuild.xml
andlocal.properties
Create file:
ant.properties
with two line belowOpen
build.xml
and rename project name if needRun as
ant build
(debug, release, etc...)