android-project/build.xml
author Sam Lantinga <slouken@libsdl.org>
Fri, 02 Nov 2012 02:37:49 -0700
changeset 6631 47ab7ba21530
parent 4965 91d0085b7560
permissions -rw-r--r--
Updated the Android project template and README.android
Added information on how to customize your application name and icon.
Added information on using STL with an Android application
Increased the minimum API level to 10, because that's the lowest API
that currently has an emulator image for testing.
slouken@4965
     1
<?xml version="1.0" encoding="UTF-8"?>
slouken@6631
     2
<!-- This should be changed to the name of your project -->
slouken@6631
     3
<project name="SDLActivity" default="help">
slouken@4965
     4
slouken@4965
     5
    <!-- The local.properties file is created and updated by the 'android' tool.
slouken@6631
     6
         It contains the path to the SDK. It should *NOT* be checked into
slouken@6631
     7
         Version Control Systems. -->
slouken@4965
     8
    <property file="local.properties" />
slouken@4965
     9
slouken@6631
    10
    <!-- The ant.properties file can be created by you. It is only edited by the
slouken@6631
    11
         'android' tool to add properties to it.
slouken@6631
    12
         This is the place to change some Ant specific build properties.
slouken@4965
    13
         Here are some properties you may want to change/update:
slouken@4965
    14
slouken@4965
    15
         source.dir
slouken@6631
    16
             The name of the source directory. Default is 'src'.
slouken@4965
    17
         out.dir
slouken@6631
    18
             The name of the output directory. Default is 'bin'.
slouken@4965
    19
slouken@6631
    20
         For other overridable properties, look at the beginning of the rules
slouken@6631
    21
         files in the SDK, at tools/ant/build.xml
slouken@4965
    22
slouken@6631
    23
         Properties related to the SDK location or the project target should
slouken@6631
    24
         be updated using the 'android' tool with the 'update' action.
slouken@6631
    25
slouken@6631
    26
         This file is an integral part of the build system for your
slouken@6631
    27
         application and should be checked into Version Control Systems.
slouken@4965
    28
slouken@4965
    29
         -->
slouken@6631
    30
    <property file="ant.properties" />
slouken@4965
    31
slouken@6631
    32
    <!-- if sdk.dir was not set from one of the property file, then
slouken@6631
    33
         get it from the ANDROID_HOME env var.
slouken@6631
    34
         This must be done before we load project.properties since
slouken@6631
    35
         the proguard config can use sdk.dir -->
slouken@6631
    36
    <property environment="env" />
slouken@6631
    37
    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
slouken@6631
    38
        <isset property="env.ANDROID_HOME" />
slouken@6631
    39
    </condition>
slouken@4965
    40
slouken@6631
    41
    <!-- The project.properties file is created and updated by the 'android'
slouken@6631
    42
         tool, as well as ADT.
slouken@4965
    43
slouken@6631
    44
         This contains project specific properties such as project target, and library
slouken@6631
    45
         dependencies. Lower level build properties are stored in ant.properties
slouken@6631
    46
         (or in .classpath for Eclipse projects).
slouken@4965
    47
slouken@6631
    48
         This file is an integral part of the build system for your
slouken@6631
    49
         application and should be checked into Version Control Systems. -->
slouken@6631
    50
    <loadproperties srcFile="project.properties" />
slouken@4965
    51
slouken@6631
    52
    <!-- quick check on sdk.dir -->
slouken@6631
    53
    <fail
slouken@6631
    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."
slouken@6631
    55
            unless="sdk.dir"
slouken@6631
    56
    />
slouken@4965
    57
slouken@6631
    58
    <!--
slouken@6631
    59
        Import per project custom build rules if present at the root of the project.
slouken@6631
    60
        This is the place to put custom intermediary targets such as:
slouken@6631
    61
            -pre-build
slouken@6631
    62
            -pre-compile
slouken@6631
    63
            -post-compile (This is typically used for code obfuscation.
slouken@6631
    64
                           Compiled code location: ${out.classes.absolute.dir}
slouken@6631
    65
                           If this is not done in place, override ${out.dex.input.absolute.dir})
slouken@6631
    66
            -post-package
slouken@6631
    67
            -post-build
slouken@6631
    68
            -pre-clean
slouken@6631
    69
    -->
slouken@6631
    70
    <import file="custom_rules.xml" optional="true" />
slouken@4965
    71
slouken@6631
    72
    <!-- Import the actual build file.
slouken@6631
    73
slouken@6631
    74
         To customize existing targets, there are two options:
slouken@6631
    75
         - Customize only one target:
slouken@6631
    76
             - copy/paste the target into this file, *before* the
slouken@6631
    77
               <import> task.
slouken@6631
    78
             - customize it to your needs.
slouken@6631
    79
         - Customize the whole content of build.xml
slouken@6631
    80
             - copy/paste the content of the rules files (minus the top node)
slouken@6631
    81
               into this file, replacing the <import> task.
slouken@6631
    82
             - customize to your needs.
slouken@6631
    83
slouken@6631
    84
         ***********************
slouken@6631
    85
         ****** IMPORTANT ******
slouken@6631
    86
         ***********************
slouken@6631
    87
         In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
slouken@6631
    88
         in order to avoid having your file be overridden by tools such as "android update project"
slouken@4965
    89
    -->
slouken@6631
    90
    <!-- version-tag: 1 -->
slouken@6631
    91
    <import file="${sdk.dir}/tools/ant/build.xml" />
slouken@4965
    92
slouken@4965
    93
</project>