1+ <!--
2+ ~ Copyright 2018 Sebastian Raubach <[email protected] > 3+ ~
4+ ~ Licensed under the Apache License, Version 2.0 (the "License");
5+ ~ you may not use this file except in compliance with the License.
6+ ~ You may obtain a copy of the License at
7+ ~
8+ ~ http://www.apache.org/licenses/LICENSE-2.0
9+ ~
10+ ~ Unless required by applicable law or agreed to in writing, software
11+ ~ distributed under the License is distributed on an "AS IS" BASIS,
12+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ ~ See the License for the specific language governing permissions and
14+ ~ limitations under the License.
15+ -->
16+
17+ <project name =" Lit" basedir =" ." default =" clean-build" >
18+
19+ <property name =" src.dir" value =" src" />
20+
21+ <!-- Define the necessary paths -->
22+ <property name =" build.dir" value =" bin_jar" />
23+ <property name =" lib.dir" value =" lib" />
24+ <property name =" lib.deploy.dir" value =" lib_swt" />
25+ <property name =" classes.dir" value =" ${ build.dir } /classes" />
26+ <property name =" img.dir" value =" img" />
27+ <property name =" jar.dir" value =" ${ build.dir } /jar" />
28+
29+ <!-- Define the main class -->
30+ <property name =" main-class" value =" uk.ac.hutton.lit.ui.Lit" />
31+
32+ <!-- Define the class path -->
33+ <path id =" classpath" >
34+ <fileset dir =" ${ lib.dir } " includes =" **/*.jar" />
35+ <fileset dir =" ${ lib.deploy.dir } " includes =" **/*.jar" />
36+ </path >
37+
38+ <pathconvert pathsep =" " property =" base.classpath" >
39+ <path refid =" classpath" />
40+ <mapper >
41+ <chainedmapper >
42+ <flattenmapper />
43+ <globmapper from =" *.jar" to =" *.jar" />
44+ </chainedmapper >
45+ </mapper >
46+ </pathconvert >
47+
48+ <!-- Clean previously built files -->
49+ <target name =" clean" >
50+ <delete dir =" ${ build.dir } " />
51+ </target >
52+
53+ <!-- Compile the project -->
54+ <target name =" compile" >
55+ <mkdir dir =" ${ classes.dir } " />
56+ <javac classpathref =" classpath" destdir =" ${ classes.dir } " encoding =" utf-8" includeantruntime =" false" source =" 8" srcdir =" ${ src.dir } "
57+ target =" 8" />
58+ </target >
59+
60+ <!-- Define classpath and create the jar folder -->
61+ <target name =" pre_jar" depends =" compile" >
62+ <mkdir dir =" ${ jar.dir } " />
63+ </target >
64+
65+ <!-- Create the jar files -->
66+ <target name =" jar" depends =" pre_jar" >
67+ <jar basedir =" ${ classes.dir } " destfile =" ${ jar.dir } /${ ant.project.name } .jar" >
68+ <manifest >
69+ <attribute name =" Main-Class" value =" ${ main-class } " />
70+ <attribute name =" Class-Path" value =" ./ ${ base.classpath } " />
71+ <attribute name =" Implementation-Version" value =" ${ i4j.version } " />
72+ </manifest >
73+
74+ <zipfileset dir =" ${ img.dir } " includes =" **/*.*" prefix =" img" />
75+
76+ <!-- Include the licence -->
77+ <zipfileset dir =" ${ basedir } " includes =" LICENSE" />
78+ </jar >
79+
80+ <!-- Copy the copyright information -->
81+ <copy file =" LICENSE" overwrite =" true" todir =" ${ jar.dir } " />
82+ </target >
83+
84+ <target name =" clean-build" depends =" clean,jar" />
85+
86+ <!-- Ask for the version number -->
87+ <target name =" getversion" >
88+ <input addproperty =" i4j.version" message =" Enter the version number of Lit:" />
89+ </target >
90+
91+ <!-- Build the installers -->
92+ <target name =" install4j" depends =" getversion, clean-build" >
93+ <taskdef name =" install4j" classname =" com.install4j.Install4JTask" classpath =" C:\Program Files\install4j7\bin\ant.jar" />
94+
95+ <delete >
96+ <fileset dir =" installer" includes =" **/*.exe" />
97+ <fileset dir =" installer" includes =" **/*.sh" />
98+ <fileset dir =" installer" includes =" **/*.dmg" />
99+ </delete >
100+
101+ <install4j projectfile =" installer/lit.install4j" release =" ${ i4j.version } " />
102+ </target >
103+
104+ </project >
0 commit comments