update build.xml
authorNikita Kozlov <nikita@elyzion.net>
Fri, 27 Jan 2012 11:31:23 +0100
changeset 930ea7b1aeb5980
parent 929 4d171bf7378a
child 931 067387e7ab43
update build.xml
build.xml
     1.1 --- a/build.xml	Thu Jan 26 16:43:44 2012 +0100
     1.2 +++ b/build.xml	Fri Jan 27 11:31:23 2012 +0100
     1.3 @@ -1,82 +1,101 @@
     1.4  <?xml version="1.0" encoding="UTF-8"?>
     1.5 -<project name="Beem">
     1.6 +<project name="Beem" default="help">
     1.7  
     1.8      <!-- The local.properties file is created and updated by the 'android' tool.
     1.9 -         It contain the path to the SDK. It should *NOT* be checked in in Version
    1.10 -         Control Systems. -->
    1.11 +         It contains the path to the SDK. It should *NOT* be checked into
    1.12 +         Version Control Systems. -->
    1.13      <property file="local.properties" />
    1.14  
    1.15 -    <!-- The build.properties file can be created by you and is never touched
    1.16 -         by the 'android' tool. This is the place to change some of the default property values
    1.17 -         used by the Ant rules.
    1.18 +    <!-- The ant.properties file can be created by you. It is only edited by the
    1.19 +         'android' tool to add properties to it.
    1.20 +         This is the place to change some Ant specific build properties.
    1.21           Here are some properties you may want to change/update:
    1.22  
    1.23 -         application.package
    1.24 -             the name of your application package as defined in the manifest. Used by the
    1.25 -             'uninstall' rule.
    1.26           source.dir
    1.27 -             the name of the source directory. Default is 'src'.
    1.28 +             The name of the source directory. Default is 'src'.
    1.29           out.dir
    1.30 -             the name of the output directory. Default is 'bin'.
    1.31 +             The name of the output directory. Default is 'bin'.
    1.32  
    1.33 -         Properties related to the SDK location or the project target should be updated
    1.34 -          using the 'android' tool with the 'update' action.
    1.35 +         For other overridable properties, look at the beginning of the rules
    1.36 +         files in the SDK, at tools/ant/build.xml
    1.37  
    1.38 -         This file is an integral part of the build system for your application and
    1.39 -         should be checked in in Version Control Systems.
    1.40 +         Properties related to the SDK location or the project target should
    1.41 +         be updated using the 'android' tool with the 'update' action.
    1.42 +
    1.43 +         This file is an integral part of the build system for your
    1.44 +         application and should be checked into Version Control Systems.
    1.45  
    1.46           -->
    1.47 -    <property file="build.properties" />
    1.48 +    <property file="ant.properties" />
    1.49  
    1.50 -    <!-- The default.properties file is created and updated by the 'android' tool, as well
    1.51 -         as ADT.
    1.52 -         This file is an integral part of the build system for your application and
    1.53 -         should be checked in in Version Control Systems. -->
    1.54 -    <property file="default.properties" />
    1.55 +    <!-- The project.properties file is created and updated by the 'android'
    1.56 +         tool, as well as ADT.
    1.57  
    1.58 -    <!-- Custom Android task to deal with the project target, and import the proper rules.
    1.59 -         This requires ant 1.6.0 or above. -->
    1.60 -    <path id="android.antlibs">
    1.61 -        <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
    1.62 -        <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
    1.63 -        <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
    1.64 -        <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
    1.65 -        <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
    1.66 -    </path>
    1.67 +         This contains project specific properties such as project target, and library
    1.68 +         dependencies. Lower level build properties are stored in ant.properties
    1.69 +         (or in .classpath for Eclipse projects).
    1.70  
    1.71 -    <taskdef name="setup"
    1.72 -        classname="com.android.ant.SetupTask"
    1.73 -        classpathref="android.antlibs" />
    1.74 -
    1.75 -    <!-- Execute the Android Setup task that will setup some properties specific to the target,
    1.76 -         and import the build rules files.
    1.77 -
    1.78 -         The rules file is imported from
    1.79 -            <SDK>/platforms/<target_platform>/templates/android_rules.xml
    1.80 -
    1.81 -         To customize some build steps for your project:
    1.82 -         - copy the content of the main node <project> from android_rules.xml
    1.83 -         - paste it in this build.xml below the <setup /> task.
    1.84 -         - disable the import by changing the setup task below to <setup import="false" />
    1.85 -
    1.86 -         This will ensure that the properties are setup correctly but that your customized
    1.87 -         build steps are used.
    1.88 -    -->
    1.89 -    <setup />
    1.90 +         This file is an integral part of the build system for your
    1.91 +         application and should be checked into Version Control Systems. -->
    1.92 +    <loadproperties srcFile="project.properties" />
    1.93  
    1.94      <property name="javadoc.output" value="doc/javadoc" />
    1.95 +
    1.96 +    <!-- quick check on sdk.dir -->
    1.97 +    <fail
    1.98 +            message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
    1.99 +            unless="sdk.dir"
   1.100 +    />
   1.101 +
   1.102 +
   1.103 +<!-- extension targets. Uncomment the ones where you want to do custom work
   1.104 +     in between standard targets -->
   1.105 +<!--
   1.106 +    <target name="-pre-build">
   1.107 +    </target>
   1.108 +    <target name="-pre-compile">
   1.109 +    </target>
   1.110 +
   1.111 +    /* This is typically used for code obfuscation.
   1.112 +       Compiled code location: ${out.classes.absolute.dir}
   1.113 +       If this is not done in place, override ${out.dex.input.absolute.dir} */
   1.114 +    <target name="-post-compile">
   1.115 +    </target>
   1.116 +-->
   1.117 +
   1.118 +    <target name="-pre-clean" >
   1.119 +        <delete dir="${javadoc.output}" verbose="${verbose}" />
   1.120 +    </target>
   1.121 +
   1.122 +    <!-- Import the actual build file.
   1.123 +
   1.124 +         To customize existing targets, there are two options:
   1.125 +         - Customize only one target:
   1.126 +             - copy/paste the target into this file, *before* the
   1.127 +               <import> task.
   1.128 +             - customize it to your needs.
   1.129 +         - Customize the whole content of build.xml
   1.130 +             - copy/paste the content of the rules files (minus the top node)
   1.131 +               into this file, replacing the <import> task.
   1.132 +             - customize to your needs.
   1.133 +
   1.134 +         ***********************
   1.135 +         ****** IMPORTANT ******
   1.136 +         ***********************
   1.137 +         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
   1.138 +         in order to avoid having your file be overridden by tools such as "android update project"
   1.139 +    -->
   1.140 +    <!-- version-tag: custom -->
   1.141 +    <import file="${sdk.dir}/tools/ant/build.xml" />
   1.142 +
   1.143      <property name="external.libs.dir" value="libs" />
   1.144  
   1.145 -    <target name="clean"
   1.146 -	description="Delete old build and dist directories">
   1.147 -	<delete verbose="false" dir="${out.dir}"/>
   1.148 -	<delete verbose="false" dir="gen"/>
   1.149 -    </target>
   1.150 -
   1.151 -    <target name="all" depends="clean,debug,javadoc"/>
   1.152 -
   1.153 -    <target name="javadoc">
   1.154 -	<javadoc author="true" destdir="${javadoc.output}" doctitle="Beem javadoc" source="1.6" sourcepath="${source.dir}" use="true" version="false" bootclasspathref="android.target.classpath">
   1.155 +    <target name="javadoc" depends="-setup, -build-setup, -code-gen">
   1.156 +	<javadoc author="true" destdir="${javadoc.output}" doctitle="Beem javadoc" source="1.6" use="true" version="false" bootclasspathref="android.target.classpath">
   1.157 +	    <sourcepath>
   1.158 +	    	<pathelement location="${source.dir}" />
   1.159 +	    	<pathelement location="${gen.absolute.dir}" />
   1.160 +	    </sourcepath>
   1.161  	    <classpath>
   1.162  		<fileset dir="${external.libs.dir}" includes="*.jar" />
   1.163  	    </classpath>