-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
138 lines (123 loc) · 4.57 KB
/
build.xml
File metadata and controls
138 lines (123 loc) · 4.57 KB
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
<?xml version="1.0"?>
<!--*************************************************************************
DEPRECATED
This build.xml for Apache Ant is no longer being maintained. Use gradle
or the supplied Gradle wrapper gradlew with the new and much simpler
build.gradle, as described in readme.txt.
DEPRECATED
*************************************************************************-->
<!--*************************************************************************
Copyright (c) 2004, Colorado School of Mines and others. All rights reserved.
This program and accompanying materials are made available under the terms of
the Common Public License - v1.0, which accompanies this distribution, and is
available at http://www.eclipse.org/legal/cpl-v10.html
*************************************************************************-->
<project name="jtk" default="all" basedir=".">
<description>
The Colorado School of Mines Java Tool Kit
</description>
<property name="title" value="MinesJTK"/>
<!-- Project directories -->
<property name="bin" value="${basedir}/bin"/>
<property name="jar" value="${basedir}/libs"/>
<property name="src" value="${basedir}/src"/>
<property name="build" value="${basedir}/build"/>
<property name="build.cls" value="${build}/cls"/>
<property name="build.doc" value="${build}/doc"/>
<property name="build.jar" value="${build}/jar"/>
<!-- Where is Scala? -->
<property environment="env"/>
<condition property="scala.home" value="${env.SCALA_HOME}">
<isset property="env.SCALA_HOME"/>
</condition>
<!-- Other global settings -->
<path id="classpath">
<fileset dir="${jar}" includes="**/*.jar"/>
</path>
<!-- Initialize -->
<target name="init">
<tstamp/>
<mkdir dir="${build}"/>
<mkdir dir="${build.cls}"/>
<mkdir dir="${build.doc}"/>
<mkdir dir="${build.jar}"/>
</target>
<!-- Compile Java sources -->
<target name="compile-java" depends="init">
<javac srcdir="${src}/main/java:${src}/test/java:${src}/demo/java"
destdir="${build.cls}"
compiler="javac1.7"
memoryMaximumSize="500m"
fork="true"
debug="on"
deprecation="on"
includeantruntime="false">
<compilerarg value="-Xlint:all,-serial"/>
<classpath refid="classpath"/>
<exclude name="**/old/**"/>
<exclude name="**/new/**"/>
</javac>
</target>
<!-- Compile Scala sources (only if SCALA_HOME defined) -->
<target if="scala.home" name="compile-scala" depends="init,compile-java">
<path id="scala.tools.classpath">
<pathelement location="${scala.home}/lib/scala-compiler.jar"/>
<pathelement location="${scala.home}/lib/scala-library.jar"/>
<pathelement location="${scala.home}/lib/scala-reflect.jar"/>
</path>
<path id="scala.build.classpath">
<pathelement location="${build.cls}"/>
<fileset dir="${jar}" includes="**/*.jar"/>
<pathelement location="${scala.home}/lib/scala-library.jar"/>
</path>
<taskdef resource="scala/tools/ant/antlib.xml">
<classpath refid="scala.tools.classpath"/>
</taskdef>
<scalac srcdir="${src}/main/scala:${src}/test/scala:${src}/demo/scala"
destdir="${build.cls}"
deprecation="on">
<classpath refid="scala.build.classpath"/>
</scalac>
</target>
<!-- Build Java archive -->
<target name="jar" depends="compile-java,compile-scala,copy-resources"
description="build Java archive">
<jar jarfile="${build.jar}/edu_mines_jtk.jar" basedir="${build.cls}"/>
</target>
<target name="copy-resources">
<copy todir="${build.cls}">
<fileset dir="${src}/main/resources"/>
<fileset dir="${src}/test/resources"/>
<fileset dir="${src}/demo/resources"/>
</copy>
</target>
<!--Build javadocs -->
<target name="doc" depends="init" description="build javadocs">
<javadoc
classpathref="classpath"
destdir="${build.doc}/api"
author="true"
version="true"
use="true"
windowtitle="${title}">
<packageset dir="src/main/java" defaultexcludes="yes">
<exclude name="edu/mines/jtk/**/new/**"/>
<exclude name="edu/mines/jtk/**/old/**"/>
</packageset>
</javadoc>
</target>
<!-- Build everything (except javadocs) -->
<target name="all" depends="jar"
description="build everything"/>
<!-- Clean jar -->
<target name="clean-jar"
description="delete all products of jar build">
<delete dir="${build.cls}"/>
<delete dir="${build.jar}"/>
</target>
<!-- Cleanup -->
<target name="clean"
description="delete all products of build">
<delete dir="${build}"/>
</target>
</project>