-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.xml
95 lines (77 loc) · 3.26 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
<?xml version="1.0" encoding="UTF-8"?>
<project default="integration-test" basedir="." name="jsdoc-toolkit">
<property file="build.properties" />
<target name="clean" description="Clean up">
<delete dir="${build.dir}" />
</target>
<target name="init" description="Init tasks" depends="clean">
<mkdir dir="${build.dir}" />
</target>
<target name="compile" description="Compile source files" depends="init">
<mkdir dir="${bin.dir}" />
<javac srcdir="${src.dir}" destdir="${bin.dir}" classpath="${ant.jar.location}:${rhino.jar.location}" />
</target>
<target name="javadoc" depends="clean, init">
<javadoc sourcepath="${src.dir}" destdir="${docs.dir}" classpath="${ant.jar.location}:${rhino.jar.location}" />
</target>
<target name="package" description="Create a JAR of the JsDoc Toolkit ant task" depends="compile, javadoc">
<jar destfile="${jar.location}">
<fileset dir="${bin.dir}" />
<manifest>
<attribute name="Built-By" value="Darren Hurley"/>
</manifest>
</jar>
</target>
<!-- test jar -->
<target name="integration-test" depends="package" description="Run some tests using our newly create JAR">
<echo>Using:</echo>
<echo> * Java: ${ant.java.version}</echo>
<echo> * Ant: ${ant.version}r</echo>
<echo> * Rhino: ${rhino.version}</echo>
<taskdef name="jsdoctoolkit" classname="uk.co.darrenhurley.ant.tasks.JsDocToolkit" classpath="${jar.location}:${rhino.jar.location}"/>
<!-- basic test -->
<jsdoctoolkit jsdochome="${jsdoc.home}"
template="jsdoc"
outputdir="${report.dir}/testone"
inputdir="${integration.test.dir}" />
<!-- nested source element test -->
<jsdoctoolkit jsdochome="${jsdoc.home}"
template="jsdoc"
outputdir="${report.dir}/testtwo">
<source file="${integration.test.dir}" />
</jsdoctoolkit>
<!-- nested fileset element test -->
<jsdoctoolkit jsdochome="${jsdoc.home}"
template="jsdoc"
outputdir="${report.dir}/testthree">
<fileset dir="${integration.test.dir}" />
</jsdoctoolkit>
<!-- nested arg element test -->
<jsdoctoolkit jsdochome="${jsdoc.home}"
template="jsdoc"
outputdir="${report.dir}/testfour/"
inputdir="${integration.test.dir}">
<arg name="testName" value="testValue" />
</jsdoctoolkit>
<!-- nested filelist element test -->
<jsdoctoolkit jsdochome="${jsdoc.home}"
template="jsdoc"
outputdir="${report.dir}/testfive">
<filelist dir="${integration.test.dir}" files="test.js" />
</jsdoctoolkit>
<!-- test arguments -->
<jsdoctoolkit jsdochome="${jsdoc.home}"
template="jsdoc"
outputdir="${report.dir}/testsix">
<source file="${integration.test.dir}/test.js" />
<arg name="copyright" value="TEST TEST TEST"/>
</jsdoctoolkit>
<!-- multiple fileset elements test -->
<jsdoctoolkit jsdochome="${jsdoc.home}"
template="jsdoc"
outputdir="${report.dir}/testseven">
<fileset dir="${integration.test.dir}/js-one" />
<fileset dir="${integration.test.dir}/js-two" />
</jsdoctoolkit>
</target>
</project>