forked from hns/ringojs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
191 lines (171 loc) · 7.86 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<?xml version="1.0"?>
<project name="Helma" default="usage" basedir=".">
<target name="usage">
<echo message=""/>
<echo message="Helma build targets"/>
<echo message=""/>
<echo message=" compile --> compiles the source code to ./build/classes"/>
<echo message=" jar --> generates the ./lib/helma.jar file"/>
<echo message=" test --> run JUnit and Helma tests"/>
<echo message=" apidocs --> generates the API docs"/>
<echo message=" rhinodocs --> generate Javascript API for host classes as JSON file"/>
<echo message=" package --> creates Helma distribution"/>
<echo message=" dpkg --> creates Helma debian package"/>
<echo message=" clean --> clean up compiled resources"/>
</target>
<!-- =================================================================== -->
<!-- Initializes some variables -->
<!-- =================================================================== -->
<target name="init">
<property name="project" value="helma-ng"/>
<property name="version" value="0.3"/>
<property name="home" value="."/>
<property name="src" value="${home}/src"/>
<property name="lib" value="${home}/lib"/>
<property name="build" value="${home}/build"/>
<property name="classes" value="${build}/classes"/>
<property name="docs" value="${home}/docs"/>
<property name="javadocs" value="${home}/docs/api"/>
<property name="helma.jar" value="${lib}/helma.jar"/>
<property name="dpkg.src" value="${home}/deb"/>
<property name="dpkg.tmp" value="${build}/deb"/>
<property name="dpkg.dst" value="${project}_${version}.deb"/>
<property name="debug" value="on"/>
<property name="optimize" value="on"/>
<property name="deprecation" value="on"/>
<property name="testclasses" value=""/>
<path id="classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
<exclude name="helma.jar"/>
</fileset>
<pathelement location="${classes}"/>
</path>
</target>
<!-- =================================================================== -->
<!-- Compiles the source directory -->
<!-- =================================================================== -->
<target name="compile" depends="init">
<mkdir dir="${classes}"/>
<javac srcdir="${src}"
target="1.5"
destdir="${classes}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}">
<!-- compilerarg value="-Xlint"/ -->
<classpath refid="classpath"/>
</javac>
</target>
<!-- =================================================================== -->
<!-- Runs the JUnit and Helma test cases -->
<!-- =================================================================== -->
<target name="test" depends="jar">
<java jar="run.jar" fork="true">
<arg value="test/all"/>
</java>
<junit haltonfailure="true">
<classpath refid="classpath"/>
<formatter type="brief" usefile="false"/>
<batchtest>
<fileset dir="${src}">
<include name="**/*Test*.java"/>
<exclude name="**/AllTests.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- =================================================================== -->
<!-- Creates a jar file in the lib-directory -->
<!-- =================================================================== -->
<target name="jar" depends="compile">
<jar jarfile="${helma.jar}"
basedir="${classes}"
excludes="**/package.html"/>
<jar jarfile="run.jar"
basedir="${classes}"
includes="**/tools/launcher/**"
manifest="${src}/org/helma/tools/launcher/manifest.txt"/>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="apidocs" depends="init">
<mkdir dir="${javadocs}"/>
<javadoc packagenames="org.helma.*"
destdir="${javadocs}"
windowtitle="Helma API"
doctitle="Helma API">
<fileset dir="${src}" includes="**/*.java" />
<classpath refid="classpath"/>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Creates the Rhino/Javascript API documentation as JSON file -->
<!-- =================================================================== -->
<target name="rhinodocs" depends="jar">
<javadoc packagenames="org.helma.web,org.helma.template"
sourcepath="${src}"
doclet="org.helma.tools.RhinoDoclet"
docletpath="${lib}/helma.jar">
<classpath refid="classpath"/>
</javadoc>
<echo message="Javascript documentation generated in docs/core/rhinodoc.js"/>
</target>
<!-- =================================================================== -->
<!-- Create zipped files for distribution -->
<!-- =================================================================== -->
<target name="package" depends="jar,apidocs,test">
<zip zipfile="../${project}-${version}.zip">
<zipfileset dir="${home}" prefix="${project}-${version}"
excludes="classes/**,*.zip,*.o,*.tar,*.tar.gz,**/CVS" />
</zip>
<tar tarfile="../${project}-${version}.tar">
<tarfileset dir="${home}" prefix="${project}-${version}"
excludes="classes/**,*.zip,*.o,*.tar,*.tar.gz,**/CVS" />
</tar>
<gzip src="../${project}-${version}.tar" destfile="../${project}-${version}.tar.gz"/>
<delete file="../${project}-${version}.tar"/>
</target>
<!-- =================================================================== -->
<!-- Create a debian package -->
<!-- =================================================================== -->
<target name="dpkg" depends="jar,test">
<tstamp/>
<mkdir dir="${dpkg.tmp}"/>
<copy todir="${dpkg.tmp}">
<filterset>
<filter token="VERSION" value="${version}"/>
<filter token="DATE" value="${DSTAMP}"/>
</filterset>
<fileset dir="${dpkg.src}"/>
</copy>
<copy todir="${dpkg.tmp}/usr/share/helma/modules">
<fileset dir="${home}/modules"/>
</copy>
<copy todir="${dpkg.tmp}/usr/share/helma/lib">
<fileset dir="${lib}"/>
</copy>
<copy todir="${dpkg.tmp}/usr/share/helma">
<fileset file="run.jar"/>
</copy>
<chmod file="${dpkg.tmp}/usr/bin/helma" perm="ugo+x"/>
<exec executable="dpkg-deb">
<arg value="--build"/>
<arg value="${dpkg.tmp}"/>
<arg value="${dpkg.dst}"/>
</exec>
<!--
<delete dir="${dpkg.tmp}"/>
-->
</target>
<!-- =================================================================== -->
<!-- Clean up compiled resources -->
<!-- =================================================================== -->
<target name="clean" depends="init">
<delete dir="${build}"/>
<delete file="${helma.jar}"/>
<delete file="${dpkg.dst}"/>
<delete file="run.jar"/>
</target>
</project>