-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.xml
62 lines (52 loc) · 1.82 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
<?xml version="1.0"?>
<project name="Wrapper" default="jar">
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="resources" location="resources"/>
<property name="cpy" location="cpy"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<path id="build.classpath">
<fileset dir="${lib}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="mkdir">
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
</target>
<target name="clean">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<target name="compile" depends="clean, mkdir">
<javac srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath refid="build.classpath"/>
</javac>
</target>
<target name="copy">
<copy todir="${dist}" overwrite="true">
<fileset dir="${cpy}"/>
</copy>
</target>
<target name="jar" depends="compile, copy">
<jar destfile="${dist}/${ant.project.name}.jar" basedir="${build}">
<manifest>
<attribute name="Main-Class" value="wrapper.Wrapper"/>
</manifest>
<zipgroupfileset dir="${lib}" includes="**/*.jar"/>
</jar>
</target>
<target name="run" depends="copy">
<java jar="${dist}/${ant.project.name}.jar" fork="true"/>
</target>
<target name="printclasspath">
<!-- Write the classpath to the console. Helpful for debugging -->
<!-- Create one line per classpath element-->
<pathconvert pathsep="${line.separator}" property="echo.classpath" refid="build.classpath">
</pathconvert>
<!-- Write the result to the console -->
<echo message="The following classpath is being used " />
<echo message="${echo.classpath}" />
</target>
</project>