-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathbuild.xml
More file actions
123 lines (103 loc) · 4.71 KB
/
build.xml
File metadata and controls
123 lines (103 loc) · 4.71 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<project name="calabash-android-java">
<tstamp>
<format property="current.date" pattern="yyyyMMdd" />
</tstamp>
<property name="version" value="1.5.0" />
<property name="build.dir" value="build" />
<property name="default.target.dir" value="${basedir}/target" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="test.classes.dir" value="${build.dir}/test-classes" />
<property name="jar.dir" value="${build.dir}/jar" />
<property name="jar.file" value="${jar.dir}/${ant.project.name}-${version}.jar" />
<property name="doc.dir" value="${build.dir}/javadoc" />
<property name="doc.jar" value="${jar.dir}/${ant.project.name}-${version}-javadoc.jar" />
<property name="distro.dir" value="${build.dir}/${ant.project.name}-${version}" />
<property name="distro.file" value="${build.dir}/${ant.project.name}-${version}.zip" />
<property name="lib.dir" value="lib" />
<property name="test.lib.dir" value="tests/lib" />
<property name="test.report.dir" value="test-reports" />
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${test.report.dir}" />
</target>
<target name="compile">
<mkdir dir="${classes.dir}" />
<javac source="1.5" target="1.5" srcdir="src" destdir="${classes.dir}" classpathref="classpath" debug="true" debuglevel="lines,vars,source"/>
</target>
<target name="test.compile" depends="clean,compile">
<mkdir dir="${test.classes.dir}" />
<javac srcdir="tests" destdir="${test.classes.dir}" classpathref="test.classpath" />
</target>
<target name="doc">
<javadoc packagenames="com.thoughtworks.calabash.android.*" sourcepath="src" defaultexcludes="yes" destdir="${doc.dir}" author="true" version="true" use="true" windowtitle="Calabash-android-java" classpathref="classpath">
<link href="http://developer.java.sun.com/developer/products/xml/docs/api/" />
</javadoc>
</target>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path>
<path id="test.classpath">
<pathelement path="${classes.dir}"/>
<pathelement path="${test.classes.dir}"/>
<fileset dir="${lib.dir}" includes="**/*.jar" />
<fileset dir="${test.lib.dir}" includes="**/*.jar"/>
<pathelement path="." />
</path>
<target name="jar" depends="-ensure-gems-zip-is-present, compile, doc">
<property name="scripts.dir" value="${classes.dir}/scripts" />
<mkdir dir="${scripts.dir}" />
<copy file="${gems.zip.path}" todir="${scripts.dir}" />
<mkdir dir="${jar.dir}" />
<jar destfile="${jar.file}" basedir="${classes.dir}">
<manifest>
<attribute name="Project-Name" value="calabash-android-java" />
<attribute name="Built-By" value="${user.name}" />
<attribute name="Created-By" value="Thoughtworks studios - Twist" />
<attribute name="Manifest-Version" value="${version}" />
<attribute name="Built-Date" value="${current.date}" />
<attribute name="Implementation-Version" value="${version}" />
</manifest>
</jar>
<jar destfile="${doc.jar}" basedir="${doc.dir}" />
</target>
<target name="copy-lib-jar">
<copy toDir="${distro.dir}">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</copy>
</target>
<target name="-ensure-gems-zip-is-present">
<fail message="Path to gems.zip is required. Provide it like 'ant -Dgems.zip.path=PATH'" unless="gems.zip.path" />
</target>
<target name="distro" depends="jar">
<mkdir dir="${distro.dir}" />
<copy file="${jar.file}" todir="${distro.dir}" />
<copy file="${doc.jar}" todir="${distro.dir}" />
<copy file="LICENSE.txt" todir="${distro.dir}" />
<copy file="README.md" todir="${distro.dir}" />
<copy file="CONTRIBUTORS.txt" todir="${distro.dir}" />
<antcall target="copy-lib-jar" />
<zip basedir="${distro.dir}" includes="**" destfile="${distro.file}" />
</target>
<target name="test" depends="test.compile" >
<mkdir dir="${test.report.dir}" />
<junit fork="true" printSummary="true" showOutput="true" failureProperty="test.failure">
<classpath refid="test.classpath" />
<batchtest fork="true" todir="${test.report.dir}" >
<formatter type="xml" />
<fileset dir="${test.classes.dir}">
<include name="**/*Test.*" />
<include name="**/*IT.*" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${test.report.dir}">
<fileset dir="${test.report.dir}">
<include name="TEST-*.xml" />
</fileset>
<report todir="${test.report.dir}/html" />
</junitreport>
<fail message="test failed" if="test.failure" />
</target>
</project>