views:

118

answers:

2

I want to know if we can create builds using ant's build.xml and when i'm trying to do this an error is displayed SDK location not mentioned and besides that I'm unable to find local.properties file to mention the SDK Location

My aim is that I want to use my exiting code and make a build for new Android SDK's with changes in the resources and and some constant values is this task Possible with making a build using Ant and if by some other way.

I have no idea about Ant and its functioning so it would very appreciable if minute details are also provided.

A: 

Well, first thing to do is get some knowledge on Ant, you'll need it to be effective. Just do a google for Ant tutorials.

For Android builds, create a sample project using the android command line (use android --help to see all options):

android create project -n SampleProject -t 7 -p ./sample -k com.sample -a MainActivity

This will generate a sample any build script that you can use as a starting point. To really understand how Android uses Ant, you'll want to take a look at the "android_rules.xml" file located at:

<android-install-dir>/platforms/<any-platform>/templates/android_rules.xml

This file has the definition for all the Ant targets used to build an android project. You can use those targets in your extension of the build.xml file that gets generated when you create the sample project

keno
A: 

I had the same problem. I wrote a set of instructions for using an existing Ant build script for an Android project. Read this article: http://www.disgruntledrats.com/?p=27

Let me know if you have further questions. It's a bit of a hack, but it lets you have a custom directory structure and specify how your compiles are done.

mike boldischar