-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
148 lines (131 loc) · 6.77 KB
/
build.xml
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
<?xml version="1.0"?>
<project name="chexmix">
<property name="src.dir" location="src" />
<property name="lib.dir" location="lib" />
<property name="build.dir" location="build" />
<property name="build.classes.dir" location="${build.dir}/classes" />
<property name="build.dist.dir" location="${build.dir}/dist" />
<property name="build.unjar.dir" location="${build.dir}/unjar" />
<property name="build.compiler" value="javac1.8"/>
<property name="seqcode-core.classes.dir" value="../seqcode-core/build/classes"/>
<property name="seqcode-core.lib.dir" value="../seqcode-core/lib"/>
<property name="seqcode-core.unjar.dir" value="../seqcode-core/build/unjar"/>
<path id="compile.classpath">
<pathelement location="${build.classes.dir}"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${seqcode-core.classes.dir}"/>
<fileset dir="${seqcode-core.lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- ======================================================================= -->
<!-- Target: init -->
<!-- Depends: -->
<!-- Description: Perform any initialization required to run other targets -->
<!-- ======================================================================= -->
<target name="init">
<mkdir dir="${build.classes.dir}" />
<mkdir dir="${build.dist.dir}" />
</target>
<!-- ======================================================================= -->
<!-- Target: clean -->
<!-- Depends: init -->
<!-- Description: clean up files produced in the build -->
<!-- ======================================================================= -->
<target name="clean" depends="init" description="remove build output" >
<delete dir="${build.dist.dir}" />
<delete dir="${build.classes.dir}" />
<delete dir="${build.unjar.dir}" />
</target>
<!-- ======================================================================= -->
<!-- Target: compile -->
<!-- Depends: init -->
<!-- Description: Compile the source code -->
<!-- ======================================================================= -->
<target name="compile" depends="init" description="Compile the code" >
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
classpathref="compile.classpath"
debug="true"
debuglevel="lines,vars,source"
deprecation="yes"
compiler="modern"
includeantruntime="false"
verbose="no">
<include name="**/*.java"/>
</javac>
</target>
<!-- ======================================================================= -->
<!-- Target: buildfilecopy -->
<!-- Depends: init -->
<!-- Description: Copies all non-source files required by utils -->
<!-- from the src directory to the build directory -->
<!-- ======================================================================= -->
<target name="buildfilecopy" depends="init" description="Copy non-src files to the build dir" >
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}">
<include name="**/*.gif"/>
<include name="**/*.html"/>
<include name="**/*.jpg"/>
<include name="**/*.xml"/>
<include name="**/*.txt"/>
<include name="**/*.dtd"/>
<include name="**/*.bat"/>
<include name="**/*.exe"/>
<include name="**/*.ico"/>
<include name="**/*.png"/>
<include name="**/*.properties"/>
</fileset>
</copy>
</target>
<!-- ======================================================================= -->
<!-- Target: build -->
<!-- Depends: compile, buildfilecopy -->
<!-- Description: Compiles all the client source files and copies other -->
<!-- required files to the build directory to create a usable -->
<!-- version of the utils module -->
<!-- ======================================================================= -->
<target name="build" depends="compile, buildfilecopy"
description="build and copy files" >
</target>
<target name="unjarall" unless="build.unjar.dir.present">
<mkdir dir="${build.unjar.dir}.tmp" />
<unjar dest="${build.unjar.dir}.tmp">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
<fileset dir="${seqcode-core.lib.dir}" includes="**/*.jar"/>
</unjar>
<move file="${build.unjar.dir}.tmp" tofile="${build.unjar.dir}" />
</target>
<target name="requirepwset">
<fail unless="pwset"
message="Must set pwset property. This is a subdir of
pwbasepath (${pwbasepath})."/>
</target>
<target name="setpwfilespath" depends="init, requirepwset" unless="${pwfiles.path}">
<property name="pwfiles.path" value="${pwbasepath}/${pwset}"/>
</target>
<!-- ======================================================================= -->
<!-- Target: makechexmixjar -->
<!-- Depends: build, unjarall, setpwfilespath -->
<!-- Description: Compiles all the client source files and builds the jar -->
<!-- for ChExMix. ant -Dpwbasepath=/gpfs/group/sam77/default/code/pwfiles -Dpwset=mahonylab makechexmixjar -->
<!-- ======================================================================= -->
<target name="makechexmixjar" depends="build, unjarall, setpwfilespath">
<delete dir="${build.unjar.dir}/META-INF"/>
<jar destfile="${build.dist.dir}/chexmix.${pwset}.jar" manifest="manifests/chexmix_manifest.txt">
<fileset dir="${build.classes.dir}" includes="**/*.class"/>
<fileset dir="${build.classes.dir}" includes="**/*.properties"/>
<fileset dir="${build.classes.dir}" includes="**/*.png"/>
<fileset dir="${build.classes.dir}" includes="**/*.txt"/>
<fileset dir="${seqcode-core.classes.dir}" includes="**/*.class"/>
<fileset dir="${seqcode-core.classes.dir}" includes="**/*.properties"/>
<fileset dir="${seqcode-core.classes.dir}" includes="**/*.png"/>
<fileset dir="${seqcode-core.classes.dir}" includes="**/*.txt"/>
<fileset dir="${pwfiles.path}" includes="*"/>
<fileset dir="${build.unjar.dir}"/>
</jar>
<chmod file="${build.dist.dir}/chexmix.${pwset}.jar}" perm="755"/>
</target>
</project>