-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
104 lines (88 loc) · 3.88 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2015, Bahar Sateli
-->
<project name="tdb-exporter" default="jar" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant" xmlns="antlib:org.apache.tools.ant">
<!-- Ivy task definition -->
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.dir}/ivy.jar"/>
<target name="init" description="Initialize build properties">
<!-- Ivy properties - do not edit -->
<property name="ivy.install.version" value="2.4.0" />
<property name="ivy.home" value="${basedir}/ivy" />
<property name="ivy.jar.dir" value="${ivy.home}/lib" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<!-- build properties - do not edit -->
<property name="jar.name" value="tdb-exporter.jar"/>
<property name="dist.dir" value="dist"/>
<property name="src.dir" value="src"/>
<property name="bin.dir" value="bin"/>
<property name="lib.dir" value="lib"/>
<path id="compile.classpath">
<fileset dir="${lib.dir}" >
<include name="*.jar" />
</fileset>
</path>
</target>
<!-- If ivy.jar already exists, the build will skip this step -->
<target name="download-ivy" description="Download ivy.jar from Maven central repository to resolve the dependencies.">
<mkdir dir="${ivy.jar.dir}"/>
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar"
dest="${ivy.jar.file}" usetimestamp="true"/>
</target>
<target name="resolve" depends="init, download-ivy" description="Download dependencies using ivy">
<path id="ivy.lib.path">
<fileset dir="ivy/lib" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
<ivy:settings file="${basedir}/ivysettings.xml" />
<ivy:retrieve pattern="${lib.dir}/[artifact].[ext]"/>
</target>
<target name="compile" depends="resolve" description="Compile the source" >
<mkdir dir="${bin.dir}"/>
<javac srcdir="${src.dir}" debug="true" debuglevel="lines,vars,source" destdir="${bin.dir}">
<classpath refid="compile.classpath" />
</javac>
</target>
<target name="jar" depends="compile" description="Creates an executable JAR">
<mkdir dir="${dist.dir}"/>
<copy todir="${dist.dir}">
<fileset dir="${bin.dir}"/>
</copy>
<copy todir="${dist.dir}/lib">
<fileset dir="${lib.dir}"/>
</copy>
<path id="manifest.classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<manifestclasspath property="jar.classpath" jarfile="${jar.name}">
<classpath refid="manifest.classpath"/>
</manifestclasspath>
<jar destfile="${jar.name}" basedir="${dist.dir}" update="true">
<manifest>
<attribute name="Main-Class" value="com.baharsateli.lod.convertors.TDBExporter"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
</manifest>
</jar>
<delete dir="${dist.dir}"/>
</target>
<target name="clean" depends="init" description="Delete generated class files and ivy folder">
<delete dir="${ivy.home}"/>
<delete includeEmptyDirs="true" verbose="true">
<fileset dir="${bin.dir}" includes="**/**"/>
</delete>
<delete includeEmptyDirs="true">
<fileset dir="${lib.dir}">
<include name="*"/>
</fileset>
</delete>
</target>
</project>