File: build.xml

package info (click to toggle)
libjdic-java 0.9.5-2
  • links: PTS, VCS
  • area: contrib
  • in suites: lenny
  • size: 2,704 kB
  • ctags: 2,027
  • sloc: java: 8,666; xml: 3,843; cpp: 3,435; ansic: 653; sh: 318; makefile: 213
file content (312 lines) | stat: -rwxr-xr-x 12,189 bytes parent folder | download | duplicates (2)
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
<?xml version="1.0"?>
<project name="JDIC Packager building script" default="showtargets" basedir=".">

<!--
This is the master build script for use with the Jakarta Ant build tool 
to build the source code of JDIC project.

For Ant, see http://jakarta.apache.org/ant/index.html

Top-level target:
  buildall:         Build a JDIC Packager distribution for the current platform. 
                    Which will run one of below targets:
    buildwin32:     on Windows to build a Windows distribuition.
    buildlinux:     on Linux to build a Linux distribuition.
    buildsolaris:   on Solaris to build a Solaris distribuition.
  clean:            Remove the generated distribution (including files and directories).

-->

  <!-- the top-level package name -->
  <property name="pkg.packager.name" value="org.jdesktop.jdic.packager" /> 

  <!-- the path of source directory -->
  <property name="src.dir" value="src" />

  <property name="unix.dir"            value="${src.dir}/unix" />
  <property name="solaris.dir"         value="${src.dir}/solaris" />  
  <property name="share.classes.dir"   value="${src.dir}/share/classes" />
  <property name="unix.classes.dir"    value="${unix.dir}/classes" />
  <property name="solaris.classes.dir" value="${solaris.dir}/classes" />
  <property name="win32.classes.dir"   value="${src.dir}/win32/classes" />

  <!-- the generated class directory -->
  <property name="org.packager.impl.dir"       value="org/jdesktop/jdic/packager/impl" /> 
  <property name="org.packager.impl.files.dir" value="${org.packager.impl.dir}/files" />  

  <!-- only Win32 has native code -->
  <property name="win32.native.dir"       value="${src.dir}/win32/native" />
  <property name="win32.msiactions.dir"   value="${src.dir}/win32/msiactions" />
  <property name="win32.script.dir"       value="${src.dir}/win32/script" />
  <property name="win32.bootstrapper.dir" value="${src.dir}/win32/bootstrapper" />
  <property name="win32.files.dir"        value="${src.dir}/win32/files" />

  <!-- <property name="dist.dir" value="dist" /> -->

  <property name="jar.file" value="packager.jar" />

  <!-- the distribution version and release of this build -->
  <!-- which is only used in javadoc target -->
  <property name="version" value="0.9" />
  <property name="release" value="1" />

  <target name="showtargets" description="default target showing all available targets">
    <echo>The top-level targets are:</echo>
    <echo>  buildall:   Build a distribution for the current platform</echo>
    <echo>              (Windows, Linux or Solaris).</echo>
    <echo>  clean:      Remove the generated distribution.</echo>
    <echo></echo>
    <echo>  The generated distribution is put under *dist* directory.</echo>
  </target>

  <!--
    - SHARED TARGETS FOR WIN32/LINUX/SOLARIS DISTRIBUTIONS
    -->
  <target name="init" description="the init target">
    <!-- Create the time stamp -->
    <tstamp/>

    <!-- Set platform-dependent distribution directory -->
    <!-- ${file.separator} is "\" on Windows, and "/" on Unix -->
    <condition property="dist.dir" value="dist${file.separator}windows">
      <os family="windows" />      
    </condition> 

    <condition property="dist.dir" value="dist/linux">
      <os name="linux"/>      
    </condition> 

    <condition property="dist.dir" value="dist/solaris">
      <os name="sunos"/>      
    </condition> 

    <!-- Create the distribution directory -->
    <mkdir dir="${dist.dir}" />   

    <echo>++++++++++++++++++++++++++++++++++++++++++++++++++++</echo>
    <echo>+ JDIC Packager build version ${version} release ${release}</echo>
    <echo>+ The distribution directory is: .${file.separator}${dist.dir}${file.separator}</echo> 
    <echo>++++++++++++++++++++++++++++++++++++++++++++++++++++</echo>
  </target>

  <!-- *** Set the platform-dependent targets to build a distribution,
           which is ONLY used by buildall target. *** -->
  <target name="setplatformtarget"
          description="set platform-dependent distribution targets.">
    <condition property="platform.target" value="buildwin32">
      <os family="windows" />      
    </condition> 

    <condition property="platform.target" value="buildlinux">
      <os name="linux"/>      
    </condition> 

    <condition property="platform.target" value="buildsolaris">
      <os name="sunos"/>      
    </condition>  

    <condition property="platform.target" value="buildfreebsd">
      <os name="freebsd"/>
    </condition> 

    <condition property="platform.target" value="buildfreebsd">
      <os name="freebsd"/>
    </condition> 

    <condition property="platform.target" value="buildmac_os_x">
      <os name="Mac OS X" />      
    </condition>     
  </target>

  <!-- *** Top-level target *** -->
  <!-- *** Clean the distribution directory *** -->
  <target name="clean" depends="init"
          description="clean up the built directory and files">
    <delete includeEmptyDirs="true" failonerror="false">
      <fileset dir="${dist.dir}"/>
    </delete>
  </target>

  <!-- *** Top-level target *** -->
  <!-- *** Build a JDIC Packager distribution for the current platform *** -->
  <target name="buildall" depends="setplatformtarget"
          description="build a distribution for the current platform.">
    <!-- Execute the ${platform.target} target in this file,
         which is buildwin32, buildlinux, buildsolaris or buildfreebsd. -->
    <ant target="${platform.target}"/>
  </target>

  <!-- *** javadoc *** -->
  <!-- disable author and version tags output -->
  <target name="javadoc" depends="init"
          description="generate javadoc into ${dist.dir}/javadoc" >
    <javadoc packagenames="${pkg.packager.name}"
             sourcepath="${share.classes.dir}"
             destdir="${dist.dir}/javadoc"
             author="false"
             version="false"
             use="true"
             Windowtitle="JDIC Packager API V${version} Release ${release}"
             Header="JDIC Packager API V${version} Release ${release}">
             <docTitle><![CDATA[JDIC (JDesktop Integration Components) 
               <br> Packager API Specification, Version ${version} Release ${release}]]></docTitle>
             <bottom><![CDATA[<font size="-1">For more information and documentation on JDIC, 
               see <a href="https://jdic.dev.java.net">JDIC website</a>. <p>That documentation 
               contains more detailed, developer-targeted descriptions, with conceptual 
               overviews, working code examples, license terms and bug report information.
               <p>Copyright (c) 2004 Sun Microsystems, Inc. All rights reserved. Use is 
               subject to <a href=
               "https://jdic.dev.java.net/source/browse/jdic/src/COPYING">license terms</a>. 
               </font>]]></bottom>
    </javadoc>
  </target>

  <!--
    - WIN32 DISTRIBUTION
    -->     
  <target name="buildwin32" depends="buildwin32jar, javadoc"
          description="build all the class and native source code" >
  </target>

  <!-- BE CAREFUL !!! Since the jar file includes generated native files,
       it MUST depends on buildwin32native target -->
  <target name="buildwin32jar" depends="init, buildwin32native"
          description="build the classes and jar file." >
    <javac srcdir="${share.classes.dir}:${win32.classes.dir}"
           destdir="${dist.dir}"
           classpath="${dist.dir}" 
    />

    <jar destfile="${dist.dir}/${jar.file}" update="false">
         <fileset dir="${dist.dir}" includes="org/**/*.class, org/**/files/*" />
    </jar>

    <!-- remove the generated "org" directory -->
    <delete includeEmptyDirs="true" failonerror="false">
      <fileset dir="${dist.dir}/org"/>
    </delete>
  </target>

  <!-- ***  Build Win32 native code *** -->
  <target name="buildwin32native" depends="init"
          description="only Win32 has native code." >
    <!-- Execute nmake to generate the .dll files -->
    <exec dir="${win32.native.dir}" executable="nmake" >
        <arg line="/f packager.mak CFG='packager - Win32 Release'"/>
    </exec>
    
    <exec dir="${win32.script.dir}" executable="nmake" >    
      <arg line="/f jnlp2msi.mak CFG='jnlp2msi - Win32 Release'"/>
    </exec>        
    
    <exec dir="${win32.msiactions.dir}" executable="nmake" />    
    
    <exec dir="${win32.bootstrapper.dir}" executable="nmake" >
      <arg line="/f bootstrapper.mak CFG='bootstrapper - Win32 Release'"/>
    </exec>    

    <!-- Copy WinMSIWrapper.dll & jnlp2msi.exe to the dist dir -->
    <copy file="${win32.native.dir}/Release/WinMsiWrapper.dll" todir="${dist.dir}" />
    <copy file="${win32.script.dir}/Release/jnlp2msi.exe" todir="${dist.dir}" />
   
    <!-- Copy custom.dll & bootstrapper.exe to the files directory -->
    <copy file="${win32.msiactions.dir}/Release/MsiActions.dll" 
      tofile="${win32.files.dir}/custom.dll" />
    <copy file="${win32.bootstrapper.dir}/Release/bootstrapper.exe" 
      tofile="${win32.files.dir}/bootstrapper.exe" />

    <!-- Create the directory for the msi support files -->
    <mkdir dir="${dist.dir}/${org.packager.impl.files.dir}" />   
    <!-- Copy msi support files for packaging into jar files-->  
    <copy todir="${dist.dir}/${org.packager.impl.files.dir}">
      <fileset dir="${win32.files.dir}" includes="*.*"/>
    </copy>
  </target>

  <!--
    - LINUX DISTRIBUTION
    -->
  <target name="buildlinux" depends="buildlinuxjar, javadoc, cplinuxscript"
          description="build all the class and native source code" >
  </target>

  <target name="buildlinuxjar" depends="init"
          description="build the classes and jar file." >
    <javac srcdir="${share.classes.dir}:${unix.classes.dir}"
           destdir="${dist.dir}"
           classpath="${dist.dir}" 
    />

    <jar destfile="${dist.dir}/${jar.file}" update="false">
         <fileset dir="${dist.dir}" includes="org/**/*.class"/>
    </jar>

    <!-- remove the generated "org" directory -->
    <delete includeEmptyDirs="true" failonerror="false">
      <fileset dir="${dist.dir}/org"/>
    </delete>
  </target>

  <!-- Copy the command-line packaging script -->
  <target name="cplinuxscript" depends="init"
          description="copy the command-line packaging script." >
    <copy file="${unix.dir}/jnlp2rpm" todir="${dist.dir}" />

    <!-- Note: the executable permission of jnlp2rpm is not retained 
         using Ant Copy, add executable mode.
    -->
    <chmod dir="${dist.dir}" perm="+x" includes="jnlp2rpm" />
  </target>

  <!--
    - SOLARIS DISTRIBUTION
    -->
  <target name="buildsolaris" depends="buildsolarisjar, javadoc, cpsolarisscript"
          description="build all the class and native source code" >
  </target>

  <target name="buildsolarisjar" depends="init"
          description="build the classes and jar file." >
    <javac srcdir="${share.classes.dir}:${solaris.classes.dir}"
           destdir="${dist.dir}"
           classpath="${dist.dir}" 
    />

    <jar destfile="${dist.dir}/${jar.file}" update="false">
         <fileset dir="${dist.dir}" includes="org/**/*.class"/>
    </jar>

    <!-- remove the generated "org" directory -->
    <delete includeEmptyDirs="true" failonerror="false">
      <fileset dir="${dist.dir}/org"/>
    </delete>
  </target>

  <!-- Copy the command-line packaging script -->
  <target name="cpsolarisscript" depends="init"
          description="copy the command-line packaging script." >
    <copy file="${solaris.dir}/jnlp2pkg" todir="${dist.dir}" />

    <!-- Note: the executable permission of jnlp2pkg is not retained 
         using Ant Copy, add executable mode.
    -->
    <chmod dir="${dist.dir}" perm="+x" includes="jnlp2pkg" />
  </target>

  <!--
    - FREEBSD DISTRIBUTION
    -->
  <target name="buildfreebsd"
          description="build all the class and native source code" >
    <echo>JDIC Packager hasn't been ported to FreeBSD platform.</echo>
  </target>

  <!--
    - MAC OS X DISTRIBUTION
    -->
  <target name="buildmac_os_x"
          description="build all the class and native source code" >
    <echo>JDIC Packager hasn't been ported to Mac OS X platform.</echo>
  </target>

</project>