1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <project |
---|
3 | name="IlluminaPlugins" |
---|
4 | default="dist" |
---|
5 | basedir="."> |
---|
6 | |
---|
7 | <!-- variables used --> |
---|
8 | <property name="name" value="illumina-plugins" /> |
---|
9 | <property name="version" value="1.1" /> |
---|
10 | <property name="src" location="src" description="Location of source files" /> |
---|
11 | <property name="build" location="build" description="Location of compiled files" /> |
---|
12 | <property name="dist" location="dist" description="Directory where distribution should be created" /> |
---|
13 | <property name="package" location="package" description="Directory where packaged distribution files are created"/> |
---|
14 | <property name="javac.arg" value="-Xlint:unchecked" /> |
---|
15 | <property name="javac.source" value="1.5" /> |
---|
16 | <property name="javac.target" value="1.5" /> |
---|
17 | <property name="javac.encoding" value="ISO-8859-1" /> |
---|
18 | |
---|
19 | <!-- set up classpath for compiling --> |
---|
20 | <path id="classpath"> |
---|
21 | <fileset dir="lib"> |
---|
22 | <include name="**/*.jar" /> |
---|
23 | </fileset> |
---|
24 | </path> |
---|
25 | |
---|
26 | <target name="init"> |
---|
27 | <mkdir dir="${build}" /> |
---|
28 | <mkdir dir="${dist}" /> |
---|
29 | </target> |
---|
30 | |
---|
31 | <target name="clean"> |
---|
32 | <delete failonerror="false" includeemptydirs="true"> |
---|
33 | <fileset dir="${build}" defaultexcludes="no" /> |
---|
34 | <fileset dir="${dist}" defaultexcludes="no" /> |
---|
35 | <fileset dir="${package}" defaultexcludes="no" /> |
---|
36 | </delete> |
---|
37 | </target> |
---|
38 | |
---|
39 | <target |
---|
40 | name="dist" |
---|
41 | depends="clean,build" |
---|
42 | > |
---|
43 | <copy todir="${dist}"> |
---|
44 | <fileset dir="." includes="README*,LICENSE,INSTALL" /> |
---|
45 | <fileset dir="." includes="config/*" /> |
---|
46 | </copy> |
---|
47 | </target> |
---|
48 | |
---|
49 | <target |
---|
50 | name="package" |
---|
51 | depends="dist" |
---|
52 | description="Create binary distribution package" |
---|
53 | > |
---|
54 | <property name="tar.prefix" value="${name}-${version}" /> |
---|
55 | <mkdir dir="${package}" /> |
---|
56 | <tar |
---|
57 | destfile="${package}/${tar.prefix}.tar.gz" |
---|
58 | longfile="gnu" |
---|
59 | compression="gzip" |
---|
60 | > |
---|
61 | <tarfileset |
---|
62 | dir="${dist}" |
---|
63 | mode="755" |
---|
64 | prefix="${tar.prefix}" |
---|
65 | preserveLeadingSlashes="true" |
---|
66 | > |
---|
67 | <include name="**/*.sh" /> |
---|
68 | </tarfileset> |
---|
69 | <tarfileset |
---|
70 | dir="${dist}" |
---|
71 | prefix="${tar.prefix}" |
---|
72 | preserveLeadingSlashes="true" |
---|
73 | > |
---|
74 | <exclude name="**/*.sh" /> |
---|
75 | </tarfileset> |
---|
76 | </tar> |
---|
77 | </target> |
---|
78 | |
---|
79 | <target |
---|
80 | name="build" |
---|
81 | depends="init,checkjar" |
---|
82 | description="Compiles the plugin and put in jar" |
---|
83 | > |
---|
84 | <property name="jar" value="${name}.jar" /> |
---|
85 | <mkdir dir="${build}" /> |
---|
86 | <javac |
---|
87 | encoding="${javac.encoding}" |
---|
88 | srcdir="${src}" |
---|
89 | destdir="${build}" |
---|
90 | debug="true" |
---|
91 | classpathref="classpath" |
---|
92 | source="${javac.source}" |
---|
93 | target="${javac.target}" |
---|
94 | > |
---|
95 | <compilerarg value="${javac.arg}" /> |
---|
96 | </javac> |
---|
97 | <copy todir="${build}"> |
---|
98 | <fileset dir="." includes="META-INF/*" /> |
---|
99 | </copy> |
---|
100 | <replace token="%%plugins.jar%%" value="${jar}" file="${build}/META-INF/base-plugins.xml" /> |
---|
101 | <jar |
---|
102 | jarfile="${dist}/${jar}" |
---|
103 | basedir="${build}" |
---|
104 | > |
---|
105 | </jar> |
---|
106 | </target> |
---|
107 | |
---|
108 | <target |
---|
109 | name="checkjar" |
---|
110 | description="Checks that the BASE2Core.jar, BASE2CorePlugins.jar and BASE2WSClient.jar exists." |
---|
111 | > |
---|
112 | <available classname="net.sf.basedb.core.Application" |
---|
113 | classpathref="classpath" property="base2core" /> |
---|
114 | <available classname="net.sf.basedb.plugins.ReporterFlatFileImporter" |
---|
115 | classpathref="classpath" property="base2coreplugins" /> |
---|
116 | <available classname="net.sf.basedb.ws.client.SessionClient" |
---|
117 | classpathref="classpath" property="base2wsclient" /> |
---|
118 | <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile" /> |
---|
119 | <fail unless="base2coreplugins" message="Can't find BASE2CorePlugins.jar in ./lib/compile" /> |
---|
120 | <fail unless="base2wsclient" message="Can't find BASE2WSClient.jar in ./lib/compile" /> |
---|
121 | <echo>Found BASE2Core.jar, BASE2CorePlugins.jar, and BASE2WSClient.jar.</echo> |
---|
122 | </target> |
---|
123 | </project> |
---|