/
build-admin.xml
executable file
·145 lines (120 loc) · 4.47 KB
/
build-admin.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
<!-- ===================================================================
<description>
The build file for the Opal Application Wrapper Web service admin tasks
Notes:
This is a build file for use with the Jakarta Ant build tool.
Prerequisites:
jakarta-ant from http://jakarta.apache.org
Build Instructions:
Modify build.properties
To create source distribution
ant dist
To create documentation from docbook sources
ant docs
Author:
Sriram Krishnan [sriram@sdsc.edu]
</description>
==================================================================== -->
<project default="usage">
<property file="build.properties" />
<property name="name" value="opal-ws" />
<property name="project.home" location="." />
<property name="build" location="${project.home}/build"/>
<property name="build.dist" location="${build}/dist" />
<property name="build.dist.base" location="${build.dist}/${name}-${version}"/>
<property name="doc.src" location="${project.home}/docbook"/>
<property name="doc.dsl" location="${doc.src}/etc"/>
<property name="doc.dest" location="${project.home}/docs"/>
<property name="debug" value="on"/>
<property name="fork" value="true"/>
<!-- print usage -->
<target name="usage">
<echo message="Usage: ant -f build-admin.xml [usage|dist|docs]"/>
</target>
<!-- Create a source distribution -->
<target name="dist" depends="docs">
<!-- create a fresh dist directory -->
<mkdir dir="${build}" />
<delete dir="${build.dist}" />
<mkdir dir="${build.dist.base}" />
<!-- copy over the relevant sources -->
<copy todir="${build.dist.base}">
<fileset dir="${project.home}">
<!-- exclude certain directories -->
<exclude name="**/build/**"/>
<exclude name="TODO"/>
<exclude name="docbook/**"/>
<exclude name="build-admin.xml"/>
<exclude name="**/python/**"/>
<exclude name="data/**"/>
</fileset>
</copy>
<!-- Moving the template file -->
<move file="${build.dist.base}/etc/opal.properties.template" tofile="${build.dist.base}/etc/opal.properties"/>
<move file="${build.dist.base}/build.properties.template" tofile="${build.dist.base}/build.properties"/>
<move file="${build.dist.base}/etc/hibernate-opal.cfg.xml.template" tofile="${build.dist.base}/etc/hibernate-opal.cfg.xml"/>
<!-- adjusting text files to local conventions -->
<fixcrlf srcdir="${build.dist.base}"
eol="lf" eof="remove"
includes="**/*.html,**/*.txt,**/*.sh,**/*.bat,**/*.properties,**/*.xml" />
<!-- make all shell scripts executable -->
<chmod perm="a+x" dir="${build.dist.base}"
includes="**/*.*sh" />
<!-- tar everything up -->
<tar tarfile="${build.dist.base}.tar" longfile="gnu">
<tarfileset dir="${build.dist}" mode="755">
<include name="**/*.*sh"/>
</tarfileset>
<tarfileset dir="${build.dist}" group="nbcr">
<include name="**"/>
<exclude name="**/*.*sh"/>
</tarfileset>
</tar>
<!-- zip the tarfile -->
<gzip zipfile="${build.dist.base}.tar.gz" src="${build.dist.base}.tar" />
<delete file="${build.dist.base}.tar" />
<delete dir="${build.dist.base}" />
</target>
<!-- creation the documentation using docbook -->
<target name="docs">
<!-- delete old docs directory, and create it again -->
<delete dir="${doc.dest}"/>
<mkdir dir="${doc.dest}"/>
<!-- generate the html version of the docs -->
<exec executable="jw">
<arg value="--backend"/>
<arg value="html"/>
<arg value="--dsl"/>
<arg value="${doc.dsl}/rocks.dsl#html"/>
<arg value="--output"/>
<arg value="${doc.dest}"/>
<arg value="${doc.src}/index.sgml"/>
</exec>
<!-- generate the pdf version of the docs -->
<exec executable="jw">
<arg value="--backend"/>
<arg value="pdf"/>
<arg value="--dsl"/>
<arg value="${doc.dsl}/rocks.dsl#print"/>
<arg value="--output"/>
<arg value="${doc.dest}"/>
<arg value="${doc.src}/index.sgml"/>
</exec>
<!-- finish up -->
<move file="${doc.dest}/index.pdf"
tofile="${doc.dest}/opal-referenceguide.pdf"/>
<mkdir dir="${doc.dest}/images"/>
<copy todir="${doc.dest}/images">
<fileset dir="${doc.src}/images">
<!-- include everything -->
<!-- <exclude name="**"/> -->
</fileset>
</copy>
<copy todir="${doc.dest}">
<fileset dir="${doc.src}">
<!-- include rocks.css -->
<include name="rocks.css"/>
</fileset>
</copy>
</target>
</project>