• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.clients
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • Last Change
  • Annotate
  • Revision Log

root/tags/OMERO.insight_3_Beta1/build/dist.xml

Revision 4729, 11.9 kB (checked in by jburel, 23 months ago)

replaced OMEROClient by OMERO.insight

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 * Child build file to create the app deliverables.
5 * This file is only meant to be used as an imported file within the
6 * OMERO.insight master build file.
7~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
8<project name="dist" default="usage">
9 
10  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11   * Fail at import time if the external properties this child depends upon
12   * have not been defined.
13  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
14  <checkdef prop="build.dir"/> 
15  <checkdef prop="base.launch.dir"/>
16  <checkdef prop="base.lib.dir"/>
17  <checkdef prop="base.licensefile"/> 
18  <checkdef prop="app.compiled.dir"/> 
19  <checkdef prop="app.config.dir"/> 
20  <checkdef prop="app.lib.dir"/>
21  <checkdef prop="app.mainclass"/>
22  <checkdef ref="app.config"/>
23  <checkdef ref="app.libs"/>
24  <checkdef prop="docs.dir"/> 
25  <checkdef prop="docs.userdocs.dir"/>
26 
27 
28  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29   * Settings to create the deliverables:
30   *   + dist.dir: The distribution directory, where deliverables are created.
31   *   + dist.jar.file: The name of the file in which the whole app will be
32   *           packaged.  This file will be output under ${dist.dir}.
33   *   + dist.bundle.name: The name of the distribution bundle.  This is a
34   *           compressed file containing the app jar, all required libs,
35   *           launch scripts, and install instructions.
36   *   + dist.bundle.version: The version of the distribution bundle.  Together
37   *           with the bundle name, it forms the name of the default bundle
38   *           file as <name>-<version>.zip.  (The extension name is dictated
39   *           by the compression algorithm used.)  Other platform-specific
40   *           bundles follow the same naming convention, except they add a
41   *           platform-specific postfix, like <name>-<version>-OSX.zip for
42   *           the Mac OS X bundle.
43   *   + dist.launch.scripts: All launch scripts to go in the default bundle.
44   *   + dist.installfile: The install instructions to include in the
45   *           default bundle.
46   *   + dist.app.lib.dir.name: The name of the ${app.lib.dir}.
47   *   + dist.app.config.dir.name: The name of the ${app.config.dir}.
48   *   + dist.osx.icon: The icon to use for the Mac OS X client.
49   *   + dist.osx.stub: The stub file for the Mac OS X client.
50   *   + dist.osx.stub.name: The name of the above file.
51   *   + dist.osx.installfile: The install instructions to include in the
52   *           Mac OS X bundle.
53  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 
54  <property name="dist.dir" location="${build.dir}/dist"/>
55  <property name="dist.jar.file" value="omeroinsight.jar"/>
56  <property name="dist.bundle.name" value="omeroinsight"/> 
57  <property name="dist.bundle.version" value="3-M3_Beta_17-01-07"/>
58  <fileset id="dist.launch.scripts" dir="${base.launch.dir}">
59    <include name="*.sh"/>
60    <include name="*.bat"/> 
61  </fileset> 
62  <property name="dist.installfile" 
63            location="${base.launch.dir}/INSTALL.txt"/> 
64  <basename property="dist.app.lib.dir.name" file="${app.lib.dir}"/>
65  <basename property="dist.app.config.dir.name" file="${app.config.dir}"/> 
66  <property name="dist.osx.icon" 
67            location="${base.launch.dir}/osx/omeroinsight.icns"/>
68  <property name="dist.osx.stub" 
69            location="${base.launch.dir}/osx/JavaApplicationStub"/> 
70  <property name="dist.osx.stub.name" value="JavaApplicationStub"/> 
71  <property name="dist.osx.installfile" 
72            location="${base.launch.dir}/osx/INSTALL"/>
73
74
75
76
77  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78    * Verify the app is good for distribution and create ${dist.dir}.
79    * First the whole app and test dirs are removed and then new ones are
80    * re-generated with all app and test code.  Tests are run and if a failure
81    * occurs, the build is halted.  This way, the app can't be released unless
82    * all tests pass. 
83  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
84  <target name="dist-init" depends="app.clean,test.clean,test">
85    <mkdir dir="${dist.dir}"/> 
86  </target> 
87 
88  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89   * Package the whole app into the ${dist.jar.file} under ${dist.dir}.
90   * The whole content of the ${app.compiled.dir} is jar'ed and a suitable
91   * manifest is generated that links all the required libraries.  That is
92   * all libraries defined by app.libs.  The path of each library file is
93   * specified in the Class-Path header to be relative to the ${app.lib.dir}.
94   * For example, an xxx.jar shows up in the header as {lib}/xxx.jar, where
95   * {lib} is the name of the ${app.lib.dir}.
96  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
97  <target name="jar" depends="dist-init">
98    <pathconvert property="dist.jar.manifest.cp" 
99                 pathsep=" " 
100                 dirsep="/" 
101                 refid="app.libs">
102      <map from="${base.lib.dir}" to="${dist.app.lib.dir.name}"/>               
103    </pathconvert>     
104    <jar destfile="${dist.dir}/${dist.jar.file}">
105      <fileset dir="${app.compiled.dir}"/>
106      <manifest>
107        <attribute name="Created-By" value="OMERO Development Team"/>
108        <attribute name="Class-Path" value="${dist.jar.manifest.cp}"/>
109        <attribute name="Main-Class" value="${app.mainclass}"/>
110      </manifest> 
111    </jar>
112  </target> 
113 
114  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115   * Creates the default distribution bundle under ${dist.dir}.
116   * This is a zip file whose name is set to
117   * ${dist.bundle.name}-${dist.bundle.version}.zip
118   * and whose contents are:
119   *   + A config dir, containing all the app.config files.  The dir name is
120   *     set to the name of the ${app.config.dir}.
121   *   + A lib dir, containing all the app.libs files.  The dir name is set
122   *     to the name of the ${app.lib.dir}.
123   *   + The app jar file, ${dist.jar.file}.
124   *   + The launch scripts, dist.launch.scripts.
125   *   + The install instructions, ${dist.installfile}.
126   *   + The license file, ${base.licensefile}.
127  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 
128  <target name="dist"
129          depends="jar"
130          description="Build and package the app for distribution."> 
131    <zip destfile="${dist.dir}/${dist.bundle.name}-${dist.bundle.version}.zip">
132      <zipfileset refid="app.config" prefix="${dist.app.config.dir.name}"/>
133      <zipfileset refid="app.libs" prefix="${dist.app.lib.dir.name}"/> 
134      <fileset dir="${dist.dir}" includes="${dist.jar.file}"/>
135      <zipfileset refid="dist.launch.scripts" filemode="555"/>
136      <fileset file="${dist.installfile}"/>
137      <zipfileset file="${base.licensefile}" fullpath="LICENSE"/> 
138    </zip> 
139  </target>
140 
141  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142   * Creates the Mac OS X distribution bundle under ${dist.dir}.
143   * This is a zip file whose name is set to
144   * ${dist.bundle.name}-${dist.bundle.version}-OSX.zip
145   * and whose contents are:
146   *   + A config dir, containing all the app.config files.  The dir name is
147   *     set to the name of the ${app.config.dir}.
148   *   + The Shoola application.  That is, the .app dir embedding the app
149   *     jar file, all the the app.libs files, and Mac OS X specific config.
150   *   + The install instructions, ${dist.osx.installfile}.
151   *   + The license file, ${base.licensefile}.
152  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 
153  <target name="dist-osx"
154          depends="jar"
155          description="Build and package the app for OS X distribution.">
156    <jarbundler dir="${dist.dir}"
157                name="OMEROinsight"
158                mainclass="${app.mainclass}"
159                version="${dist.bundle.version}"
160                infostring="OMERO.insight Java Client, ${dist.bundle.version}"
161                aboutmenuname="OMERO.insight Java Client"
162                screenmenu="true" 
163                icon="${dist.osx.icon}"
164                stubfile="${dist.osx.stub}" 
165                jvmversion="1.4+"
166                vmoptions="-Xms256M -Xmx512M">
167      <jarfileset refid="app.libs"/>
168      <jarfileset dir="${dist.dir}" includes="${dist.jar.file}"/>
169    </jarbundler> 
170    <zip destfile=
171           "${dist.dir}/${dist.bundle.name}-${dist.bundle.version}-OSX.zip">
172      <zipfileset refid="app.config" prefix="${dist.app.config.dir.name}"/>
173      <fileset dir="${dist.dir}" 
174               includes="OMEROinsight.app/**"
175               excludes="**/${dist.osx.stub.name}"/>
176      <zipfileset file="${dist.osx.stub}" 
177                  fullpath="OMEROinsight.app/Contents/MacOS/${dist.osx.stub.name}"
178                  filemode="555"/> 
179      <fileset file="${dist.osx.installfile}"/>
180      <zipfileset file="${base.licensefile}" fullpath="LICENSE"/> 
181    </zip> 
182  </target> 
183 
184  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
185   * Creates the documentation bundle under ${dist.dir}.
186   * This is a zip file whose name is set to
187   * ${dist.bundle.name}-${dist.bundle.version}-doc.zip
188   * and whose contents are the javadoc and all other project documentation.
189  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 
190  <target name="dist-docs"
191          depends="docs"
192          description="Create the full documentation bundle."> 
193    <mkdir dir="${dist.dir}"/> 
194    <zip 
195      destfile="${dist.dir}/${dist.bundle.name}-${dist.bundle.version}-doc.zip">
196      <fileset dir="${docs.dir}"/>
197    </zip> 
198  </target>
199 
200  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
201   * Creates the user documentation bundle under ${dist.dir}.
202   * This is a zip file whose name is set to
203   * ${dist.bundle.name}-${dist.bundle.version}-userdoc.zip
204   * and whose contents are just those of the ${docs.userdocs.dir}.
205  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> 
206  <target name="dist-user-docs"
207          depends="xdocs"
208          description="Create the user documentation bundle."> 
209    <mkdir dir="${dist.dir}"/> 
210    <zip 
211      destfile="${dist.dir}/${dist.bundle.name}-${dist.bundle.version}-userdoc.zip">
212      <fileset dir="${docs.userdocs.dir}"/>
213    </zip> 
214  </target>
215 
216  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
217   * Remove all output generated by the targets within this file.
218   * This target simply deletes the ${dist.dir}, relying on the fact that all
219   * other targets output under this dir.  As long as dir mapping props stick
220   * to this rule, new targets can be added without modifying this one.
221   * Should a target output dir need to be mapped to a dir outside of
222   * ${dist.dir}, then an explicit delete has to be added here.
223  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
224  <target name="clean"
225          description="Remove all output generated by dist targets.">
226    <delete dir="${dist.dir}"/>
227  </target> 
228 
229  <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230   * Output a list of available targets.
231   * This is the list of all public targets exported by this file.
232  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
233  <target name="usage"
234          description="List available distribution targets.">
235    <echo level="info">
236Distribution targets:
237---------------------
238  dist: Creates the default distribution bundle under ${dist.dir}.
239  dist-osx: Creates the Mac OS X distribution bundle under ${dist.dir}.
240  dist-docs: Create the full documentation bundle under ${dist.dir}.
241  dist-user-docs: Create the user documentation bundle under ${dist.dir}.
242  dist.clean: Remove ${dist.dir}.
243    </echo> 
244  </target> 
245 
246</project> 
Note: See TracBrowser for help on using the browser.

Download in other formats:

  • Plain Text
  • Original Format

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/