This repository has been archived by the owner on Dec 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
102 lines (83 loc) · 3.58 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
<project name="asl-fall16-project" default="jar" basedir=".">
<description>
ANT Build File for ASL Fall 2016 Project
</description>
<tstamp/>
<!-- set global properties for this build -->
<property name="nethzid" value="pungast"/>
<property name="src.dir" location="src"/>
<property name="build.dir" location="build"/>
<property name="dist.dir" location="dist"/>
<property name="lib.dir" value="lib"/>
<property name="resources.dir" value="resources"/>
<property name="jarfile" value="${dist.dir}/Middleware-${DSTAMP}.jar"/>
<!-- Set classpaths -->
<path id="my-classpath">
<fileset dir="${lib.dir}">
<include name="log4j-core-2.6.2.jar"/>
<include name="log4j-api-2.6.2.jar"/>
</fileset>
</path>
<target name="init" depends="clean">
<!-- Create the time stamp -->
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.dir}"/>
</target>
<target name="compile" depends="init"
description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src.dir}" destdir="${build.dir}" target="1.7" source="1.7">
<classpath refid="my-classpath"/>
<exclude name="test/**/"/>
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist.dir}"/>
<!-- Copy resources to /build -->
<copydir src="${resources.dir}" dest="${build.dir}"/>
<!-- Manifest classpath -->
<manifestclasspath property="manifest.classpath" jarfile="${jarfile}">
<classpath refid="my-classpath"/>
</manifestclasspath>
<!-- Put everything in ${build} into the JAR file -->
<jar jarfile="${jarfile}" basedir="${build.dir}">
<manifest>
<attribute name="Created-By" value="${ant.java.version}"/>
<attribute name="Main-Class" value="main.java.asl.MiddlewareMain"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
</manifest>
<zipgroupfileset dir="${lib.dir}" includes="**/*.jar" />
</jar>
</target>
<target name="run" depends="dist"
description="run the application">
<!-- Run the application -->
<java jar="${jarfile}" fork="true"/>
</target>
<target name="jar" depends="compile" description="generate the distribution">
<!-- Create the distribution directory -->
<mkdir dir="${dist.dir}"/>
<!-- Copy resources to /build -->
<copydir src="${resources.dir}" dest="${build.dir}"/>
<!-- Manifest classpath -->
<manifestclasspath property="manifest.classpath" jarfile="${jarfile}">
<classpath refid="my-classpath"/>
</manifestclasspath>
<!-- Put everything in ${build} into the jar file -->
<jar jarfile="${dist.dir}/middleware-${nethzid}.jar" basedir="${build.dir}" compress="true">
<fileset dir="${src.dir}" includes="**/*.java"/>
<manifest>
<attribute name="Main-Class" value="main.java.asl.RunMW"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
</manifest>
</jar>
</target>
<target name="clean"
description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
</project>