forked from android-async-http/android-async-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
100 lines (86 loc) · 3.3 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<project default="package">
<property file="local.properties"/>
<property file="project.properties"/>
<!-- Package properties -->
<property name="package.name" value="android-async-http" />
<property name="package.packagename" value="com.loopj.android.http" />
<!-- Get git commit -->
<available file=".git" type="dir" property="git.present"/>
<target name="git-details">
<exec executable="git" outputproperty="git.status">
<arg value="status" />
</exec>
<echo message="${git.status}"/>
<exec executable="git" outputproperty="package.versionname">
<arg value="describe"/>
<arg value="--tags"/>
<arg value="--dirty"/>
<arg value="--always"/>
</exec>
<echo message="${package.versionname}" />
</target>
<!-- Standard jar stuff -->
<property environment="env"/>
<condition property="android.base" value="${sdk.dir}" else="${env.ANDROID_HOME}">
<isset property="sdk.dir" />
</condition>
<fail message="Please set either the sdk.dir property or the ANDROID_HOME environment variable to point to your Android SDK installation.">
<condition>
<not>
<available file="${android.base}" type="dir"/>
</not>
</condition>
</fail>
<property name="lib.dir" value="${android.base}/platforms/${target}" />
<property name="build.dir" value="./build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<buildnumber file="build.num" />
<!-- Set up classpath -->
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<!-- Build javadoc -->
<target name="doc">
<javadoc
classpathref="classpath"
sourcepath="gen:src"
destdir="doc"
packagenames="${package.packagename}"
linkoffline="http://d.android.com/reference ${android.base}/docs/reference"
additionalparam="-author -version"
/>
</target>
<!-- Compile java files into classes -->
<target name="compile">
<mkdir dir="${build.dir}" />
<mkdir dir="${classes.dir}" />
<javac
includeantruntime="false"
srcdir="."
destdir="${classes.dir}"
classpathref="classpath"
debug="true"
debuglevel="lines,source" />
</target>
<!-- Package a jar from compiled class files -->
<target name="jar" depends="git-details,compile">
<delete dir="." includes="**/*.jar" />
<delete file="MANIFEST.MF" />
<manifest file="MANIFEST.MF">
<attribute name="Built-By" value="${user.name}" />
<attribute name="Implementation-Version" value="${package.versionname}"/>
</manifest>
<jar destfile="${package.versionname}.jar" basedir="build/classes" includes="com/loopj/android/http/**/*.class" manifest="MANIFEST.MF" />
</target>
<!-- Clean out the build files -->
<target name="clean">
<delete dir="build" />
<delete dir="doc" />
<delete>
<fileset dir="." includes="*.jar"/>
<fileset file="MANIFEST.MF"/>
</delete>
</target>
<!-- Compile and package a jar -->
<target name="package" depends="compile,jar" />
</project>