File: build.xml

package info (click to toggle)
king 2.21.120420+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 45,228 kB
  • ctags: 10,805
  • sloc: java: 80,893; xml: 579; cpp: 209; makefile: 29; sh: 14
file content (231 lines) | stat: -rw-r--r-- 10,474 bytes parent folder | download | duplicates (2)
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!-- (jEdit options) :folding=explicit:collapseFolds=1: -->
<project name="king" default="dist" basedir=".">
<description>KiNG kinemage viewer</description>

<!-- global properties that we always want defined {{{ -->
<property name="src"        location="src"/>
<property name="resource"   location="resource"/>
<property name="build"      location="build"/>
<property name="dist"       location="dist"/>
<!-- Version control: creates timestamp, updates ${buildnum}, loads ${version} -->
<target name="init">
    <tstamp>
        <format property="DSTAMP_SIX" pattern="yyMMdd"/>
    </tstamp>
    <propertyfile file="${resource}/${ant.project.name}/buildnum.props">
        <entry key="buildnum" value="${DSTAMP}.${TSTAMP}"/>
    </propertyfile>
    <property file="${resource}/${ant.project.name}/buildnum.props"/>
    <property file="${resource}/${ant.project.name}/version.props"/>
    <!-- Conditional, platform-specific compilation -->
    <condition property="isMacOSX">
        <and>
            <os family="mac"/>
            <os family="unix"/>
        </and>
    </condition>
</target>
<!-- }}} -->

<!-- build, compile, compile-mac, compile-jogl {{{ -->
<!-- Bundles up all needed class and resource files into a JAR -->
<target name="build" description="Build class files" depends="init,compile,compile-mac,compile-jogl">
    <ant antfile="../molikin/build.xml" inheritAll="false" target="compile">
        <!-- inherited properties go here -->
    </ant>
    <echo message="Version ${version}"/>
    <echo message="Build # ${buildnum}"/>
    <concat destfile="${resource}/king/king_prefs" append="false">
      <filelist dir="${resource}/king/" files="source_king_prefs"/>
      <filelist dir="../molikin/resource/king" files="king_prefs"/>
    </concat>
    <concat destfile="${resource}/META-INF/services/king.Plugin" append="false">
      <filelist dir="${resource}/META-INF/services/" files="source.king.Plugin"/>
      <filelist dir="../molikin/resource/META-INF/services/" files="king.Plugin"/>
    </concat>
    <!-- As of 1.5.2, Ant screws up the INDEX by not considering Class-Path -->
    <jar jarfile="${ant.project.name}.jar" manifest="Manifest.mf" index="false">
        <fileset dir="${build}"/>
        <fileset dir="${resource}"/>
        <fileset dir="../driftwood/build/">
           <!--<exclude name="driftwood/moldb*/"/>-->
        </fileset>
        <fileset dir="../driftwood/resource/">
           <!--<exclude name="driftwood/moldb*/"/>-->
        </fileset>
        <fileset dir="../molikin/build/"/>
        <fileset dir="../molikin/resource/">
          <exclude name="king/"/>
          <exclude name="META-INF/"/>
        </fileset>
        <!-- iText library is in a separate JAR -->
    </jar>
    <copy file="resource/king/king_prefs" tofile="${basedir}/doc/dot_king_prefs.txt" overwrite="true"/>
</target>

<!-- Compiles all .java files for this package -->
<target name="compile" depends="init">
    <ant antfile="../driftwood/build.xml" inheritAll="false" target="compile">
        <!-- inherited properties go here -->
    </ant>
    <copy file="/usr/share/java/itext.jar" tofile="${basedir}/itext.jar" failonerror="false"/>
    <mkdir dir="${build}"/>
    <javac srcdir="${src}" destdir="${build}" debug="on" debuglevel="lines,source" target="1.5" source="1.5">
         <include name="**/*.java"/>
         <exclude name="**/old/"/>
         <exclude name="**/Mac*.java"/>
         <exclude name="**/Jogl*.java"/>
         <exclude name="**/dive/"/>
         <classpath>
            <pathelement location="../driftwood/build"/>
            <pathelement location="itext.jar"/>             <!-- Required for PDF export -->
         </classpath>
    </javac>
</target>

<!-- Compiles .java files that only work on the Mac -->
<target name="compile-mac" depends="init,compile" if="isMacOSX">
    <javac srcdir="${src}" destdir="${build}" debug="on" debuglevel="lines,source" target="1.5" source="1.5">
         <include name="**/Mac*.java"/>
         <classpath>
            <pathelement location="${build}"/>
            <pathelement location="../driftwood/build"/>
         </classpath>
    </javac>
</target>

<!-- Compiles .java files that only work with JOGL installed -->
<target name="compile-jogl" depends="init,compile">
    <javac srcdir="${src}" destdir="${build}" debug="on" debuglevel="lines,source" failonerror="false" target="1.5" source="1.5">
         <include name="**/Jogl*.java"/>
         <include name="**/dive/"/>
         <classpath>
            <pathelement location="${build}"/>
            <pathelement location="../driftwood/build"/>
            <pathelement location="/usr/share/java/jogl.jar"/>
         </classpath>
    </javac>
</target>
<!-- }}} -->

<!-- dist, dist-src, dist-exe {{{ -->
<!-- Makes .zip files from the ${dist} directory -->
<target name="dist" description="Generate the distributions" depends="init,clean,build,dist-src,dist-exe">
    <zip destfile="${dist}/${ant.project.name}.${version}.${DSTAMP_SIX}.src.zip">
        <zipfileset dir="${dist}" includes="${ant.project.name}/"/>
        <zipfileset dir="${dist}" includes="javadocs/"/>
        <!-- old version, incorporates version names which breaks ant when users try to compile them VBC 111230
        <zipfileset dir="../driftwood/dist/" includes="driftwood-*-src/"/>
        <zipfileset dir="../chiropraxis/dist/" includes="chiropraxis-*-src/"/>
        <zipfileset dir="../extratools/dist/" includes="extratools-*-src/"/>
        <zipfileset dir="../molikin/dist/" includes="molikin-*-src/"/> 
        -->
        <zipfileset dir="../driftwood/dist/" includes="driftwood/"/>
        <zipfileset dir="../chiropraxis/dist/" includes="chiropraxis/"/>
        <zipfileset dir="../extratools/dist/" includes="extratools/"/>
        <zipfileset dir="../molikin/dist/" includes="molikin/"/> 
        <zipfileset dir="../lib/" prefix="lib/">
            <include name="/usr/share/java/itext.jar"/>
            <include name="/usr/share/java/jogl.jar"/>
        </zipfileset>
    </zip>
    <zip basedir="${dist}"
         destfile="${dist}/${ant.project.name}.${version}.${DSTAMP_SIX}.zip"
         includes="${ant.project.name}-${version}/"/>
</target>

<!-- Makes the source code distribution -->
<target name="dist-src" depends="init">
    <ant antfile="../driftwood/build.xml" inheritAll="false" target="dist-src">
        <!-- inherited properties go here -->
    </ant>
    <ant antfile="../chiropraxis/build.xml" inheritAll="false" target="dist-src">
        <!-- inherited properties go here -->
    </ant>
    <ant antfile="../extratools/build.xml" inheritAll="false" target="dist-src">
        <!-- inherited properties go here -->
    </ant>
    <ant antfile="../molikin/build.xml" inheritAll="false" target="dist-src">
        <!-- inherited properties go here -->
    </ant>
    <!--
    <mkdir dir="${dist}/${ant.project.name}-${version}-src"/>
    <copy todir="${dist}/${ant.project.name}-${version}-src" preservelastmodified="true">
    -->
    <mkdir dir="${dist}/${ant.project.name}"/>
    <copy todir="${dist}/${ant.project.name}" preservelastmodified="true">
        <fileset dir="${basedir}">
            <exclude name="build/"/>
            <exclude name="dist/"/>
            <exclude name="**/old/"/>
        </fileset>
    </copy>
    <!-- docs for other top-level projects are in their dist/ folders already -->
    <mkdir dir="${dist}/javadocs"/>
    <javadoc packagenames="driftwood.*,Jama.*,king.*"
        sourcepath="src:../driftwood/src"
        classpath="../lib:/usr/share/java/itext.jar:/usr/share/java/jogl.jar"
        destdir="${dist}/javadocs" access="protected" source="1.5"
        breakiterator="true" noqualifier="all"
        version="true" use="true" author="true"
        windowtitle="IWD's JavaDocs"
        link="http://java.sun.com/j2se/1.5.0/docs/api/">
    </javadoc>
</target>

<!-- Makes the end-user distribution -->
<target name="dist-exe" depends="init,build">
    <mkdir dir="${dist}/${ant.project.name}-${version}"/>
    <copy todir="${dist}/${ant.project.name}-${version}" preservelastmodified="true">
        <fileset dir="${basedir}">
            <include name="*.jar"/>
            <include name="README*"/>
            <include name="LICENSE*"/>
            <include name="plugins/"/>
            <include name="doc/"/>
            <exclude name="doc/work/"/>
        </fileset>
    </copy>
    <!-- extra doc files from other top-level projects; some need to be renamed -->
    <copy file="../chiropraxis/doc/tools-manual.pdf" tofile="${dist}/${ant.project.name}-${version}/doc/chiropraxis-manual.pdf"/>
    <copy file="../extratools/doc/tools-manual.pdf" tofile="${dist}/${ant.project.name}-${version}/doc/extratools-manual.pdf"/>
</target>
<!-- }}} -->

<!-- clean, backup {{{ -->
<!-- Removes products of compilation -->
<target name="clean" description="Clean up build/ and dist/">
    <delete dir="${dist}"/>
    <delete dir="${build}"/>
    <delete dir="${basedir}/installer/king/king_Build_Output"/>
    <delete file="${ant.project.name}.jar"/>
    <delete file="itext.jar"/>
</target>

<!-- Also cleans driftwood -->
<target name="clean-all" depends="clean" description="Clean up king and driftwood">
    <ant antfile="../driftwood/build.xml" inheritAll="false" target="clean">
        <!-- inherited properties go here -->
    </ant>
    <ant antfile="../molikin/build.xml" inheritAll="false" target="clean">
        <!-- inherited properties go here -->
    </ant>
</target>
<!-- }}} -->

<!-- deploy-local {{{ -->
<!-- Deploys the executable on the local system - applies to IWD's machine only  -->
<target name="deploy-local"  description="Deploy to ~/bin" depends="build">
    <copy file="${ant.project.name}.jar" todir="/Applications/KiNG.app/Contents/Resources/Java/" overwrite="true" failonerror="false"/>
    <copy file="itext.jar" todir="/Applications/KiNG.app/Contents/Resources/Java/" overwrite="true" failonerror="false"/>
    <copy todir="/Applications/KiNG.app/Contents/Resources/Java/plugins/" overwrite="true" failonerror="false">
        <fileset dir="plugins/"/>
    </copy>
</target>

<!-- Deploys the executable on the local MolProbity - applies to IWD's machine only  -->
<target name="deploy-local-mp"  description="Deploy to local MolProbity 3" depends="build">
    <copy file="${ant.project.name}.jar" todir="${user.home}/Sites/molprobity3/public_html/" overwrite="true" failonerror="false"/>
</target>
<!-- }}} -->
</project>