OsmAnd/OsmAnd/build.xml

254 lines
9.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project name="OsmAnd" default="help">
<!-- The local.properties file is created and updated by the 'android'
tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The build.properties file can be created by you and is never touched
by the 'android' tool. This is the place to change some of the
default property values used by the Ant rules.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="build.properties" />
<!-- The default.properties file is created and updated by the 'android'
tool, as well as ADT.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<property file="default.properties" />
<!-- Custom Android task to deal with the project target, and import the
proper rules.
This requires ant 1.6.0 or above. -->
<path id="android.antlibs">
<pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
<pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
<pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
</path>
<taskdef name="setup" classname="com.android.ant.SetupTask" classpathref="android.antlibs" />
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
[This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir}]
<target name="-post-compile">
</target>
-->
<property name="use.dir" value="../DataExtractionOSM/src/" />
<property name="use.absolute.dir" location="${use.dir}" />
<property name="raw.absolute.dir" location="raw" />
<property name="base.dir" location="." />
<target name="-pre-build">
<delete dir="${raw.absolute.dir}" verbose="${verbose}" />
<mkdir dir="${raw.absolute.dir}/classes" />
<copy todir="${raw.absolute.dir}">
<fileset dir="${use.absolute.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
</target>
<target name="-package-resources">
<echo>Packaging resources and assets...</echo>
<exec executable="${aapt}">
<!-- failonerror="true"> -->
<arg value="package" />
<arg value="-f" />
<arg value="-M" />
<arg value="${base.dir}/AndroidManifest.xml" />
<arg value="-S" />
<arg value="${resource.absolute.dir}" />
<arg value="-A" />
<arg value="${asset.absolute.dir}" />
<arg value="-I" />
<arg value="${android.jar}" />
<arg value="-F" />
<arg value="${out.absolute.dir}/${resource.package.file.name}" />
<arg value="${raw.absolute.dir}" />
</exec>
</target>
<!-- Compiles this project's .java files into .class files. -->
<target name="compile" depends="-pre-build, -resource-src, -aidl, -pre-compile" description="Compiles project's .java files into .class files">
<if condition="${manifest.hasCode}">
<then>
<!-- If android rules are used for a test project, its classpath should include
tested project's location -->
<condition property="extensible.classpath" value="${tested.project.absolute.dir}/bin/classes" else=".">
<isset property="tested.project.absolute.dir" />
</condition>
<condition property="extensible.libs.classpath" value="${tested.project.absolute.dir}/libs" else="${jar.libs.dir}">
<isset property="tested.project.absolute.dir" />
</condition>
<javac encoding="${java.encoding}" source="${java.source}" target="${java.target}" debug="true" extdirs="" destdir="${out.classes.absolute.dir}" bootclasspathref="android.target.classpath" verbose="${verbose}" classpath="${extensible.classpath}" classpathref="jar.libs.ref">
<src path="${source.absolute.dir}" />
<!-- osmchange -->
<src path="${use.absolute.dir}" />
<exclude name="**/LogUtil.java" />
<exclude name="**/OsmStorageWriter.java" />
<exclude name="**/net/osmand/data/index/" />
<exclude name="**/net/osmand/data/preparation/" />
<exclude name="**/net/osmand/osm/util/" />
<exclude name="**/net/osmand/swing/" />
<exclude name="**/rtree/" />
<!-- osmchange -->
<src path="${gen.absolute.dir}" />
<src refid="project.libraries.src" />
<classpath>
<fileset dir="${extensible.libs.classpath}" includes="*.jar" />
</classpath>
</javac>
</then>
<else>
<echo>hasCode = false. Skipping...</echo>
</else>
</if>
</target>
<!--taskdef classname="net.bluecow.googlecode.ant.GoogleCodeUploadTask"
classpath="ant-lib/ant-googlecode-0.0.2.jar" name="gcupload"/-->
<path id="lib.path">
<fileset dir="ant-lib" includes="*.jar" />
</path>
<!-- Execute the Android Setup task that will setup some properties
specific to the target, and import the build rules files.
The rules file is imported from
<SDK>/platforms/<target_platform>/ant/ant_rules_r#.xml
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<setup> task.
- customize it to your needs.
- Customize the whole script.
- copy/paste the content of the rules files (minus the top node)
into this file, *after* the <setup> task
- disable the import of the rules by changing the setup task
below to <setup import="false" />.
- customize to your needs.
-->
<setup />
<macrodef name="package-helper">
<attribute name="output.filepath" />
<element name="extra-jars" optional="yes" />
<sequential>
<if>
<condition>
<isset property="nativeoff"/>
</condition>
<then>
<echo>Package helper running: nativeoff</echo>
<apkbuilder
outfolder="${out.absolute.dir}"
resourcefile="${resource.package.file.name}"
apkfilepath="@{output.filepath}"
debugpackaging="${build.packaging.debug}"
debugsigning="${build.signing.debug}"
abifilter="${filter.abi}"
verbose="${verbose}"
hascode="${manifest.hasCode}">
<dex path="${intermediate.dex.file}"/>
<sourcefolder path="${source.absolute.dir}"/>
<sourcefolder refid="project.libraries.src"/>
<jarfolder path="${jar.libs.absolute.dir}" />
<jarfolder refid="project.libraries.libs" />
<extra-jars/>
</apkbuilder>
</then>
<else>
<echo>Package helper running: nativeon</echo>
<apkbuilder
outfolder="${out.absolute.dir}"
resourcefile="${resource.package.file.name}"
apkfilepath="@{output.filepath}"
debugpackaging="${build.packaging.debug}"
debugsigning="${build.signing.debug}"
abifilter="${filter.abi}"
verbose="${verbose}"
hascode="${manifest.hasCode}">
<dex path="${intermediate.dex.file}"/>
<sourcefolder path="${source.absolute.dir}"/>
<sourcefolder refid="project.libraries.src"/>
<jarfolder path="${jar.libs.absolute.dir}" />
<jarfolder refid="project.libraries.libs" />
<nativefolder path="${native.libs.absolute.dir}" />
<nativefolder refid="project.libraries.libs" />
<extra-jars/>
</apkbuilder>
</else>
</if>
</sequential>
</macrodef>
<target name="debug-nondk">
<property name="nativeoff" value="true"/>
<antcall target="debug"/>
</target>
<!-- NOT used now for night builds could be deleted -->
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="lib.path" />
<target name="update">
<svn svnkit="true">
<info target="." />
</svn>
<echo>Current revision: ${svn.info.rev}</echo>
<svn svnkit="true">
<update dir="." revision="HEAD" />
<update dir="${use.absolute.dir}" revision="HEAD" />
<info target="." />
</svn>
<echo>Updated to revision: ${svn.info.rev}</echo>
<echo>Modyfing Version.java to include revision info: debug r${svn.info.rev}</echo>
<replaceregexp file="${use.absolute.dir}/net/osmand/Version.java" match='(APP_DESCRIPTION.*=.*\").*(\".*)' replace='\1debug r${svn.info.rev}\2' byline="true" />
</target>
<target name="nightbuild" depends="clean,update,debug">
<ftp action="del" server="download.osmand.net" userid="${ftp.user}" password="${ftp.password}">
<fileset>
<include name="night-builds/OsmAnd-debug.apk" />
</fileset>
</ftp>
<ftp server="download.osmand.net" remotedir="night-builds" userid="${ftp.user}" password="${ftp.password}" depends="yes">
<fileset dir="bin">
<include name="OsmAnd-debug.apk" />
</fileset>
</ftp>
</target>
</project>