root/tags/OMERO.insight_3_Beta1/build/build.xml
| Revision 4729, 7.5 kB (checked in by jburel, 22 months ago) | |
|---|---|
|
|
| Line | |
|---|---|
| 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | |
| 3 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 4 | * Master build file for the OMERO.insight java client. |
| 5 | * You can use this file to compile, run, test, and package the application |
| 6 | * for distribution. Furthermore, you can generate all other project artifacts, |
| 7 | * like documentation. Please refer to the usage target for further details. |
| 8 | * |
| 9 | * |
| 10 | * DEPENDENCIES |
| 11 | * This is an Ant build file and requires Ant 1.6 or later to run the build. |
| 12 | * Furthermore, all the libraries listed in the lib.xml header have to be |
| 13 | * available to Ant. |
| 14 | * There are several ways to link those libraries to the Ant's runtime, ranging |
| 15 | * from the -lib switch on the Ant's command line to placing the jars under |
| 16 | * {ANT_HOME}/lib or, even better, under {YOUR_HOME}/.ant/lib. Please refer |
| 17 | * to the Ant manual for details. |
| 18 | * |
| 19 | * |
| 20 | * CHILD BUILD FILES |
| 21 | * The various activities that make up the build process have been factored in |
| 22 | * several child build files within this directory. This master build file is |
| 23 | * responsible for pulling them together in the right order. Child build files |
| 24 | * are required to: |
| 25 | * |
| 26 | * + Define a project name after the file name. For example the project name |
| 27 | * of the child build in 'app.xml' is 'app'. |
| 28 | * + Define a properties namespace. This is done by prefixing all properties |
| 29 | * defined within the child file with the child project's name. This is |
| 30 | * important to avoid collisions, as Ant properties are global. |
| 31 | * + Check for availability of external properties. If a child depends on |
| 32 | * properties defined elsewhere (another child file/master file), then it |
| 33 | * has to explicitly check that those properties have been defined and error |
| 34 | * if some is missing. The checks are performed through checkdef tasks |
| 35 | * placed at the beginning of the file and outside of any target. This way, |
| 36 | * a broken dependency graph is likely to show up at import time in the |
| 37 | * master build file. |
| 38 | * + Have a 'clean' target. This target has to remove all output generated by |
| 39 | * the child's targets. |
| 40 | * + Have a 'usage' target. This target echoes the list of available targets. |
| 41 | * That is, the list of all public targets within the child build. |
| 42 | * + Use the same conventions to denote public targets. The conventions are |
| 43 | * simple: public targets have a description attribute (private targets do |
| 44 | * not) and are listed by the usage target. |
| 45 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> |
| 46 | <project name="OMERO.insight" default="usage" basedir="../"> |
| 47 | |
| 48 | <description>The OMERO.insight Java Client Project.</description> |
| 49 | |
| 50 | <!-- The build directory. Every target outputs below this directory. --> |
| 51 | <property name="build.dir" location="OUT"/> |
| 52 | |
| 53 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 54 | * The following properties define the mappings to the artifacts relevant |
| 55 | * to the build. These artifacts are contained in the local SVN repository |
| 56 | * hosting this build file. Here's a short description of contents of the |
| 57 | * SVN dirs that are relevant to the build: |
| 58 | * + root dir: Contains the license file. |
| 59 | * + build: Contains this master build file and all its children. |
| 60 | * + config: Container and agents configuration files. |
| 61 | * + docgen: Documentation artifacts used to build actual documents. |
| 62 | * + launch: Scripts for launching the app and install instructions. |
| 63 | * + LIB: All jars required by the app. Its test sub-dir contains |
| 64 | * additional jars required by the test code. |
| 65 | * + SRC: All java source files and app resources. |
| 66 | * + TEST: All test code and relative resources. |
| 67 | * |
| 68 | * NOTE: The root namespace for properties defined in the master build file |
| 69 | * is 'base'. |
| 70 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> |
| 71 | <property name="base.build.dir" location="build"/> |
| 72 | <property name="base.config.dir" location="config"/> |
| 73 | <property name="base.launch.dir" location="launch"/> |
| 74 | <property name="base.lib.dir" location="LIB"/> |
| 75 | <property name="base.src.dir" location="SRC"/> |
| 76 | <property name="base.test.dir" location="TEST"/> |
| 77 | <property name="base.test.lib.dir" location="${base.lib.dir}/test"/> |
| 78 | <property name="base.licensefile" location="legal/gpl.txt"/> |
| 79 | <property name="base.docgen.index.file" location="docgen/index.html"/> |
| 80 | <property name="base.userdocs.index.file" |
| 81 | location="docgen/xdocs/docs/userdocs/index.html"/> |
| 82 | <property name="base.docgen.javadoc.cssfile" |
| 83 | location="docgen/javadoc/stylesheet.css"/> |
| 84 | <property name="base.docgen.xdocs.dir" location="docgen/xdocs"/> |
| 85 | <property name="base.docgen.xdocs.cssfile" |
| 86 | location="docgen/xdocs/styles/style.css"/> |
| 87 | <property name="base.docgen.xdocs.stylefile" |
| 88 | location="docgen/xdocs/styles/style.xml"/> |
| 89 | <property name="base.docgen.xdocs.xsl.dir" location="docgen/xdocs/xsl"/> |
| 90 | <property name="base.docgen.xdocs.navig.dir" location="docgen/xdocs/navig"/> |
| 91 | |
| 92 | |
| 93 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 94 | * Include the tasks lib and all children. |
| 95 | * The inclusion order is important because some child files depend on |
| 96 | * properties defined by others and all child files check for the needed |
| 97 | * external properties at import time. |
| 98 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> |
| 99 | <typedef file="${base.build.dir}/lib.xml"/> |
| 100 | <import file="${base.build.dir}/app.xml"/> |
| 101 | <import file="${base.build.dir}/test.xml"/> |
| 102 | <import file="${base.build.dir}/docs.xml"/> |
| 103 | <import file="${base.build.dir}/dist.xml"/> |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 109 | * Set the timestamp and create the build directory where all output will go. |
| 110 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> |
| 111 | <target name="init"> |
| 112 | <tstamp/> |
| 113 | <mkdir dir="${build.dir}"/> |
| 114 | </target> |
| 115 | |
| 116 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 117 | * Build, test, and package the app. |
| 118 | * We first remove any previous build artifact, then we go through the main |
| 119 | * trunk of the build process until the default app bundle is produced. |
| 120 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> |
| 121 | <target name="all" |
| 122 | depends="clean,dist" |
| 123 | description="Build, test, and package the app."> |
| 124 | </target> |
| 125 | |
| 126 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 127 | * Remove all output generated by the last build. |
| 128 | * This target first forwards a clean to all children and then deletes the |
| 129 | * ${build.dir}. |
| 130 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> |
| 131 | <target name="clean" |
| 132 | depends="app.clean,test.clean,dist.clean,docs.clean" |
| 133 | description="Remove all output generated by last build."> |
| 134 | <delete dir="${build.dir}"/> |
| 135 | </target> |
| 136 | |
| 137 | <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 138 | * Output a list of all available targets. |
| 139 | * This is the list of all public targets available through this file or |
| 140 | * any of the imported child files. |
| 141 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--> |
| 142 | <target name="usage" |
| 143 | depends="app.usage,test.usage,docs.usage,dist.usage" |
| 144 | description="List all available targets."> |
| 145 | <echo level="info"> |
| 146 | Global targets: |
| 147 | --------------- |
| 148 | all: Build, test, and package the app under ${dist.dir}. |
| 149 | clean: Remove all output generated by the last build. |
| 150 | </echo> |
| 151 | </target> |
| 152 | |
| 153 | </project> |
Note: See TracBrowser
for help on using the browser.
