android-project/build.xml
changeset 6631 47ab7ba21530
parent 4965 91d0085b7560
equal deleted inserted replaced
6630:55910871076b 6631:47ab7ba21530
     1 <?xml version="1.0" encoding="UTF-8"?>
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project name="SDLApp" default="help">
     2 <!-- This should be changed to the name of your project -->
       
     3 <project name="SDLActivity" default="help">
     3 
     4 
     4     <!-- The local.properties file is created and updated by the 'android' tool.
     5     <!-- The local.properties file is created and updated by the 'android' tool.
     5          It contains the path to the SDK. It should *NOT* be checked in in Version
     6          It contains the path to the SDK. It should *NOT* be checked into
     6          Control Systems. -->
     7          Version Control Systems. -->
     7     <property file="local.properties" />
     8     <property file="local.properties" />
     8 
     9 
     9     <!-- The build.properties file can be created by you and is never touched
    10     <!-- The ant.properties file can be created by you. It is only edited by the
    10          by the 'android' tool. This is the place to change some of the default property values
    11          'android' tool to add properties to it.
    11          used by the Ant rules.
    12          This is the place to change some Ant specific build properties.
    12          Here are some properties you may want to change/update:
    13          Here are some properties you may want to change/update:
    13 
    14 
    14          application.package
       
    15              the name of your application package as defined in the manifest. Used by the
       
    16              'uninstall' rule.
       
    17          source.dir
    15          source.dir
    18              the name of the source directory. Default is 'src'.
    16              The name of the source directory. Default is 'src'.
    19          out.dir
    17          out.dir
    20              the name of the output directory. Default is 'bin'.
    18              The name of the output directory. Default is 'bin'.
    21 
    19 
    22          Properties related to the SDK location or the project target should be updated
    20          For other overridable properties, look at the beginning of the rules
    23           using the 'android' tool with the 'update' action.
    21          files in the SDK, at tools/ant/build.xml
    24 
    22 
    25          This file is an integral part of the build system for your application and
    23          Properties related to the SDK location or the project target should
    26          should be checked in in Version Control Systems.
    24          be updated using the 'android' tool with the 'update' action.
       
    25 
       
    26          This file is an integral part of the build system for your
       
    27          application and should be checked into Version Control Systems.
    27 
    28 
    28          -->
    29          -->
    29     <property file="build.properties" />
    30     <property file="ant.properties" />
    30 
    31 
    31     <!-- The default.properties file is created and updated by the 'android' tool, as well
    32     <!-- if sdk.dir was not set from one of the property file, then
    32          as ADT.
    33          get it from the ANDROID_HOME env var.
    33          This file is an integral part of the build system for your application and
    34          This must be done before we load project.properties since
    34          should be checked in in Version Control Systems. -->
    35          the proguard config can use sdk.dir -->
    35     <property file="default.properties" />
    36     <property environment="env" />
       
    37     <condition property="sdk.dir" value="${env.ANDROID_HOME}">
       
    38         <isset property="env.ANDROID_HOME" />
       
    39     </condition>
    36 
    40 
    37     <!-- Custom Android task to deal with the project target, and import the proper rules.
    41     <!-- The project.properties file is created and updated by the 'android'
    38          This requires ant 1.6.0 or above. -->
    42          tool, as well as ADT.
    39     <path id="android.antlibs">
       
    40         <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
       
    41         <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
       
    42         <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
       
    43         <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
       
    44         <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
       
    45     </path>
       
    46 
    43 
    47     <taskdef name="setup"
    44          This contains project specific properties such as project target, and library
    48         classname="com.android.ant.SetupTask"
    45          dependencies. Lower level build properties are stored in ant.properties
    49         classpathref="android.antlibs" />
    46          (or in .classpath for Eclipse projects).
    50 
    47 
    51     <!-- Execute the Android Setup task that will setup some properties specific to the target,
    48          This file is an integral part of the build system for your
    52          and import the build rules files.
    49          application and should be checked into Version Control Systems. -->
       
    50     <loadproperties srcFile="project.properties" />
    53 
    51 
    54          The rules file is imported from
    52     <!-- quick check on sdk.dir -->
    55             <SDK>/platforms/<target_platform>/templates/android_rules.xml
    53     <fail
       
    54             message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
       
    55             unless="sdk.dir"
       
    56     />
    56 
    57 
    57          To customize some build steps for your project:
    58     <!--
    58          - copy the content of the main node <project> from android_rules.xml
    59         Import per project custom build rules if present at the root of the project.
    59          - paste it in this build.xml below the <setup /> task.
    60         This is the place to put custom intermediary targets such as:
    60          - disable the import by changing the setup task below to <setup import="false" />
    61             -pre-build
       
    62             -pre-compile
       
    63             -post-compile (This is typically used for code obfuscation.
       
    64                            Compiled code location: ${out.classes.absolute.dir}
       
    65                            If this is not done in place, override ${out.dex.input.absolute.dir})
       
    66             -post-package
       
    67             -post-build
       
    68             -pre-clean
       
    69     -->
       
    70     <import file="custom_rules.xml" optional="true" />
    61 
    71 
    62          This will ensure that the properties are setup correctly but that your customized
    72     <!-- Import the actual build file.
    63          build steps are used.
    73 
       
    74          To customize existing targets, there are two options:
       
    75          - Customize only one target:
       
    76              - copy/paste the target into this file, *before* the
       
    77                <import> task.
       
    78              - customize it to your needs.
       
    79          - Customize the whole content of build.xml
       
    80              - copy/paste the content of the rules files (minus the top node)
       
    81                into this file, replacing the <import> task.
       
    82              - customize to your needs.
       
    83 
       
    84          ***********************
       
    85          ****** IMPORTANT ******
       
    86          ***********************
       
    87          In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
       
    88          in order to avoid having your file be overridden by tools such as "android update project"
    64     -->
    89     -->
    65     <setup />
    90     <!-- version-tag: 1 -->
       
    91     <import file="${sdk.dir}/tools/ant/build.xml" />
    66 
    92 
    67 </project>
    93 </project>