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 20:22:53 +01:00
|
|
|
<property name="lib.absolute.dir" location="${lib.dir}" />
|
2016-03-12 18:51:43 +01:00
|
|
|
<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"/>
|
2013-04-18 23:35:02 +02:00
|
|
|
<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 20:22:53 +01:00
|
|
|
<path id="test-lib.path">
|
|
|
|
<fileset dir="${test.lib.absolute.dir}">
|
|
|
|
<include name="*.jar" />
|
|
|
|
</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}">
|
2016-03-12 20:22:53 +01:00
|
|
|
<classpath>
|
|
|
|
<path refid="build.path"/>
|
|
|
|
<path refid="test-lib.path" />
|
|
|
|
</classpath>
|
2016-03-12 18:51:43 +01:00
|
|
|
</javac>
|
|
|
|
<copy todir="${bin.absolute.dir}">
|
2016-03-30 16:03:06 +02:00
|
|
|
<fileset dir="test/resources">
|
|
|
|
<include name="**/*" />
|
2016-03-12 18:51:43 +01:00
|
|
|
</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">
|
2016-03-12 18:51:43 +01:00
|
|
|
<classpath>
|
|
|
|
<pathelement path="bin"/>
|
|
|
|
<path refid="build.path"/>
|
2016-03-12 20:22:53 +01:00
|
|
|
<path refid="test-lib.path" />
|
2016-03-12 18:51:43 +01:00
|
|
|
</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>
|
2016-03-12 18:51:43 +01:00
|
|
|
</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}"/>
|
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>
|
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>
|
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/**" />
|
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>
|
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>
|
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>
|