-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
104 lines (85 loc) · 3.32 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
<!--
~ Copyright 2018 Sebastian Raubach <[email protected]>
~
~ 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.
-->
<project name="lit" basedir="." default="clean-build">
<property name="src.dir" value="src"/>
<!-- Define the necessary paths -->
<property name="build.dir" value="bin_jar"/>
<property name="lib.dir" value="lib"/>
<property name="lib.deploy.dir" value="lib_swt"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="img.dir" value="img"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<!-- Define the main class -->
<property name="main-class" value="uk.ac.hutton.lit.ui.Lit"/>
<!-- Define the class path -->
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
<fileset dir="${lib.deploy.dir}" includes="**/*.jar"/>
</path>
<pathconvert pathsep=" " property="base.classpath">
<path refid="classpath"/>
<mapper>
<chainedmapper>
<flattenmapper/>
<globmapper from="*.jar" to="*.jar"/>
</chainedmapper>
</mapper>
</pathconvert>
<!-- Clean previously built files -->
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<!-- Compile the project -->
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac classpathref="classpath" destdir="${classes.dir}" encoding="utf-8" includeantruntime="false" source="8" srcdir="${src.dir}"
target="8"/>
</target>
<!-- Define classpath and create the jar folder -->
<target name="pre_jar" depends="compile">
<mkdir dir="${jar.dir}"/>
</target>
<!-- Create the jar files -->
<target name="jar" depends="pre_jar">
<jar basedir="${classes.dir}" destfile="${jar.dir}/${ant.project.name}.jar">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
<attribute name="Class-Path" value="./ ${base.classpath}"/>
<attribute name="Implementation-Version" value="${i4j.version}"/>
</manifest>
<zipfileset dir="${img.dir}" includes="**/*.*" prefix="img"/>
<!-- Include the licence -->
<zipfileset dir="${basedir}" includes="LICENSE"/>
</jar>
<!-- Copy the copyright information -->
<copy file="LICENSE" overwrite="true" todir="${jar.dir}"/>
</target>
<target name="clean-build" depends="clean,jar"/>
<!-- Ask for the version number -->
<target name="getversion">
<input addproperty="i4j.version" message="Enter the version number of Lit:"/>
</target>
<!-- Build the installers -->
<target name="install4j" depends="getversion, clean-build">
<taskdef name="install4j" classname="com.install4j.Install4JTask" classpath="C:\Program Files\install4j7\bin\ant.jar"/>
<delete>
<fileset dir="installer" includes="**/*.exe"/>
<fileset dir="installer" includes="**/*.sh"/>
<fileset dir="installer" includes="**/*.dmg"/>
</delete>
<install4j projectfile="installer/lit.install4j" release="${i4j.version}"/>
</target>
</project>