-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.xml
163 lines (145 loc) · 4.54 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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [<!ENTITY common SYSTEM "common.xml">]>
<project name="erwiz" default="jar" basedir=".">
<import file="properties.xml"/>
<target name="jar" depends="build-src">
<copy todir="${class_dir}">
<fileset dir="${src_dir}" excludes="**/*.java"/>
</copy>
<mkdir dir="${jar_dir}"/>
<jar jarfile="${jar_dir}/${jar_name}" basedir="${class_dir}">
<manifest>
<attribute name="Main-Class" value="${main_class}"/>
</manifest>
</jar>
</target>
<target name="build-src" depends="clean-classes">
<javac srcdir="${src_dir}" destdir="${class_dir}" source="1.6" target="1.6" fork="true"/>
</target>
<target name="build-all-all-for-release" depends="clean-all,jar,htmldoc">
</target>
<target name="clean-classes">
<delete dir="${class_dir}"/>
<mkdir dir="${class_dir}"/>
</target>
<target name="clean-all" depends="clean-classes,package:clean">
<delete dir="${javadoc_dir}"/>
<delete dir="${htmldoc_dir}"/>
<delete dir="${jar_dir}"/>
</target>
<target name="javadoc">
<javadoc
sourcepath="${src_dir}"
destdir="${javadoc_dir}"
source="1.6"
locale="en_US"
encoding="utf-8"
charset="utf-8"
access="package"
author="false"
nodeprecated="false"
nodeprecatedlist="false"
noindex="false"
nonavbar="false"
notree="false"
splitindex="true"
use="true"
version="true"
/>
</target>
<target name="htmldoc" depends="webserver:launch">
<delete dir="${htmldoc_dir}" />
<delete dir="127.0.0.1:7777" />
<exec executable="wget">
<arg value="-r"/>
<arg value="http://127.0.0.1:7777"/>
</exec>
<move todir="htmldoc">
<fileset dir="127.0.0.1:7777"/>
</move>
</target>
<!-- webserver launching/stopping targets -->
<target name="webserver:launch">
<exec executable="mkdir">
<arg value="-p"/>
<arg value="/tmp/erwiz"/>
</exec>
<exec executable="ln">
<arg value="-s"/>
<arg value="${basedir}/docs/docroot"/>
<arg value="/tmp/erwiz"/>
</exec>
<exec executable="lighttpd">
<arg value="-f${basedir}/docs/lighttpd.conf"/>
</exec>
</target>
<target name="webserver:stop">
<exec executable="pkill">
<arg value="lighttpd"/>
</exec>
<exec executable="rm">
<arg value="-rf"/>
<arg value="/tmp/erwiz/docroot"/>
</exec>
</target>
<!-- Release packaging -->
<target name="package:clean">
<delete dir="${package}"/>
<mkdir dir="${package:bin}"/>
<mkdir dir="${package:src}"/>
</target>
<!-- Package means put all the files together in one directory which
will be the base for the release process.
-->
<target name="package" depends="build-all-all-for-release,package:clean,package:dist:bin,package:dist:src">
<ant antfile="release.xml" target="release:single" />
</target>
<target name="package:dist:bin">
<copy todir="${package:bin}/doc/htmldoc">
<fileset dir="htmldoc"/>
</copy>
<mkdir dir="${package:bin}/manpage"/>
<!--<gzip src="docs/erwiz.1" destfile="${package:bin}/manpage/erwiz.1.gz"/>-->
<copy file="docs/erwiz.1" todir="${package:bin}/manpage"/>
<copy todir="${package:bin}/doc/examples">
<fileset dir="examples"/>
</copy>
<copy todir="${package:bin}/jar">
<fileset dir="jar"/>
</copy>
<copy todir="${package:bin}/bin">
<fileset dir="bin"/>
</copy>
<exec executable="chmod">
<arg line="-R 755 ${package:bin}/bin"/>
</exec>
<copy file="readme.txt" todir="${package:bin}"/>
<copy file="authors.txt" todir="${package:bin}"/>
<copy file="license.txt" todir="${package:bin}"/>
</target>
<target name="package:dist:src">
<copy todir="${package:src}/doc/htmldoc">
<fileset dir="htmldoc"/>
</copy>
<copy todir="${package:src}/doc/examples">
<fileset dir="examples"/>
</copy>
<mkdir dir="${package:bin}/manpage"/>
<copy file="docs/erwiz.1" todir="${package:src}/manpage"/>
<copy todir="${package:src}/src">
<fileset dir="src"/>
</copy>
<copy todir="${package:src}/bin">
<fileset dir="bin"/>
</copy>
<exec executable="chmod">
<arg line="-R 755 ${package:src}/bin"/>
</exec>
<copy file="readme.txt" todir="${package:src}"/>
<copy file="authors.txt" todir="${package:src}"/>
<copy file="license.txt" todir="${package:src}"/>
<copy file="build.xml" todir="${package:src}"/>
<copy file="properties.xml" todir="${package:src}"/>
<copy file="app_info.properties" todir="${package:src}"/>
</target>
</project>