forked from GlassGhost/EventTest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
executable file
·79 lines (72 loc) · 2.84 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
<?xml version="1.0" encoding="UTF-8"?>
<!--*******************************License(s)***********************************
Copyright © 2014 Roy Pfund
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an "AS
IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied. See the License for the specific language
governing permissions and limitations under the License.
******************************PROGRAM DESCRIPTION*******************************
"ant" build file for distributable Java Jar executable by: Roy Pfund
The only things that should ever need to be changed are:
${ant.project.name}
${Main-Class}
Also, some testing code needs to be added.
--><project name="EventTest" default="package" basedir="."><!--${ant.project.name}-->
<!-- variables -->
<property name="Main-Class" value="Test"/><!--${Main-Class}-->
<property name="cwd" value="./"/>
<property name="src" value="./src"/>
<property name="rsrc" value="./rsrc"/>
<property name="lib" value="./lib"/>
<property name="build" value="./build"/>
<property name="compile.debug" value="true"/>
<!-- Class-Path -->
<path id="compile.classpath">
<pathelement location="${mysql.jdbc}"/>
<pathelement location="${junit.jar}"/>
<fileset dir="${lib}" includes="*.jar"/>
</path>
<target name="compile"
description="Compile all Java source files into class files in build dir">
<mkdir dir="${build}"/><!--make the directory if it does not already exist.-->
<javac srcdir="${src}"
destdir="${build}"
debug="${compile.debug}"
includeantruntime="false"
source="1.7">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="package"
depends="compile"
description="builds the jar executable, and makes the manifest file" >
<jar destfile="${cwd}/${ant.project.name}.jar" basedir="${build}">
<!-- <zipgroupfileset dir="${lib}" includes="*.jar"/>-->
<fileset dir="${cwd}">
<!-- <exclude name="**/lib/**"/>-->
<!-- <exclude name="**/src/**"/>-->
<!-- <exclude name="**/build.xml"/>-->
<exclude name="**/${ant.project.name}.jar"/>
<exclude name="${cwd}/${ant.project.name}/**"/>
<exclude name="**/build/**"/>
<exclude name="**/.git/**"/>
</fileset>
<manifest>
<attribute name="Created-By" value=""/>
<attribute name="Main-Class" value="${ant.project.name}.${Main-Class}"/>
<attribute name="Class-Path" value="${lib}/*.jar"/>
</manifest>
</jar>
<chmod file="${cwd}/${ant.project.name}.jar" perm="755"/>
</target>
<target name="clean" description="Deletes previous build">
<delete verbose="true">
<fileset dir="${build}"/>
</delete>
</target>
</project>