ADT插件会自动创建ant构建文件吗?

发布于 2024-08-25 03:46:07 字数 288 浏览 2 评论 0原文

几个月前我创建了一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

天暗了我发光 2024-09-01 03:46:07

ADT 插件不会生成 Ant 文件。

当您通过调用 android create project 从命令行创建新项目时,android 命令将生成一个 Ant 文件。您可以创建一个示例项目并从该目录复制 build.xmlbuild.propertieslocal.properties 文件。

或者,您可以直接从 $ANDROID_HOME/tools/lib/build.template 复制 build.xml 模板,然后更改项目名称。

然后只需创建一个 build.properties 文件 - 您可以在其中放置任何 Ant 属性覆盖。
此外,您还需要一个 local.properties 文件,但不要将其检查到源代码管理中 - 这是您通过设置 sdk 指定 $ANDROID_HOME 目录的位置。 dir 属性。

The 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 calling android create project. You could create an example project and copy the build.xml, build.properties and local.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 the sdk.dir property.

假装不在乎 2024-09-01 03:46:07

以下将生成一个 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>

不再让梦枯萎 2024-09-01 03:46:07

您可以使用以下步骤:

  • 打开命令行
  • 转到:
  • 运行:$ android update project --path /path/to/my-项目 =>它将生成 build.xmllocal.properties
  • 创建文件:ant.properties,下面两行

    key.store=路径/to/keystore
    key.alias=别名
    
  • 打开 build.xml 并根据需要重命名项目名称

  • ant 构建方式运行(调试、发布等...)

You can use these steps below:

  • Open command line
  • Go to: <path/to/android sdk/tools>
  • Run: $ android update project --path /path/to/my-project => it will generate build.xml and local.properties
  • Create file: ant.properties with two line below

    key.store=path/to/keystore
    key.alias=alias name
    
  • Open build.xml and rename project name if need

  • Run as ant build (debug, release, etc...)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文