1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | |
---|
3 | <!-- $Id: build.xml 1174 2009-09-29 12:19:01Z jari $ --> |
---|
4 | |
---|
5 | <project |
---|
6 | name="IlluminaPlugins" |
---|
7 | default="dist" |
---|
8 | basedir="."> |
---|
9 | |
---|
10 | <!--create this file if you need to override values from properties below --> |
---|
11 | <property file="build.properties" /> |
---|
12 | |
---|
13 | |
---|
14 | <!-- variables used --> |
---|
15 | <property name="name" value="illumina-plugins" /> |
---|
16 | <property name="version" value="1.5pre" /> |
---|
17 | <property name="src" location="src" description="Location of source files" /> |
---|
18 | <property name="build" location="build" description="Location of compiled files" /> |
---|
19 | <property name="dist" location="dist" description="Directory where distribution should be created" /> |
---|
20 | <property name="package" location="package" description="Directory where packaged distribution files are created"/> |
---|
21 | <property name="javac.arg" value="-Xlint:unchecked" /> |
---|
22 | <property name="javac.source" value="1.5" /> |
---|
23 | <property name="javac.target" value="1.5" /> |
---|
24 | <property name="javac.encoding" value="UTF-8" /> |
---|
25 | <property name="depend.jars" |
---|
26 | value="http://base2.thep.lu.se/base/jars/2.12.0" |
---|
27 | description="The location of the BASE core JARs that we depend on" |
---|
28 | /> |
---|
29 | |
---|
30 | <!-- set up classpath for compiling --> |
---|
31 | <path id="classpath"> |
---|
32 | <fileset dir="lib"> |
---|
33 | <include name="**/*.jar" /> |
---|
34 | </fileset> |
---|
35 | </path> |
---|
36 | |
---|
37 | <target name="init"> |
---|
38 | <mkdir dir="${build}" /> |
---|
39 | <mkdir dir="${dist}" /> |
---|
40 | </target> |
---|
41 | |
---|
42 | <target name="clean"> |
---|
43 | <delete failonerror="false" includeemptydirs="true"> |
---|
44 | <fileset dir="${build}" defaultexcludes="no" /> |
---|
45 | <fileset dir="${dist}" defaultexcludes="no" /> |
---|
46 | <fileset dir="${package}" defaultexcludes="no" /> |
---|
47 | </delete> |
---|
48 | </target> |
---|
49 | |
---|
50 | <target |
---|
51 | name="dist" |
---|
52 | depends="clean,build" |
---|
53 | > |
---|
54 | <copy todir="${dist}"> |
---|
55 | <fileset dir="." includes="README*,LICENSE,INSTALL" /> |
---|
56 | <fileset dir="." includes="config/*" /> |
---|
57 | <fileset dir="." includes="contrib/*" /> |
---|
58 | </copy> |
---|
59 | </target> |
---|
60 | |
---|
61 | <target |
---|
62 | name="package" |
---|
63 | depends="dist" |
---|
64 | description="Create binary distribution package" |
---|
65 | > |
---|
66 | <property name="tar.prefix" value="${name}-${version}" /> |
---|
67 | <mkdir dir="${package}" /> |
---|
68 | <tar |
---|
69 | destfile="${package}/${tar.prefix}.tar.gz" |
---|
70 | longfile="gnu" |
---|
71 | compression="gzip" |
---|
72 | > |
---|
73 | <tarfileset |
---|
74 | dir="${dist}" |
---|
75 | mode="755" |
---|
76 | prefix="${tar.prefix}" |
---|
77 | preserveLeadingSlashes="true" |
---|
78 | > |
---|
79 | <include name="**/*.sh" /> |
---|
80 | </tarfileset> |
---|
81 | <tarfileset |
---|
82 | dir="${dist}" |
---|
83 | prefix="${tar.prefix}" |
---|
84 | preserveLeadingSlashes="true" |
---|
85 | > |
---|
86 | <exclude name="**/*.sh" /> |
---|
87 | </tarfileset> |
---|
88 | </tar> |
---|
89 | </target> |
---|
90 | |
---|
91 | <target |
---|
92 | name="build" |
---|
93 | depends="init,checkjar" |
---|
94 | description="Compiles the plugin and put in jar" |
---|
95 | > |
---|
96 | <property name="jar" value="${name}.jar" /> |
---|
97 | <property name="jar.extensions" value="illumina-extensions.jar" /> |
---|
98 | <mkdir dir="${build}" /> |
---|
99 | <javac |
---|
100 | encoding="${javac.encoding}" |
---|
101 | srcdir="${src}" |
---|
102 | destdir="${build}" |
---|
103 | debug="true" |
---|
104 | classpathref="classpath" |
---|
105 | source="${javac.source}" |
---|
106 | target="${javac.target}" |
---|
107 | > |
---|
108 | <compilerarg value="${javac.arg}" /> |
---|
109 | </javac> |
---|
110 | <copy todir="${build}"> |
---|
111 | <fileset dir="." includes="META-INF/*"/> |
---|
112 | </copy> |
---|
113 | <replace token="%%plugins.jar%%" value="${jar}" file="${build}/META-INF/base-plugins.xml" /> |
---|
114 | <jar |
---|
115 | jarfile="${dist}/${jar}" |
---|
116 | basedir="${build}" |
---|
117 | > |
---|
118 | </jar> |
---|
119 | </target> |
---|
120 | |
---|
121 | <target |
---|
122 | name="checkjar" |
---|
123 | description="Checks that the BASE2Core.jar, BASE2Webclient, BASE2CorePlugins.jar and BASE2WSClient.jar exists." |
---|
124 | > |
---|
125 | <available classname="net.sf.basedb.core.Application" |
---|
126 | classpathref="classpath" property="base2core" /> |
---|
127 | <available classname="net.sf.basedb.plugins.ReporterFlatFileImporter" |
---|
128 | classpathref="classpath" property="base2coreplugins" /> |
---|
129 | <available classname="net.sf.basedb.ws.client.SessionClient" |
---|
130 | classpathref="classpath" property="base2wsclient" /> |
---|
131 | <available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory" |
---|
132 | classpathref="classpath" property="base2web" /> |
---|
133 | <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> |
---|
134 | <fail unless="base2coreplugins" message="Can't find BASE2CorePlugins.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> |
---|
135 | <fail unless="base2wsclient" message="Can't find BASE2WSClient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> |
---|
136 | <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> |
---|
137 | <echo>Found BASE2Core.jar, BASE2CorePlugins.jar, BASE2Webclient.jar and BASE2WSClient.jar.</echo> |
---|
138 | </target> |
---|
139 | |
---|
140 | <target |
---|
141 | name="download-lib" |
---|
142 | description="Download BASE2Core.jar, BASE2CorePlugins.jar and BASE2WSClient.jar." |
---|
143 | > |
---|
144 | <echo> |
---|
145 | ------------------------------------------------------- |
---|
146 | NOTE! You may specify a different download location by |
---|
147 | creating the file './build.properties' and |
---|
148 | setting 'depend.jars' to the URL to download from. |
---|
149 | ------------------------------------------------------- |
---|
150 | </echo> |
---|
151 | <download-lib file="BASE2Core.jar" /> |
---|
152 | <download-lib file="BASE2CorePlugins.jar" /> |
---|
153 | <download-lib file="BASE2WSClient.jar" /> |
---|
154 | <download-lib file="BASE2Webclient.jar" /> |
---|
155 | </target> |
---|
156 | |
---|
157 | <macrodef name="download-lib" description="Download BASE core JAR files"> |
---|
158 | <attribute name="file" /> |
---|
159 | <sequential> |
---|
160 | <get |
---|
161 | dest="lib/compile/@{file}" |
---|
162 | src="${depend.jars}/@{file}" |
---|
163 | usetimestamp="true" |
---|
164 | verbose="true" |
---|
165 | ignoreerrors="true" |
---|
166 | /> |
---|
167 | </sequential> |
---|
168 | </macrodef> |
---|
169 | |
---|
170 | </project> |
---|