-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
129 lines (100 loc) · 4.56 KB
/
build.xml
File metadata and controls
129 lines (100 loc) · 4.56 KB
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
128
129
<?xml version="1.0"?>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Build file for DiscoSync -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<project name="DiscoSync" default="main" basedir=".">
<!-- Name of the distribution zip file to create -->
<property name="zipName" value="DiscoSync.zip"/>
<!-- Give user a chance to override without editing this file -->
<property file=".ant.properties" />
<property file="${user.home}/.ant.properties" />
<!-- Don't use systems CLASSPATH, use only the CLASSPATH set in this build file -->
<property name="build.sysclasspath" value="ignore"/>
<!-- General project properties -->
<property name="Name" value="DiscoSync"/>
<property name="jarName" value="DiscoSync.jar"/>
<!-- javac compiler options -->
<property name="debug" value="true" />
<property name="deprecation" value="true" />
<property name="optimize" value="true" />
<!-- Set the properties related to the source tree -->
<property name="src.dir" value="source"/>
<property name="lib.dir" value="lib"/>
<property name="bin.dir" value="bin"/>
<path id="classpath">
<pathelement location="${lib.dir}/commons-io-2.4.jar"/>
<pathelement location="${lib.dir}/commons-cli-1.2.jar"/>
</path>
<!-- Set the properties for the build area -->
<property name="build.dir" value="build"/>
<property name="build.classes" value="${build.dir}/classes"/>
<!-- Set up properties for the distribution area -->
<property name="dist.dir" value="${build.dir}/dist"/>
<!-- Specify logfile name -->
<property name="logfilename" value="build.log"/>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Build the code -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="build"
description="--> compile">
<delete includeEmptyDirs="true" quiet="true" dir="${build.classes}"/>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<javac srcdir="${src.dir}"
destdir="${build.classes}"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
target="1.7"
source="1.7">
<classpath refid="classpath" />
</javac>
</target>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Create the jar file -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="jar"
depends="build"
description="--> create jar file">
<delete includeEmptyDirs="true" quiet="true" dir="${dist.dir}"/>
<mkdir dir="${dist.dir}"/>
<!-- Build the jar file. -->
<jar jarfile="${dist.dir}/${jarName}">
<fileset dir="${build.classes}">
<include name="**/*.class"/>
<include name="**/*.mf"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="org.discosync.DiscoSync"/>
<attribute name="Class-Path" value="commons-io-2.4.jar commons-cli-1.2.jar hsqldb.jar"/>
</manifest>
</jar>
</target>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Copy remaining files to dist directory -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="distribution"
depends="jar"
description="--> copy bin files dist directory.">
<copy todir="${dist.dir}" >
<fileset dir="${bin.dir}"/>
<fileset dir="${lib.dir}"/>
<fileset file="README.md"/>
</copy>
<!-- Set eol format of delivered files -->
<fixcrlf eol="dos" srcdir="${dist.dir}" encoding="ISO-8859-1" includes="**/*.bat,**/*.txt,**/*.job,**/*.ini" />
<fixcrlf eol="unix" srcdir="${dist.dir}" encoding="ISO-8859-1" includes="**/*.sh" />
<!-- Create the distribution zip file -->
<zip basedir="${dist.dir}" destfile="${build.dir}/${zipName}"/>
</target>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Main target - runs dist by default -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<target name="main" description="--> main target">
<record name="${logfilename}" action="start"/>
<antcall target="distribution"/>
<!-- Finally delete the classes directory -->
<delete quiet="true" dir="${build.classes}"/>
<record name="${logfilename}" action="stop"/>
</target>
</project>