-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
95 lines (85 loc) · 3.52 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="gmail2ldap" default="zip">
<description>gmail2ldap build script</description>
<!-- local.build.properties file not under svn - use it to overide properties localy -->
<property file="local.build.properties"/>
<!-- build.properties under svn - project default settings -->
<property file="build.properties"/>
<property name="src.dir" location="src" />
<property name="test.dir" location="test" />
<property name="lib.dir" location="lib" />
<property name="build.dir" location="build" />
<property name="classes.dir" location="${build.dir}/classes" />
<property name="dist.dir" location="${build.dir}/dist" />
<property name="jar.file" value="${ant.project.name}.jar"/>
<property name="zip.file" value="${ant.project.name}-${version}.zip"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- init -->
<!-- - - - - - - - - - - - - - - - - - -->
<target name="init">
<mkdir dir="${classes.dir}"/>
<mkdir dir="${dist.dir}"/>
<tstamp/>
</target>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- compile -->
<!-- - - - - - - - - - - - - - - - - - -->
<target name="compile" depends="init">
<!-- setting debug="on" and debuglevel="lines,source" for stacktrace line number -->
<javac srcdir="${src.dir}" target="1.5" destdir="${classes.dir}" debug="on" debuglevel="lines,source" classpathref="classpath"/>
<copy todir="${classes.dir}" overwrite="true">
<fileset dir="${src.dir}" excludes="**/*.java"/>
</copy>
</target>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- jar -->
<!-- - - - - - - - - - - - - - - - - - -->
<target name="jar" depends="compile">
<!-- set path to . to avoid ../../lib in manifest -->
<manifestclasspath property="jar.classpath" jarfile="./${jar.file}">
<classpath refid="classpath" />
</manifestclasspath>
<jar destfile="${dist.dir}/${jar.file}" basedir="${classes.dir}">
<manifest>
<attribute name="Class-Path" value="${jar.classpath}" />
<attribute name="Main-Class" value="com.googlecode.gmail2ldap.Main"/>
<section name="${ant.project.name}">
<attribute name="Implementation-Title" value="${ant.project.name}"/>
<attribute name="Implementation-Version" value="${version} ${TODAY}"/>
<attribute name="Implementation-Vendor" value="Benjamin Francisoud"/>
</section>
</manifest>
</jar>
</target>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- dist -->
<!-- - - - - - - - - - - - - - - - - - -->
<target name="dist" depends="jar">
<copy todir="${dist.dir}" overwrite="true">
<fileset dir="." >
<include name="${ant.project.name}.sh"/>
<include name="${ant.project.name}.bat"/>
</fileset>
</copy>
</target>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- zip -->
<!-- - - - - - - - - - - - - - - - - - -->
<target name="zip" depends="dist">
<zip basedir="${dist.dir}" destfile="${build.dir}/${zip.file}" duplicate="fail">
<zipfileset dir="lib" prefix="lib" />
<zipfileset dir="config" prefix="config" excludes="accounts.xml" />
</zip>
</target>
<!-- - - - - - - - - - - - - - - - - - -->
<!-- clean -->
<!-- - - - - - - - - - - - - - - - - - -->
<target name="clean" description="delete build and dist directories">
<delete dir="${build.dir}"/>
<delete dir="logs"/>
<delete dir="store"/>
</target>
</project>