2013-04-18 23:35:02 +02:00
|
|
|
<!-- 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" />
|
2013-04-18 23:35:02 +02:00
|
|
|
<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 18:51:43 +01:00
|
|
|
<property name="unit.dir" value="test/java" />
|
|
|
|
<property name="unit.absolute.dir" location="${unit.dir}" />
|
2013-04-18 23:35:02 +02:00
|
|
|
<property name="lib.absolute.dir" location="${lib.dir}" />
|
|
|
|
<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" />
|
2013-04-18 23:35:02 +02:00
|
|
|
</fileset>
|
|
|
|
</path>
|
|
|
|
|
2016-03-12 18:51:43 +01:00
|
|
|
<path id="unit.test.path">
|
|
|
|
<path refid="build.path"/>
|
|
|
|
<pathelement path="test/java"/>
|
|
|
|
</path>
|
|
|
|
|
2013-04-18 23:35:02 +02:00
|
|
|
<target name="-dirs">
|
2013-06-24 01:56:23 +02:00
|
|
|
<mkdir dir="${bin.absolute.dir}" />
|
2013-04-18 23:35:02 +02:00
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="clean">
|
2013-06-24 01:56:23 +02:00
|
|
|
<delete dir="${bin.absolute.dir}" />
|
|
|
|
<delete file="OsmAnd-core.jar" />
|
2013-04-18 23:35:02 +02:00
|
|
|
</target>
|
2013-06-24 01:56:23 +02:00
|
|
|
|
2016-03-12 18:51:43 +01:00
|
|
|
<target name="compileUnitTests" depends="compile">
|
|
|
|
<javac srcdir="test/" destdir="${bin.absolute.dir}">
|
|
|
|
<classpath refid="unit.test.path"/>
|
|
|
|
</javac>
|
|
|
|
<copy todir="${bin.absolute.dir}">
|
|
|
|
<fileset dir="test/java">
|
|
|
|
<include name="**/*.json" />
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="run-route-test" >
|
|
|
|
<junit printsummary="yes" haltonfailure="yes" showoutput="yes">
|
|
|
|
<classpath>
|
|
|
|
<pathelement path="bin"/>
|
|
|
|
<path refid="build.path"/>
|
|
|
|
</classpath>
|
|
|
|
<test name="net.osmand.router.RouteResultPreparationTest" haltonfailure="no" outfile="result">
|
|
|
|
<formatter type="plain"/>
|
|
|
|
<formatter type="xml"/>
|
|
|
|
</test>
|
|
|
|
</junit>
|
|
|
|
</target>
|
2013-04-18 23:35:02 +02:00
|
|
|
|
2013-06-17 01:31:59 +02:00
|
|
|
<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" />
|
2013-06-17 01:31:59 +02:00
|
|
|
</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" />
|
2013-06-17 01:31:59 +02:00
|
|
|
</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>
|
2013-06-17 01:31:59 +02:00
|
|
|
<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" />
|
2013-09-24 18:53:48 +02:00
|
|
|
<include name="regions.ocbf" />
|
2013-06-17 01:31:59 +02:00
|
|
|
</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}"/>
|
2013-11-11 00:26:50 +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>
|
2013-06-17 01:31:59 +02:00
|
|
|
<target name="compile" depends="-dirs,copy_resources">
|
2013-04-18 23:35:02 +02:00
|
|
|
<copy todir="${bin.absolute.dir}">
|
|
|
|
<fileset dir="${src.absolute.dir}">
|
|
|
|
<exclude name="**/*.java" />
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
2013-06-24 01:56:23 +02:00
|
|
|
<javac srcdir="${src.absolute.dir}" destdir="${bin.absolute.dir}" encoding="${java.encoding}" classpathref="build.path" debug="on" source="1.6">
|
|
|
|
<include name="**/*.java" />
|
|
|
|
<exclude name="net/osmand/plus/**" />
|
2013-04-18 23:35:02 +02:00
|
|
|
</javac>
|
2013-06-24 01:56:23 +02:00
|
|
|
|
2013-04-18 23:35:02 +02:00
|
|
|
</target>
|
2013-06-24 01:56:23 +02:00
|
|
|
|
2013-04-18 23:35:02 +02:00
|
|
|
<target name="native-libs-jar" depends="compile">
|
2014-01-27 12:06:08 +01:00
|
|
|
<exec command="bash collect_libs.sh" failonerror="true">
|
2013-06-24 01:56:23 +02:00
|
|
|
</exec>
|
|
|
|
<antcall target="jar" />
|
2013-04-18 23:35:02 +02:00
|
|
|
</target>
|
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>
|
2013-04-18 23:35:02 +02:00
|
|
|
|
2016-03-12 18:51:43 +01:00
|
|
|
<target name="jar" depends="compile, compileUnitTests">
|
2013-04-18 23:35:02 +02:00
|
|
|
<manifestclasspath property="lib.list" jarfile="OsmAnd-core.jar">
|
2013-06-24 01:56:23 +02:00
|
|
|
<classpath refid="build.path" />
|
2013-04-18 23:35:02 +02:00
|
|
|
</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}" />
|
2013-04-18 23:35:02 +02:00
|
|
|
</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>
|
2016-03-12 18:51:43 +01:00
|
|
|
<fileset dir="${unit.absolute.dir}">
|
|
|
|
<include name="**/*.java" />
|
|
|
|
</fileset>
|
2013-04-18 23:35:02 +02:00
|
|
|
</jar>
|
2013-09-24 18:53:48 +02:00
|
|
|
<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
|
|
|
|
2013-04-18 23:35:02 +02:00
|
|
|
<delete file="MANIFEST.MF" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="build" depends="jar">
|
|
|
|
</target>
|
|
|
|
</project>
|