-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
79 lines (65 loc) · 3.07 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<project name="slf4j-on-android" default="build" basedir=".">
<description>Build file for SLF4j on Android</description>
<property name="src" location="src" />
<property name="tmp" location="tmp" />
<property name="bin" location="bin" />
<property name="lib" location="lib" />
<property name="javadoc" location="javadoc" />
<property name="external" location="external" />
<property name="sources" location="sources" />
<property name="slf-version" value="1.6.2"/>
<property name="jar" location="${lib}/${ant.project.name}-${slf-version}.jar" />
<property name="sources-filename" value="${ant.project.name}-${slf-version}" />
<property environment="env"/>
<property name="android.home" value="${env.ANDROID_HOME}"/>
<!-- Default android version is 8 currently.
This relies on properties being immutable in ant so won't override if set in the env already -->
<property name="env.ANDROID_VERSION" value="8"/>
<property name="android.version" value="${env.ANDROID_VERSION}"/>
<!-- Is the android.jar in an old style SDK or a new one? -->
<available file="${android.home}/android.jar" property="android.jar" value="${android.home}/android.jar" />
<available file="${android.home}/platforms/android-${android.version}/android.jar" property="android.jar" value="${android.home}/platforms/android-8/android.jar" />
<fail message="Unable to find android.jar" unless="android.jar" />
<path id="external_jars">
<fileset dir="${external}/slf4j-${slf-version}">
<include name="slf4j-api-${slf-version}.jar" />
</fileset>
<fileset file="${android.jar}" />
</path>
<target name="build">
<!-- Create the build directory structure used by compile -->
<delete dir="${lib}" />
<delete dir="${tmp}" />
<delete dir="${javadoc}" />
<delete dir="${sources}" />
<mkdir dir="${tmp}" />
<mkdir dir="${lib}" />
<mkdir dir="${javadoc}" />
<mkdir dir="${sources}" />
<!-- Compile the java code from ${src} into ${tmp} -->
<javac srcdir="${src}" destdir="${tmp}" target="1.5" debug="on">
<classpath refid="external_jars" />
<compilerarg value="-Xlint:unchecked" />
</javac>
<!-- create the javadoc -->
<javadoc destdir="javadoc" access="public" sourcepath="${src}" >
<classpath refid="external_jars" />
<link href="http://www.slf4j.org/apidocs/" />
</javadoc>
<!-- Put everything in ${tmp} into the jar file -->
<jar jarfile="${jar}" basedir="${tmp}" />
<!-- create a zip file with the sources -->
<zip destfile="${sources}/${sources-filename}.zip">
<zipfileset dir="src"
includes="**/*.java"
prefix="${sources-filename}" />
</zip>
</target>
<target name="clean" description="clean up">
<delete dir="${lib}" />
<delete dir="${tmp}" />
<delete dir="${javadoc}" />
<delete dir="${sources}" />
<delete dir="${bin}" />
</target>
</project>