File: build.xml

package info (click to toggle)
king 2.23.161103+dfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 45,672 kB
  • sloc: java: 83,188; xml: 625; cpp: 209; makefile: 29; sh: 14
file content (121 lines) | stat: -rw-r--r-- 4,746 bytes parent folder | download | duplicates (4)
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
<!-- (jEdit options) :folding=explicit:collapseFolds=1: -->
<project name="driftwood" default="dist" basedir=".">
<description>Driftwood libraries by IWD</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"/>
</target>
<!-- Defines properties needed to use SCP -->
<target name="init-scp">
    <property file="../lib/scp.props"/>
</target>
<!-- }}} -->

<!-- build, compile {{{ -->
<!-- Bundles up all needed class and resource files into a JAR -->
<target name="build" description="Build class files" depends="init,compile">
    <echo message="Version ${version}"/>
    <echo message="Build # ${buildnum}"/>
    <jar jarfile="${ant.project.name}.jar" index="false">
        <fileset dir="${build}"/>
        <fileset dir="${resource}"/>
    </jar>
</target>

<!-- Compiles all .java files for this package -->
<target name="compile" depends="init">
    <mkdir dir="${build}"/>
    <javac srcdir="${src}"
           destdir="${build}"
           includes="**/*.java"
           excludes="**/old/"
           deprecation="off"
           debug="on" debuglevel="lines,source"
           target="1.5" source="1.5">
    </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}-src.zip">
         <zipfileset dir="${dist}" includes="${ant.project.name}/"/>
    </zip>
    <zip basedir="${dist}"
         destfile="${dist}/${ant.project.name}-${version}.zip"
         includes="${ant.project.name}-${version}/"/>
</target>

<!-- Makes the source code distribution -->
<target name="dist-src" depends="init">
    <mkdir dir="${dist}/${ant.project.name}-${version}-src"/>
    <copy todir="${dist}/${ant.project.name}-${version}-src" preservelastmodified="true">
        <fileset dir="${basedir}">
            <exclude name="build/"/>
            <exclude name="dist/"/>
            <exclude name="**/old/"/>
            <exclude name="doc/nodist/"/>
        </fileset>
    </copy>
    <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/"/>
            <exclude name="doc/nodist/"/>
        </fileset>
    </copy>
</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="${ant.project.name}.jar"/>
            <include name="README*"/>
            <include name="LICENSE*"/>
            <include name="doc/"/>
            <exclude name="doc/work/"/>
            <exclude name="doc/nodist/"/>
        </fileset>
    </copy>
</target>
<!-- }}} -->

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

<!-- Bundles this code and saves it locally and remotely - simple version control -->
<target name="backup" depends="init,clean,init-scp" description="Backs up this project on IWD's machine">
    <tstamp/>
    <mkdir dir="${user.home}/ark/old-versions/${ant.project.name}"/>
    <jar jarfile="${user.home}/ark/old-versions/${ant.project.name}/${ant.project.name}-${version}.${buildnum}.jar" index="true">
        <fileset dir="${basedir}"/>
    </jar>
    <scp file="${user.home}/ark/old-versions/${ant.project.name}/${ant.project.name}-${version}.${buildnum}.jar"
        todir="${scp.backup.username}@${scp.backup.hostname}:${scp.backup.path}/${ant.project.name}-${version}.${buildnum}.jar"
        password="${scp.backup.password}" failonerror="true"/>
</target>
<!-- }}} -->
</project>