Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does the ADT plugin automatically create an ant build file?

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?

like image 955
Eno Avatar asked Mar 17 '10 18:03

Eno


People also ask

How do you trigger an Ant build?

To run the ant build file, open up command prompt and navigate to the folder, where the build. xml resides, and then type ant info. You could also type ant instead. Both will work,because info is the default target in the build file.

Which target is run as default in build xml file?

The project name is “test” defined by attribute “name”; default target is “all” while running “ant” command from command prompt if we don't specify any target than ant executed this default target.


2 Answers

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.

like image 158
Christopher Orr Avatar answered Nov 15 '22 08:11

Christopher Orr


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>

like image 45
Alex Avatar answered Nov 15 '22 08:11

Alex