-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
executable file
·193 lines (171 loc) · 6.79 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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?xml version="1.0"?>
<project name="Pronto" default="dist" basedir=".">
<description>
Pronto is an extension of Pellet to reason with probabilistic ontologies.
</description>
<!-- Read user properties -->
<property file="build.properties" />
<!-- Enviroment -->
<property environment="env" />
<!-- Global Properties -->
<property name="src" location="src" />
<property name="test.dir" location="test" />
<property name="examples.dir" location="examples" />
<property name="javadoc.dir" location="doc/javadoc" />
<property name="build" location="build" />
<property name="build.class" location="${build}/class" />
<property name="build.lib" location="${build}/lib" />
<property name="dist" location="dist" />
<property name="project.name" value="pronto" />
<property name="pronto.name" value="pronto" />
<property name="project.version.number" value="0.2" />
<property name="pronto.runner" value="uk.ac.manchester.cs.pronto.Pronto" />
<property name="pronto.tester" value="uk.ac.manchester.cs.pronto.ProntoMainTestSuite" />
<path id="project.class.path">
<pathelement location="lib/" />
<pathelement location="${build.class}" />
<fileset dir="lib">
<include name="**/*.jar" />
<exclude name="**/${project.name}*.jar" />
</fileset>
</path>
<target name="init">
<pathconvert targetos="unix" property="classpath" refid="project.class.path" />
<echo>CLASSPATH=${classpath}</echo>
<!-- Create the time stamp -->
<tstamp />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.class}" />
</target>
<target name="compile" depends="init" description="Compile source files.">
<javac source="1.7" target="1.7" destdir="${build.class}" debug="yes" deprecation="yes">
<src path="${src}" />
<src path="${test.dir}" />
<classpath refid="project.class.path" />
</javac>
</target>
<target name="build" depends="compile" description="Compile sources and copy data files into build directory.">
<copy todir="${build.class}">
<fileset dir="${src}">
<exclude name="**/*.java" />
</fileset>
<fileset dir=".">
<include name="images/*" />
</fileset>
</copy>
<copy todir="${build.lib}" flatten="true">
<fileset dir="lib" />
</copy>
</target>
<target name="test" depends="build">
<echo>-Djava.library.path=${natives.dir}</echo>
<junit fork="yes" maxmemory="1024M" haltonfailure="no" printsummary="on">
<classpath refid="project.class.path" />
<jvmarg value="-Djava.library.path=${natives.dir}"/>
<test name="${pronto.tester}" />
<formatter type="plain" usefile="false" />
</junit>
</target>
<target name="run" depends="dist">
<java classname="${pronto.runner}" fork="true" maxmemory="1024M">
<classpath refid="project.class.path" />
</java>
</target>
<target name="label-date" depends="init">
<property name="project.version.label" value="${DSTAMP}" />
<property name="project.label" value="${project.name}-${DSTAMP}" />
</target>
<target name="label-nightly" depends="init">
<property name="project.version.label" value="nightly-build-${DSTAMP}" />
<property name="project.label" value="${project.name}-nightly" />
</target>
<target name="label-release" depends="init">
<property name="project.version.label" value="${project.version.number}" />
<property name="project.label" value="${project.name}-${project.version.number}" />
</target>
<target name="distfiles">
<!-- Copy in lib files -->
<mkdir dir="${dist}/lib" />
<copy todir="${dist}/lib">
<fileset dir="lib">
<include name="**/*.jar" />
<include name="**/*.txt" />
<exclude name="**/${project.name}*.jar" />
</fileset>
</copy>
<!-- Copy base files in -->
<copy todir="${dist}">
<fileset dir="">
<include name="build.xml" />
<include name="doc/**" />
<include name="natives/**" />
<include name="LICENSE.txt" />
<include name="*.bat" />
<include name="pronto.sh" />
<include name="readme.txt" />
<include name="src/**" />
<include name="test/**" />
<include name="test_data/**" />
<include name="examples/**" />
<include name="run_example_brc.bat" />
<include name="run_test.bat" />
<include name="run_example_brc.sh" />
</fileset>
</copy>
</target>
<target name="dist" depends="build,distfiles" description="Generate a distribution">
<!-- Generate relative classpath for jar file -->
<property name="lib" location="${basedir}/lib/" />
<pathconvert dirsep="/" pathsep=" " property="Class-Path">
<map from="${lib}/" to="" />
<map from="${lib}\" to="" />
<!--" (dumb vim problem with quotes)-->
<path>
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</path>
</pathconvert>
<!-- Make Jar file. -->
<jar jarfile="${dist}/lib/${pronto.name}.jar" basedir="${build.class}">
<manifest>
<attribute name="Main-Class" value="${pronto.runner}" />
<attribute name="Class-Path" value="${Class-Path}" />
</manifest>
</jar>
</target>
<target name="zipfile" depends="label-date,dist,javadoc" description="Build a zipfile containing source and binaries.">
<condition property="project.dirname" value="${project.name}-${DSTAMP}">
<not>
<isset property="project.dirname" />
</not>
</condition>
<!-- Copy the javadocs -->
<copy todir="${dist}">
<fileset dir="">
<include name="doc/**" />
</fileset>
</copy>
<zip destfile="${dist}/${project.dirname}.zip">
<zipfileset dir="dist" prefix="${project.dirname}" excludes="${project.name}*.zip" />
</zip>
</target>
<target name="javadoc" depends="build">
<javadoc destdir="${javadoc.dir}" access="public" use="true" notree="false" nonavbar="false" noindex="false" splitindex="true" author="true" version="true" nodeprecatedlist="false" nodeprecated="false" sourcepath="${src}" packagenames="com.clarkparsia.pronto.*" doctitle="${project.name}-${project.version.label}" bottom="Copyright © 2008 Clark & Parsia, LLC. All Rights Reserved.">
<classpath refid="project.class.path" />
</javadoc>
</target>
<target name="release" depends="label-release">
<property name="project.dirname" value="${project.name}-${project.version.label}" />
<antcall target="zipfile" />
</target>
<target name="nightly-release" depends="label-nightly">
<property name="project.dirname" value="${project.name}-nightly" />
<antcall target="zipfile" />
</target>
<target name="clean" description="Clean up build files">
<delete dir="${build}" />
<delete dir="${dist}" />
<delete dir="${javadoc.dir}" />
</target>
</project>