-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
210 lines (170 loc) · 7.28 KB
/
build.xml
File metadata and controls
210 lines (170 loc) · 7.28 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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!--
~ Copyright 2006-2013 ICEsoft Technologies Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the
~ License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an "AS
~ IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
~ express or implied. See the License for the specific language
~ governing permissions and limitations under the License.
-->
<project default="build.all" xmlns:ice="urn:ICEsoft">
<property file="build.properties"/>
<property name="build.dir" location="build"/>
<property name="dist.dir" location="dist"/>
<condition property="release.type.suffix" value="-${release.type}" else="">
<not>
<equals arg1="${release.type}" arg2="" trim="true"/>
</not>
</condition>
<property name="bundle.name"
value="${product}-${version.primary}.${version.secondary}.${version.tertiary}${release.type.suffix}"/>
<property name="bin.bundle.name" value="${bundle.name}-bin"/>
<property name="bin.bundle.prefix" value="${bin.bundle.name}/icepdf"/>
<property name="bin.bundle.file"
location="${dist.dir}/${bin.bundle.name}.zip"/>
<property name="src.bundle.name" value="${bundle.name}-src"/>
<property name="src.bundle.prefix" value="${src.bundle.name}/icepdf"/>
<property name="src.bundle.file"
location="${dist.dir}/${src.bundle.name}.zip"/>
<propertyset id="product.info">
<propertyref name="company"/>
<propertyref name="product"/>
<propertyref name="version.primary"/>
<propertyref name="version.secondary"/>
<propertyref name="version.tertiary"/>
<propertyref name="release.type"/>
<propertyref name="build.number"/>
<propertyref name="revision"/>
<propertyref name="manifest.classPath"/>
</propertyset>
<presetdef name="ant" uri="urn:ICEsoft">
<ant inheritall="false"/>
</presetdef>
<presetdef name="subant" uri="urn:ICEsoft">
<subant inheritall="false" failonerror="true" verbose="true"/>
</presetdef>
<presetdef name="zip" uri="urn:ICEsoft">
<zip duplicate="fail" whenempty="fail"/>
</presetdef>
<target name="build.all"
description="Creates ICEpdf source and binary bundles.">
<ice:subant target="build.all">
<fileset dir="./core" includes="build.xml"/>
<fileset dir="./viewer" includes="build.xml"/>
</ice:subant>
</target>
<target name="build.all.extra"
description="Creates ICEpdf extra source and binary bundles.">
<ice:subant target="core-jar">
<fileset dir="./core" includes="build.xml"/>
</ice:subant>
<ice:subant target="extra-jar">
<fileset dir="./core" includes="build.xml"/>
</ice:subant>
<ice:subant target="build.all">
<fileset dir="./viewer" includes="build.xml"/>
</ice:subant>
</target>
<target name="build.bin" description="Creates ICEpdf binary bundle.">
<build.bin.bundle/>
</target>
<target name="zip.src">
<zip.src/>
</target>
<target name="build.bin.bundle" depends="zip.src, build.bin">
<zip.bin.bundle/>
</target>
<target name="build.common">
<ice:subant>
<filelist dir="." files="core, viewer"/>
</ice:subant>
</target>
<target name="build.src.bundle" description="Creates ICEpdf source bundle.">
<touch file="${src.bundle.file}" mkdirs="true"/>
<delete file="${src.bundle.file}"/>
<ice:zip destfile="${src.bundle.file}">
<zipfileset dir="." excludes="dist/" prefix="${src.bundle.prefix}"/>
</ice:zip>
</target>
<target name="build.jars"
description="Creates ICEpdf core and viewer jars.">
<ice:subant target="jar">
<filelist dir="." files="core, viewer"/>
</ice:subant>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<ice:subant target="clean">
<filelist dir="." files="core, viewer"/>
</ice:subant>
</target>
<macrodef name="zip.bin.bundle">
<attribute name="path" default="."/>
<attribute name="bundle.file" default="${bin.bundle.file}"/>
<attribute name="zip.bundle.prefix" default="${bin.bundle.prefix}"/>
<element name="add.zip.elements" optional="true"/>
<sequential>
<ice:zip destfile="@{bundle.file}" update="true">
<zipfileset dir="@{path}/licenses"
prefix="@{zip.bundle.prefix}/licenses"/>
<zipfileset dir="@{path}/lib" excludes=""
prefix="@{zip.bundle.prefix}/lib"/>
<zipfileset dir="@{path}/maven2" excludes=""
prefix="@{zip.bundle.prefix}/maven2"/>
<add.zip.elements/>
</ice:zip>
</sequential>
</macrodef>
<macrodef name="zip.src">
<attribute name="path" default="."/>
<attribute name="zip.bundle.prefix" default="${bin.bundle.prefix}"/>
<attribute name="bundle.file" default="${bin.bundle.file}"/>
<sequential>
<touch file="@{bundle.file}" mkdirs="true"/>
<delete file="@{bundle.file}"/>
<ice:zip destfile="@{bundle.file}">
<zipfileset dir="@{path}" includes="ReadMe.html, examples/"
excludes="**/bin.bundle.properties"
prefix="@{zip.bundle.prefix}"/>
</ice:zip>
</sequential>
</macrodef>
<macrodef name="build.bin.bundle">
<attribute name="path" default="."/>
<attribute name="target" default=""/>
<element name="add.ant.elements" optional="true"/>
<sequential>
<ice:subant target="@{target}">
<filelist dir="@{path}" files="core"/>
<propertyset refid="product.info"/>
</ice:subant>
<ice:subant>
<filelist dir="@{path}" files="viewer"/>
<propertyset refid="product.info"/>
</ice:subant>
<add.ant.elements/>
</sequential>
</macrodef>
<macrodef name="build.src.bundle">
<attribute name="path" default="."/>
<attribute name="bundle.file" default="${src.bundle.file}"/>
<attribute name="bundle.prefix" default="${src.bundle.prefix}"/>
<element name="add.zip.elements" optional="true"/>
<sequential>
<touch file="@{bundle.file}" mkdirs="true"/>
<delete file="@{bundle.file}"/>
<ice:zip destfile="@{bundle.file}">
<zipfileset dir="@{path}" excludes="dist/"
prefix="@{bundle.prefix}"/>
<add.zip.elements/>
</ice:zip>
</sequential>
</macrodef>
</project>