summaryrefslogtreecommitdiffstats
path: root/pki/base/console/build.xml
blob: a6ae9ea6997b0e5cae4d6b36ad70e65fc06f41f7 (plain)
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!-- ### BEGIN COPYRIGHT BLOCK ###
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; version 2 of the License.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along
  with this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

  Copyright (C) 2007 Red Hat, Inc.
  All rights reserved.
     ### END COPYRIGHT BLOCK ### -->
<project name="console" default="main" basedir=".">

    <import file="config/product.xml"/>
    <import file="config/product-ext.xml" optional="true"/>

    <property name="jss.home" value="${jni-jar.home}${dirsec}"/>
    <property name="jss.jar" value="${jss.home}/jss4.jar"/>
    <property name="ldapjdk.jar" value="${jar.home}/ldapjdk.jar"/>
    <property name="base.jar" value="${jar.home}/idm-console-base.jar"/>
    <property name="mcc.jar" value="${jar.home}/idm-console-mcc.jar"/>
    <property name="mcc_en.jar" value="${jar.home}/idm-console-mcc_en.jar"/>
    <property name="nmclf.jar" value="${jar.home}/idm-console-nmclf.jar"/>
    <property name="nmclf_en.jar" value="${jar.home}/idm-console-nmclf_en.jar"/>
    <property name="nsutil.jar" value="${pki-jar.home}/nsutil.jar"/>

    <path id="classpath">
        <pathelement location="${jss.jar}"/>
        <pathelement location="${ldapjdk.jar}"/>
        <pathelement location="${nsutil.jar}"/>
        <pathelement location="${base.jar}"/>
        <pathelement location="${mcc.jar}"/>
        <pathelement location="${mcc_en.jar}"/>
        <pathelement location="${nmclf.jar}"/>
        <pathelement location="${nmclf_en.jar}"/>
    </path>


    <target name="clean"
            depends=""
            description="--> remove component directories">
        <echo message="${begin.clean.log.message}"/>
        <delete dir="${dist.base}"/>
        <delete dir="${build.dir}"/>
        <echo message="${end.clean.log.message}"/>
    </target>


    <target name="download"
            depends=""
            description="--> download dependent components">
        <echo message="${begin.download.log.message}"/>
        <echo message="${empty.download.log.message}"/>
        <echo message="${end.download.log.message}"/>
    </target>


    <target name="compile_java"
            depends=""
            description="--> compile java source code into classes">
        <echo message="${begin.compile.java.log.message}"/>
        <mkdir dir="${build.classes}"/>
        <javac debug="on"
               srcdir="${src.dir}/com/netscape"
               destdir="${build.classes}">
            <classpath refid="classpath"/>
        </javac>
        <echo message="${end.compile.java.log.message}"/>
    </target>


    <target name="build_jars"
            depends="compile_java"
            description="--> generate jar files">
        <echo message="${begin.build.jars.log.message}"/>
        <mkdir dir="${build.classes}/com/netscape/admin/certsrv/images"/>
        <copy todir="${build.classes}/com/netscape/admin/certsrv/images">
            <fileset dir="${src.dir}/com/netscape/admin/certsrv/images">
                <include name="*.gif"/>
            </fileset>
        </copy>
        <mkdir dir="${build.jars}"/>
        <jar jarfile="${build.jars}/console-cms-${version}.jar">
            <fileset dir="${build.classes}">
                <include name="com/netscape/**"/>
            </fileset>
        </jar>
        <jar jarfile="${build.jars}/console-cms-${version}_en.jar">
            <fileset dir=".">
                <include name="CMSAdminRS.properties"/>
            </fileset>
        </jar>
        <echo message="${end.build.jars.log.message}"/>
    </target>


    <target name="build_jni_headers"
            depends="compile_java"
            description="--> generate jni header files">
        <echo message="${begin.build.jni.headers.log.message}"/>
        <echo message="${empty.build.jni.headers.log.message}"/>
        <echo message="${end.build.jni.headers.log.message}"/>
    </target>


    <target name="build"
            depends="build_jars,build_jni_headers"
            description="--> build classes, jars, and jni headers">
        <echo message="${notify.build.log.message}"/>
    </target>


    <target name="compile_junit_tests"
            depends="build"
            description="--> compile junit test source code">
        <echo message="${begin.compile.junit.tests.log.message}"/>
        <echo message="${empty.compile.junit.tests.log.message}"/>
        <echo message="${end.compile.junit.tests.log.message}"/>
    </target>


    <target name="run_junit_tests"
            depends="compile_junit_tests"
            description="--> execute junit tests">
        <echo message="${begin.run.junit.tests.log.message}"/>
        <echo message="${empty.run.junit.tests.log.message}"/>
        <echo message="${end.run.junit.tests.log.message}"/>
    </target>


    <target name="verify"
            depends="run_junit_tests"
            description="--> build and execute junit tests">
        <echo message="${notify.verify.log.message}"/>
    </target>


    <target name="clean_javadocs"
            depends=""
            description="--> remove javadocs directory">
        <echo message="${begin.clean.javadocs.log.message}"/>
        <echo message="${empty.clean.javadocs.log.message}"/>
        <echo message="${end.clean.javadocs.log.message}"/>
    </target>


    <target name="compose_javadocs"
            depends="build"
            description="--> generate javadocs">
        <echo message="${begin.compose.javadocs.log.message}"/>
        <echo message="${empty.compose.javadocs.log.message}"/>
        <echo message="${end.compose.javadocs.log.message}"/>
    </target>


    <target name="document"
            depends="clean_javadocs,compose_javadocs"
            description="--> remove old javadocs and compose new javadocs">
        <echo message="${notify.document.log.message}"/>
    </target>


    <target name="distribute_binaries"
            depends="document"
            description="--> create the zip and gzipped tar binary distributions">
        <echo message="${begin.distribute.binaries.log.message}"/>
        <mkdir dir="${dist.base.binaries}"/>

        <echo message="${begin.binary.wrappers.log.message}"/>
        <echo message="${empty.binary.wrappers.log.message}"/>
        <echo message="${end.binary.wrappers.log.message}"/>

        <echo message="${begin.binary.zip.log.message}"/>
        <copy file="./templates/pki_console_wrapper"
              tofile="./build/pkiconsole"/>
        <exec executable="sed">
            <arg value="-i"/>
            <arg value="s/\[PKI_PRODUCT\]/${product.prefix}/g"/>
            <arg value="./build/pkiconsole"/>
        </exec>
        <echo message="${end.binary.zip.log.message}"/>

        <echo message="${begin.binary.tar.log.message}"/>
        <zip destfile="${dist.base.binaries}/${dist.name}.zip">
            <zipfileset dir="./build/jars"
                        filemode="755"
                        prefix="usr/share/java/${product.prefix}">
                <include name="**"/>
            </zipfileset>
            <zipfileset dir="./build"
                        filemode="755"
                        prefix="usr/bin">
                <include name="pkiconsole"/>
            </zipfileset>
            <zipfileset dir="."
                        filemode="755"
                        prefix="usr/share/doc/${product.name}-${version}">
                <include name="LICENSE"/>
            </zipfileset>
        </zip>
        <echo message="${end.binary.tar.log.message}"/>

        <echo message="${begin.binary.gtar.log.message}"/>
        <tar longfile="gnu"
             destfile="${dist.base.binaries}/${dist.name}.tar">
            <tarfileset dir="./build/jars"
                        mode="755"
                        prefix="${dist.name}/usr/share/java/${product.prefix}">
                <include name="**"/>
            </tarfileset>
            <tarfileset dir="./build"
                        mode="755"
                        prefix="usr/bin">
                <include name="pkiconsole"/>
            </tarfileset>
            <tarfileset dir="."
                        mode="755"
                        prefix="${dist.name}/usr/share/doc/${product.name}-${version}">
                <include name="LICENSE"/>
            </tarfileset>
        </tar>
        <echo message="${end.binary.gtar.log.message}"/>

        <echo message="${end.distribute.binaries.log.message}"/>
        <gzip destfile="${dist.base.binaries}/${dist.name}.tar.gz"
              src="${dist.base.binaries}/${dist.name}.tar"/>
        <delete file="${dist.base.binaries}/${dist.name}.tar"/>
        <delete dir="${dist.name}"/>
        <checksum fileext=".md5">
            <fileset dir="${dist.base.binaries}/">
                <include name="**/*"/>
                <exclude name="**/*.asc"/>
                <exclude name="**/*.md5"/>
            </fileset>
        </checksum>
        <checksum fileext=".sha1"
                  algorithm="SHA">
            <fileset dir="${dist.base.binaries}/">
                <include name="**/*"/>
                <exclude name="**/*.asc"/>
                <exclude name="**/*.md5"/>
            </fileset>
        </checksum>
        <echo message="${end.binary.gtar.log.message}"/>

        <echo message="${end.distribute.binaries.log.message}"/>
    </target>


    <target name="distribute_source"
            depends=""
            description="--> create the zip and gzipped tar source distributions">
        <echo message="${begin.distribute.source.log.message}"/>
        <mkdir dir="${dist.base.source}"/>

        <echo message="${begin.source.zip.log.message}"/>
        <zip destfile="${dist.base.source}/${src.dist.name}.zip">
            <zipfileset dir="."
                        filemode="755"
                        prefix="${src.dist.name}">
                <include name="${product.name}.spec"/>
                <include name="LICENSE"/>
                <include name="build.xml"/>
                <include name="CMSAdminRS.properties"/>
                <include name="config/product*.xml"/>
                <include name="config/release*.xml"/>
                <include name="release"/>
                <include name="src/**"/>
                <include name="templates/**"/>
            </zipfileset>
        </zip>
        <echo message="${end.source.zip.log.message}"/>

        <echo message="${begin.source.tar.log.message}"/>
        <tar longfile="gnu"
             destfile="${dist.base.source}/${src.dist.name}.tar">
            <tarfileset dir="."
                        mode="755"
                        prefix="${src.dist.name}">
                <include name="${product.name}.spec"/>
                <include name="LICENSE"/>
                <include name="build.xml"/>
                <include name="CMSAdminRS.properties"/>
                <include name="config/product*.xml"/>
                <include name="config/release*.xml"/>
                <include name="release"/>
                <include name="src/**"/>
                <include name="templates/**"/>
            </tarfileset>
        </tar>
        <echo message="${end.source.tar.log.message}"/>

        <echo message="${begin.source.gtar.log.message}"/>
        <gzip destfile="${dist.base.source}/${src.dist.name}.tar.gz"
              src="${dist.base.source}/${src.dist.name}.tar"/>
        <delete file="${dist.base.source}/${src.dist.name}.tar"/>
        <delete dir="${dist.name}"/>
        <checksum fileext=".md5">
            <fileset dir="${dist.base.source}/">
                <include name="**/*"/>
                <exclude name="**/*.asc"/>
                <exclude name="**/*.md5"/>
            </fileset>
        </checksum>
        <checksum fileext=".sha1"
                  algorithm="SHA">
            <fileset dir="${dist.base.source}/">
                <include name="**/*"/>
                <exclude name="**/*.asc"/>
                <exclude name="**/*.md5"/>
            </fileset>
        </checksum>
        <echo message="${end.source.gtar.log.message}"/>

        <echo message="${end.distribute.source.log.message}"/>
    </target>


    <target name="distribute"
            depends="distribute_binaries,distribute_source"
            description="--> create binary and source component distributions">
        <echo message="${notify.distribute.log.message}"/>
    </target>


    <target name="main"
            depends="clean,distribute"
            description="--> clean, build, verify, document, distribute [default]">
        <echo message="${notify.main.log.message}"/>
    </target>

</project>