I've generated ant build.xml for my android project, using android update project --name <project_name> --target <target_ID> --path path/to/your/project/
(according to http://developer.android.com/guide/developing/other-ide.html) and then modified my build.xml (some custom code is there). So my build.xml is in the VCS.
But in order to perform a build I need local.properties file, which is also generated by android update project
and so build.xml gets overwritten.
local.properties is not to be checked into the VCS.
Is there a way to only generate the local.properties so that developers (or a build server) can check out the code and build the project using build.xml from VCS?
Thanks!
The 'basedir' is the base directory from which any relative directories used within the Ant build file are referenced from. If this is omitted the parent directory of the build file will be used.
Create Ant build fileIn the Project tool window, select the directory, where the build file should be created. Right-click the directory and from the context menu, select New | File ( Alt+Insert ). In the New File dialog, specify the name of the new file with the xml extension, for example, build. xml.
How do I write build. xml file? here is a sample build. xml you just need to know important element e.g. project ,target ,property and task and the order in which different target gets executed to start with basic build procedure.
Do not put local.properties into the VCS: generate it whenever it does not exist already (after a clean checkout, for instance), by running
android update project -p .
so android can generate it with the right path to the sdk. ant.properties or project.properties are meant to be put in VCS with whatever you need fixed on every possible build environment.
If you do not want the build.xml to be modified, change the version-tag entry to something different to its default value, which is 1. For instance:
<!-- version-tag: custom -->
If you have a look at the build.xml comments, it states that by saying:
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
Given that it (in general) only contains a single property, sdk.dir
, pointing to the developer's Android SDK root, I'm inclined to say that it's not asking too much for the developers to just create it by hand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With