-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
94 lines (78 loc) · 3.49 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
<?xml version="1.0"?>
<project name="signals-android" default="compile" basedir=".">
<property name="jsignals-android.version" value="0.2-SNAPSHOT" />
<property name="jsignals-android.classpath" value="org.osjava.signals" />
<property name="jsignals-android.jar.bin" value="jsignals-android-${jsignals-android.version}.jar" />
<property name="jsignals-android.jar.src" value="jsignals-android-${jsignals-android.version}-src.jar" />
<property name="jsignals-android.jar.test" value="jsignals-android-${jsignals-android.version}-tests.jar" />
<property name="junit.version" value="4.9" />
<property name="junit.dist" value="junit-${junit.version}" />
<property name="android.version" value="7" />
<property name="android.dist" value="android-${android.version}" />
<property name="dir.target" location="target" />
<property name="dir.src" value="src/main/java" />
<property name="dir.test" value="src/test/java" />
<property name="dir.test.reports" value="${dir.target}/reports" />
<property name="dir.lib" location="lib" />
<property name="dir.dist" location="${dir.target}/bin" />
<property name="dir.build" location="${dir.target}/main" />
<property name="dir.javadoc" location="${dir.target}/javadoc" />
<property environment="env"/>
<path id="classpath.main">
<pathelement location="${env.ANDROID_HOME}/platforms/${android.dist}/android.jar" />
</path>
<path id="classpath.test">
<path refid="classpath.main" />
<pathelement location="${dir.lib}/junit/${junit.dist}.jar" />
<pathelement location="${dir.dist}/${jsignals-android.jar.test}" />
</path>
<target name="init">
<tstamp />
</target>
<target name="clean">
<delete dir="${dir.target}" includeemptydirs="true" />
</target>
<macrodef name="jsignals-android-compilation">
<attribute name="src" />
<attribute name="dest" />
<attribute name="classpath" />
<sequential>
<mkdir dir="@{dest}" />
<javac srcdir="@{src}" destdir="@{dest}" debug="on" includeantruntime="false" target="1.6">
<classpath refid="@{classpath}" />
<compilerarg value="-Xlint:unchecked" />
</javac>
</sequential>
</macrodef>
<macrodef name="jsignals-android-tests">
<sequential>
<junit printsummary="yes" haltonfailure="no" failureproperty="junit.failure">
<classpath refid="classpath.test" />
<formatter type="brief" />
<batchtest fork="yes" todir="${dir.test.reports}">
<fileset dir="${dir.test}">
<include name="**/*Test*.java" />
</fileset>
</batchtest>
</junit>
<fail if="junit.failure" message="Unit test(s) failed. See reports!" />
</sequential>
</macrodef>
<target name="compile" depends="init">
<jsignals-android-compilation src="${dir.src}" dest="${dir.build}" classpath="classpath.main" />
<jar jarfile="${dir.dist}/${jsignals-android.jar.bin}" basedir="${dir.build}" excludes="" />
<jar jarfile="${dir.dist}/${jsignals-android.jar.src}" basedir="${dir.src}" excludes="**/*.class" />
</target>
<target name="tests" depends="clean, compile">
<jsignals-android-compilation src="${dir.src}; ${dir.test}" dest="${dir.build}" classpath="classpath.test" />
<jar jarfile="${dir.dist}/${jsignals-android.jar.test}" basedir="${dir.build}" excludes="" />
<mkdir dir="${dir.test.reports}" />
<jsignals-android-tests />
</target>
<target name="docs">
<javadoc destdir="${dir.javadoc}" author="false" version="false" use="false" windowtitle="Java Signals API">
<sourcepath location="${dir.src}" />
<link href="http://java.sun.com/javase/6/docs/api/" />
</javadoc>
</target>
</project>