build.xml
author Da Risk <darisk972@gmail.com>
Thu, 12 Mar 2009 23:45:49 +0100
changeset 11 20a2c2b04060
parent 7 c2941cee7327
child 54 dfbb0fbece57
permissions -rw-r--r--
Transform FileSender in a server
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     1
<?xml version="1.0" ?>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     2
<project name="Beem" default="debug">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     3
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     4
    <!-- The build.properties file can be created by you and is never touched
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     5
         by activitycreator. If you want to manually set properties, this is
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     6
         the best place to set them. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     7
    <property file="build.properties"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     8
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
     9
    <!-- The default.properties file is created and updated by activitycreator.
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    10
         It will set any properties not already defined by build.properties. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    11
    <property file="default.properties"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    12
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    13
    <!-- ************************************************************************************* -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    14
    <!-- These settings were written by activitycreator.
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    15
         Do not change them unless you really know what you are doing. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    16
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    17
    <!-- Application Package Name -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    18
    <property name="application-package" value="com.beem.project.beem" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    19
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    20
    <!-- The intermediates directory, Eclipse uses "bin"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    21
         for its own output, so we do the same. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    22
    <property name="outdir" value="bin" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    23
    
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    24
    <!-- ************************************************************************************* -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    25
    <!-- No user servicable parts below. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    26
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    27
    <property name="android-tools" value="${sdk-folder}/tools" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    28
    <property name="android-framework" value="${android-tools}/lib/framework.aidl" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    29
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    30
    <!-- Input directories -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    31
    <property name="resource-dir" value="res" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    32
    <property name="asset-dir" value="assets" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    33
    <property name="srcdir" value="src" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    34
    <condition property="srcdir-ospath"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    35
            value="${basedir}\${srcdir}"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    36
            else="${basedir}/${srcdir}" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    37
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    38
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    39
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    40
    <!-- folder for the 3rd party java libraries -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    41
    <property name="external-libs" value="libs" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    42
    <condition property="external-libs-ospath"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    43
            value="${basedir}\${external-libs}"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    44
            else="${basedir}/${external-libs}" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    45
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    46
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    47
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    48
    <!-- folder for the native libraries -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    49
    <property name="native-libs" value="libs" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    50
    <condition property="native-libs-ospath"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    51
            value="${basedir}\${native-libs}"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    52
            else="${basedir}/${native-libs}" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    53
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    54
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    55
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    56
    <!-- Output directories -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    57
    <property name="outdir-classes" value="${outdir}/classes" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    58
    <condition property="outdir-classes-ospath"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    59
            value="${basedir}\${outdir-classes}"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    60
            else="${basedir}/${outdir-classes}" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    61
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    62
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    63
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    64
    <!-- Create R.java in the source directory -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    65
    <property name="outdir-r" value="src" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    66
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    67
    <!-- Intermediate files -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    68
    <property name="dex-file" value="classes.dex" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    69
    <property name="intermediate-dex" value="${outdir}/${dex-file}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    70
    <condition property="intermediate-dex-ospath"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    71
            value="${basedir}\${intermediate-dex}"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    72
            else="${basedir}/${intermediate-dex}" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    73
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    74
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    75
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    76
    <!-- The final package file to generate -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    77
    <property name="resources-package" value="${outdir}/${ant.project.name}.ap_" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    78
    <condition property="resources-package-ospath"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    79
            value="${basedir}\${resources-package}"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    80
            else="${basedir}/${resources-package}" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    81
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    82
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    83
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    84
    <property name="out-debug-package" value="${outdir}/${ant.project.name}-debug.apk" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    85
    <condition property="out-debug-package-ospath"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    86
            value="${basedir}\${out-debug-package}"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    87
            else="${basedir}/${out-debug-package}" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    88
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    89
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    90
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    91
    <property name="out-unsigned-package" value="${outdir}/${ant.project.name}-unsigned.apk" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    92
    <condition property="out-unsigned-package-ospath"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    93
            value="${basedir}\${out-unsigned-package}"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    94
            else="${basedir}/${out-unsigned-package}" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    95
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    96
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    97
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    98
    <!-- Tools -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
    99
    <condition property="aapt" value="${android-tools}/aapt.exe" else="${android-tools}/aapt" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   100
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   101
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   102
    <condition property="aidl" value="${android-tools}/aidl.exe" else="${android-tools}/aidl" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   103
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   104
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   105
    <condition property="adb" value="${android-tools}/adb.exe" else="${android-tools}/adb" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   106
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   107
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   108
    <condition property="dx" value="${android-tools}/dx.bat" else="${android-tools}/dx" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   109
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   110
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   111
    <condition property="apk-builder" value="${android-tools}/apkbuilder.bat" else="${android-tools}/apkbuilder" >
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   112
        <os family="windows"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   113
    </condition>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   114
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   115
    <property name="android-jar" value="${sdk-folder}/android.jar" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   116
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   117
    <!-- Rules -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   118
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   119
    <!-- Create the output directories if they don't exist yet. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   120
    <target name="dirs">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   121
        <echo>Creating output directories if needed...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   122
        <mkdir dir="${outdir}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   123
        <mkdir dir="${outdir-classes}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   124
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   125
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   126
    <!-- Generate the R.java file for this project's resources. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   127
    <target name="resource-src" depends="dirs">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   128
        <echo>Generating R.java / Manifest.java from the resources...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   129
        <exec executable="${aapt}" failonerror="true">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   130
            <arg value="package" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   131
            <arg value="-m" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   132
            <arg value="-J" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   133
            <arg value="${outdir-r}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   134
            <arg value="-M" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   135
            <arg value="AndroidManifest.xml" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   136
            <arg value="-S" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   137
            <arg value="${resource-dir}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   138
            <arg value="-I" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   139
            <arg value="${android-jar}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   140
        </exec>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   141
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   142
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   143
    <!-- Generate java classes from .aidl files. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   144
    <target name="aidl" depends="dirs">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   145
        <echo>Compiling aidl files into Java classes...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   146
        <apply executable="${aidl}" failonerror="true">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   147
            <arg value="-p${android-framework}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   148
            <arg value="-I${srcdir}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   149
            <fileset dir="${srcdir}">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   150
                <include name="**/*.aidl"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   151
            </fileset>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   152
        </apply>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   153
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   154
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   155
    <!-- Compile this project's .java files into .class files. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   156
    <target name="compile" depends="dirs, resource-src, aidl">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   157
        <javac encoding="ascii" target="1.5" debug="true" extdirs=""
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   158
                srcdir="."
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   159
                destdir="${outdir-classes}"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   160
                bootclasspath="${android-jar}">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   161
            <classpath>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   162
                <fileset dir="${external-libs}" includes="*.jar"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   163
            </classpath>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   164
         </javac>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   165
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   166
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   167
    <!-- Convert this project's .class files into .dex files. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   168
    <target name="dex" depends="compile">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   169
        <echo>Converting compiled files and external libraries into ${outdir}/${dex-file}...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   170
        <apply executable="${dx}" failonerror="true" parallel="true">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   171
            <arg value="--dex" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   172
            <arg value="--output=${intermediate-dex-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   173
            <arg path="${outdir-classes-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   174
            <fileset dir="${external-libs}" includes="*.jar"/>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   175
        </apply>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   176
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   177
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   178
    <!-- Put the project's resources into the output package file. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   179
    <target name="package-res-and-assets">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   180
        <echo>Packaging resources and assets...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   181
        <exec executable="${aapt}" failonerror="true">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   182
            <arg value="package" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   183
            <arg value="-f" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   184
            <arg value="-M" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   185
            <arg value="AndroidManifest.xml" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   186
            <arg value="-S" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   187
            <arg value="${resource-dir}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   188
            <arg value="-A" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   189
            <arg value="${asset-dir}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   190
            <arg value="-I" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   191
            <arg value="${android-jar}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   192
            <arg value="-F" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   193
            <arg value="${resources-package}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   194
        </exec>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   195
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   196
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   197
    <!-- Same as package-res-and-assets, but without "-A ${asset-dir}" -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   198
    <target name="package-res-no-assets">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   199
        <echo>Packaging resources...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   200
        <exec executable="${aapt}" failonerror="true">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   201
            <arg value="package" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   202
            <arg value="-f" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   203
            <arg value="-M" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   204
            <arg value="AndroidManifest.xml" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   205
            <arg value="-S" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   206
            <arg value="${resource-dir}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   207
            <!-- No assets directory -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   208
            <arg value="-I" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   209
            <arg value="${android-jar}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   210
            <arg value="-F" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   211
            <arg value="${resources-package}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   212
        </exec>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   213
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   214
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   215
    <!-- Invoke the proper target depending on whether or not
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   216
         an assets directory is present. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   217
    <!-- TODO: find a nicer way to include the "-A ${asset-dir}" argument
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   218
         only when the assets dir exists. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   219
    <target name="package-res">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   220
        <available file="${asset-dir}" type="dir"
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   221
                property="res-target" value="and-assets" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   222
        <property name="res-target" value="no-assets" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   223
        <antcall target="package-res-${res-target}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   224
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   225
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   226
    <!-- Package the application and sign it with a debug key.
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   227
         This is the default target when building. It is used for debug. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   228
    <target name="debug" depends="dex, package-res">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   229
        <echo>Packaging ${out-debug-package}, and signing it with a debug key...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   230
        <exec executable="${apk-builder}" failonerror="true">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   231
            <arg value="${out-debug-package-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   232
            <arg value="-z" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   233
            <arg value="${resources-package-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   234
            <arg value="-f" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   235
            <arg value="${intermediate-dex-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   236
            <arg value="-rf" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   237
            <arg value="${srcdir-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   238
            <arg value="-rj" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   239
            <arg value="${external-libs-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   240
            <arg value="-nf" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   241
            <arg value="${native-libs-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   242
        </exec>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   243
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   244
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   245
    <!-- Package the application without signing it.
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   246
         This allows for the application to be signed later with an official publishing key. -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   247
    <target name="release" depends="dex, package-res">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   248
        <echo>Packaging ${out-unsigned-package} for release...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   249
        <exec executable="${apk-builder}" failonerror="true">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   250
            <arg value="${out-unsigned-package-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   251
            <arg value="-u" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   252
            <arg value="-z" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   253
            <arg value="${resources-package-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   254
            <arg value="-f" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   255
            <arg value="${intermediate-dex-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   256
            <arg value="-rf" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   257
            <arg value="${srcdir-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   258
            <arg value="-rj" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   259
            <arg value="${external-libs-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   260
            <arg value="-nf" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   261
            <arg value="${native-libs-ospath}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   262
        </exec>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   263
        <echo>It will need to be signed with jarsigner before being published.</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   264
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   265
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   266
    <!-- Install the package on the default emulator -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   267
    <target name="install" depends="debug">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   268
        <echo>Installing ${out-debug-package} onto default emulator...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   269
        <exec executable="${adb}" failonerror="true">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   270
            <arg value="install" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   271
            <arg value="${out-debug-package}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   272
        </exec>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   273
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   274
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   275
    <target name="reinstall" depends="debug">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   276
        <echo>Installing ${out-debug-package} onto default emulator...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   277
        <exec executable="${adb}" failonerror="true">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   278
            <arg value="install" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   279
            <arg value="-r" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   280
            <arg value="${out-debug-package}" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   281
        </exec>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   282
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   283
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   284
    <!-- Uinstall the package from the default emulator -->
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   285
    <target name="uninstall">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   286
        <echo>Uninstalling ${application-package} from the default emulator...</echo>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   287
        <exec executable="${adb}" failonerror="true">
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   288
            <arg value="uninstall" />
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   289
            <arg value="${application-package}" />
6
be992d61ca32 Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents: 0
diff changeset
   290
	</exec>
0
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   291
    </target>
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   292
6
be992d61ca32 Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents: 0
diff changeset
   293
    <target name="clean"
be992d61ca32 Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents: 0
diff changeset
   294
	    description="Delete old build and dist directories">
7
c2941cee7327 Ajout de programme qui peuvent s'echanger des donnees jingle et negocier une
Da Risk <darisk972@gmail.com>
parents: 6
diff changeset
   295
	<delete verbose="false" dir="${outdir}"/>
6
be992d61ca32 Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents: 0
diff changeset
   296
    </target>
be992d61ca32 Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents: 0
diff changeset
   297
be992d61ca32 Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents: 0
diff changeset
   298
be992d61ca32 Ajout d'une regle clean dans le build.xml
Da Risk <darisk972@gmail.com>
parents: 0
diff changeset
   299
0
ea84f930b04a Initial import
Da Risk <darisk972@gmail.com>
parents:
diff changeset
   300
</project>