forked from movisens/SmartGattLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
78 lines (66 loc) · 2.52 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
<project default="package">
<property file="local.properties"/>
<property file="project.properties"/>
<!-- Package properties -->
<property name="package.name" value="smartgattlib" />
<property name="package.packagename" value="com.movisens.smartgattlib" />
<!-- 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>
<property name="build.dir" value="./bin"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<buildnumber file="build.num" />
<!-- Build javadoc -->
<target name="doc">
<javadoc
sourcepath="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
target="1.6"
includeantruntime="false"
srcdir="src"
destdir="${classes.dir}"
debug="true"
debuglevel="lines,source" />
</target>
<!-- Package a jar from compiled class files -->
<target name="jar" depends="git-details,compile">
<manifest file="MANIFEST.MF">
<attribute name="Built-By" value="${user.name}" />
<attribute name="Implementation-Version" value="${package.versionname}"/>
</manifest>
<jar destfile="${package.name}-${package.versionname}.jar" basedir="${build.dir}/classes" includes="com/movisens/smartgattlib/**/*.class" manifest="MANIFEST.MF" />
</target>
<!-- Clean out the build files -->
<target name="clean">
<delete dir="bin" />
<delete dir="doc" />
<delete>
<fileset dir="." includes="*.jar"/>
<fileset file="MANIFEST.MF"/>
</delete>
</target>
<!-- Compile and package a jar -->
<target name="package" depends="clean,compile,jar" />
</project>