OsmAnd/OsmAnd-java/build.xml

185 lines
5.4 KiB
XML
Raw Permalink Normal View History

<!-- build JAR libraty -->
<project name="OsmAnd-core" default="build" basedir=".">
<property file="local.properties" />
2013-06-24 01:56:23 +02:00
<property name="src.dir" value="src" />
<property name="src.absolute.dir" location="${src.dir}" />
2013-11-11 00:21:01 +01:00
<property name="protobuf.src" location="protobuf-src" />
2013-06-24 01:56:23 +02:00
<property name="bin.dir" value="bin" />
<property name="bin.absolute.dir" location="${bin.dir}" />
<property name="lib.dir" value="libs" />
2016-03-12 20:22:53 +01:00
<property name="lib.absolute.dir" location="${lib.dir}" />
<property name="unit.dir" value="test/java" />
<property name="unit.absolute.dir" location="${unit.dir}" />
2016-03-30 15:08:50 +02:00
<property name="test.lib.dir" value="test/libs" />
2016-03-12 20:22:53 +01:00
<property name="test.lib.absolute.dir" location="${test.lib.dir}" />
2016-03-30 15:42:20 +02:00
<property name="reports.tests" value="test-results" />
2016-03-30 15:08:32 +02:00
<property name="srctests.dir" value="test/java"/>
<property name="java.encoding" value="UTF-8" />
<path id="build.path">
<fileset dir="${lib.absolute.dir}">
2013-06-24 01:56:23 +02:00
<include name="*.jar" />
</fileset>
</path>
2016-03-12 20:22:53 +01:00
<path id="test-lib.path">
<fileset dir="${test.lib.absolute.dir}">
<include name="*.jar" />
</fileset>
</path>
<path id="unit.test.path">
<path refid="build.path"/>
<pathelement path="test/java"/>
</path>
<target name="-dirs">
2013-06-24 01:56:23 +02:00
<mkdir dir="${bin.absolute.dir}" />
</target>
<target name="clean">
2013-06-24 01:56:23 +02:00
<delete dir="${bin.absolute.dir}" />
<delete file="OsmAnd-core.jar" />
</target>
2013-06-24 01:56:23 +02:00
<target name="compileUnitTests" depends="compile">
<javac srcdir="test/" destdir="${bin.absolute.dir}">
2016-03-12 20:22:53 +01:00
<classpath>
<path refid="build.path"/>
<path refid="test-lib.path" />
</classpath>
</javac>
<copy todir="${bin.absolute.dir}">
2016-03-30 16:03:06 +02:00
<fileset dir="test/resources">
<include name="**/*" />
</fileset>
</copy>
</target>
2016-03-30 14:57:27 +02:00
<target name="junits" >
2016-03-30 15:42:20 +02:00
<junit printsummary="yes" showoutput="yes">
<classpath>
<pathelement path="bin"/>
<path refid="build.path"/>
2016-03-12 20:22:53 +01:00
<path refid="test-lib.path" />
</classpath>
2016-03-30 15:42:20 +02:00
<formatter type="xml" />
2016-03-30 14:57:27 +02:00
<batchtest fork="false" todir="${reports.tests}" >
<fileset dir="${srctests.dir}" >
2016-03-30 15:42:20 +02:00
<include name="**/*Test.java" />
2016-03-30 14:57:27 +02:00
<exclude name="**/AllTests.java" />
<exclude name="**/*Suite*.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="copy_resources">
<copy todir="${src.absolute.dir}/net/osmand/router/">
2013-06-24 01:56:23 +02:00
<fileset dir="../../resources/routing/">
<include name="*.xml" />
</fileset>
</copy>
<copy todir="${src.absolute.dir}/net/osmand/render/">
2013-06-24 01:56:23 +02:00
<fileset dir="../../resources/rendering_styles/">
<include name="*.xml" />
</fileset>
</copy>
2013-06-21 09:34:12 +02:00
<copy todir="${src.absolute.dir}/net/osmand/osm/">
2013-06-24 01:56:23 +02:00
<fileset dir="../../resources/obf_creation/">
<include name="rendering_types.xml" />
2013-06-21 09:34:12 +02:00
</fileset>
2014-11-19 00:47:59 +01:00
<fileset dir="../../resources/poi/">
<include name="poi_types.xml" />
</fileset>
2013-06-21 09:34:12 +02:00
</copy>
<copy todir="${src.absolute.dir}/net/osmand/map/">
2013-06-24 01:56:23 +02:00
<fileset dir="../../resources/countries-info/">
<include name="countries.reginfo" />
<include name="regions.ocbf" />
</fileset>
</copy>
</target>
2013-11-11 00:21:01 +01:00
<target name="patch-protobuf">
<copy file="${protobuf.src}/com/google/protobuf/CodedInputStream.java"
tofile="${protobuf.src}/com/google/protobuf/CodedInputStreamRAF.java" overwrite="yes">
</copy>
<copy todir="${src.absolute.dir}">
<fileset dir="${protobuf.src}"/>
2016-03-12 20:22:53 +01:00
</copy>
2013-11-11 00:39:09 +01:00
<patch patchfile="protobuf.patch" dir=".."/>
2013-11-11 00:21:01 +01:00
</target>
<target name="compile" depends="-dirs,copy_resources">
<copy todir="${bin.absolute.dir}">
<fileset dir="${src.absolute.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
2016-06-06 18:15:12 +02:00
<javac srcdir="${src.absolute.dir}" destdir="${bin.absolute.dir}" encoding="${java.encoding}" classpathref="build.path" debug="on" source="1.7">
2013-06-24 01:56:23 +02:00
<include name="**/*.java" />
<exclude name="net/osmand/plus/**" />
</javac>
2013-06-24 01:56:23 +02:00
</target>
2013-06-24 01:56:23 +02:00
<target name="native-libs-jar" depends="compile">
<exec command="bash collect_libs.sh" failonerror="true">
2013-06-24 01:56:23 +02:00
</exec>
<antcall target="jar" />
</target>
2016-03-12 20:22:53 +01:00
2014-06-23 21:52:23 +02:00
<target name="native-legacy-libs-jar" depends="compile">
2014-06-23 21:59:34 +02:00
<exec command="bash collect_legacy_libs.sh" failonerror="true">
2014-06-23 21:52:23 +02:00
</exec>
<antcall target="jar" />
</target>
<target name="jar" depends="compile, compileUnitTests">
<manifestclasspath property="lib.list" jarfile="OsmAnd-core.jar">
2013-06-24 01:56:23 +02:00
<classpath refid="build.path" />
</manifestclasspath>
<echo>list is ${lib.list}</echo>
<delete file="OsmAnd-core.jar" />
<delete file="MANIFEST.MF" />
<manifest file="MANIFEST.MF">
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="net.osmand.swing.OsmExtractionUI" />
2013-06-24 01:56:23 +02:00
<attribute name="Class-Path" value="${lib.list}" />
</manifest>
<jar destfile="OsmAnd-core.jar" manifest="MANIFEST.MF">
<fileset dir="${bin.absolute.dir}">
<include name="**/*" />
</fileset>
<fileset dir="${src.absolute.dir}">
<include name="**/*.java" />
</fileset>
<fileset dir="${unit.absolute.dir}">
<include name="**/*.java" />
</fileset>
</jar>
<jar destfile="OsmAnd-core-android.jar" manifest="MANIFEST.MF">
<fileset dir="${bin.absolute.dir}">
<include name="**/*.class" />
<exclude name="**/PlatformUtil*"/>
</fileset>
<fileset dir="${src.absolute.dir}">
<include name="**/*.java" />
<exclude name="**/PlatformUtil*"/>
</fileset>
</jar>
2013-06-24 01:56:23 +02:00
<delete file="MANIFEST.MF" />
</target>
<target name="build" depends="jar">
</target>
</project>