/
build.xml
127 lines (111 loc) · 4.55 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
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
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
Oct 15, 2011 2:26:11 PM
QuickToDo
A Planner/Manager
v
====================================================================== -->
<project name="QuickToDo" default="default">
<description>
description
</description>
<property name="build" value="target/"/>
<property name="compileTarget" value="bin/"/>
<property name="srcDir" value="src"/>
<property file="build.properties" />
<path id="classpath">
<fileset dir="${env.Lib}/">
<!--<patternset id="non.test.sources"> -->
<include name="**/*.jar"/>
<!--</patternset> -->
</fileset>
</path>
<!-- create a property containing all .jar files, prefix lib/, and seperated with a space -->
<pathconvert property="libs.project" pathsep=" ">
<mapper type="regexp" from = "[/\\](lib[/\\].+)" to = "\1">
</mapper>
<path>
<!-- lib.home contains all jar files, in several subdirectories -->
<fileset dir="${env.Lib}">
<include name="**/*.*" />
</fileset>
</path>
</pathconvert>
<path id="buildpath">
<fileset dir="lib">
<patternset id="non.test.sources">
<include name="**/*.java"/>
<exclude name="**/*Tests.java"/>
</patternset>
</fileset>
</path>
<!-- =================================
target: default
================================= -->
<target name="default" depends="fin" description="description">
</target>
<!-- - - - - - - - - - - - - - - - - -
target: depends
- - - - - - - - - - - - - - - - - -->
<target name="depends">
</target>
<!-- =================================
target: clean
================================= -->
<target name="clean" depends="depends" description="Clean target directory">
<delete dir="${build}" />
</target>
<!-- =================================
target: init
================================= -->
<target name="init" depends="clean" description="Initialize target directory">
<mkdir dir="target"/>
<propertyfile file="build.number">
<entry key="build.number" type="int" operation="+" default="0"/>
</propertyfile>
</target>
<!-- =================================
target: copyLib
================================= -->
<target name="copyLib" depends="init" description="Copy Library Files">
<copydir dest="target/lib" src="lib"></copydir>
<manifestclasspath property = "library-list" jarfile=".">
<classpath refid = "classpath"/>
</manifestclasspath>
<copyfile dest="${build}/${env.DosScript}" src="${env.DosScript}"/>
<copydir dest="${compileTarget}/${env.ImageFolder}" src="${srcDir}/${env.ImageFolder}"/>
<copydir dest="${compileTarget}/${env.HelpFolder}" src="${srcDir}/${env.HelpFolder}"/>
<copyfile dest="${build}/${env.ShellScript}" src="${env.ShellScript}"/>
</target>
<!-- =================================
target: compile
================================= -->
<target name="compile" depends="copyLib" description="Compile the Java source files">
<javac srcdir="${srcDir}"
destdir="${compileTarget}"
classpathref="classpath"
excludes="**/*Tests.java"
debug="off"
/>
</target>
<!-- =================================
target: jar
================================= -->
<target name="jar" depends="compile" description="Make the JAR file">
<property file="build.number"/>
<jar destfile="${build}/QuickToDo.jar" basedir="${compileTarget}">
<manifest>
<attribute name="Main-Class" value="Main"/>
<attribute name="Class-Path" value=".:${libs.project}"/>
<attribute name="Implementation-Version" value="${build.number}"/>
</manifest>
</jar>
</target>
<!-- =================================
target: fin
================================= -->
<target name="fin" depends="jar" description="Sets up permissions of jar">
<chmod file = "${build}/QuickToDo.jar" perm="+x" ></chmod>
<chmod file = "${build}/${env.ShellScript}" perm="+x" ></chmod>
</target>
</project>