File: build.xml

package info (click to toggle)
sleuthkit 4.6.5-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 39,264 kB
  • sloc: ansic: 171,812; cpp: 44,216; sh: 31,364; java: 17,674; makefile: 1,241; xml: 838; perl: 797; python: 707; sed: 16
file content (238 lines) | stat: -rw-r--r-- 9,547 bytes parent folder | download | duplicates (2)
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="DataModel" default="dist" basedir=".">
	<description>
		Sleuthkit Java DataModel
	</description>
	<condition property="os.family" value="unix">
		<os family="unix"/>
	</condition>
	<condition property="os.family" value="windows">
		<os family="windows"/>
	</condition>
	<import file="build-${os.family}.xml"/>

    <!-- Careful changing this because release-windows.pl updates it by pattern -->
<property name="VERSION" value="4.6.5"/>

	<!-- set global properties for this build -->
	<property name="default-jar-location" location="/usr/share/java"/>
	<property name="src" location="src/org/sleuthkit/datamodel"/>
	<property name="sample" location="src/org/sleuthkit/datamodel/Examples"/>
	<property name="build" location="build/"/>
	<property name="build-datamodel" location="build/org/sleuthkit/datamodel"/>
	<property name="dist" location="dist"/>
	<property name="lib" location="lib"/>
	<property name="test" location="test"/>
	<property name="test-standards" location="test/output/gold"/>
	<property name="test-results" location="test/output/results"/>
	<property name="test-input" location="test/input"/>
	<property name="test-types" location="test/org/sleuthkit/datamodel"/>
	<property name="native-libs" location="build/NATIVELIBS"/>
	<property name="amd64" location="build/NATIVELIBS/amd64"/>
	<property name="x86" location="build/NATIVELIBS/x86"/>
	<property name="x86_64" location="build/NATIVELIBS/x86_64"/>
	<property name="i386" location="build/NATIVELIBS/i386"/>
	<property name="i586" location="build/NATIVELIBS/i586"/>
	<property name="i686" location="build/NATIVELIBS/i686"/>

	<!-- Only added win folders for now -->
	<target name="init">
		<mkdir dir="${build}"/>
		<mkdir dir="${dist}"/>
		<mkdir dir="${lib}"/>
		<mkdir dir="${test-input}"/>
		<mkdir dir="${test-standards}"/>
		<mkdir dir="${test-results}"/>
		<mkdir dir="${native-libs}"/>
		<mkdir dir="${amd64}"/>
		<mkdir dir="${amd64}/win"/>
		<mkdir dir="${amd64}/mac"/>
		<mkdir dir="${amd64}/linux"/>
		<mkdir dir="${x86}"/>
		<mkdir dir="${x86}/win"/>
		<mkdir dir="${x86}/linux"/>
		<mkdir dir="${x86_64}"/>
		<mkdir dir="${x86_64}/win"/>
		<mkdir dir="${x86_64}/mac"/>
		<mkdir dir="${x86_64}/linux"/>
		<mkdir dir="${i386}"/>
		<mkdir dir="${i386}/win"/>
		<mkdir dir="${i386}/linux"/>
		<mkdir dir="${i586}"/>
		<mkdir dir="${i586}/win"/>
		<mkdir dir="${i586}/linux"/>
		<mkdir dir="${i686}"/>
		<mkdir dir="${i686}/win"/>
		<mkdir dir="${i686}/linux"/>
	</target>

	<!-- set classpath for dependencies-->

	<target name="set-library-path" description="sets the path of the libraries" depends="set-library-path-online,set-library-path-offline"></target>

	<target name="set-library-path-online" description="set this library path when the user is online" unless="offline">
		<path id="libraries">
			<fileset dir="${lib}">
				<include name="*.jar"/>
			</fileset>
			<pathelement path="${build}"/>
		</path>
	</target>

	<target name="set-library-path-offline" description="set the library path when the user is offline" if="offline">
		<path id="libraries">
			<fileset dir="${default-jar-location}">
				<include name="*.jar"/>
			</fileset>
			<fileset dir="${lib}">
				<include name="*.jar"/>
			</fileset>
			<pathelement path="${build}"/>
		</path>
	</target>

	<property name="ivy.install.version" value="2.3.0-rc2"/>
	<condition property="ivy.home" value="${env.IVY_HOME}">
		<isset property="env.IVY_HOME"/>
	</condition>
	<property name="ivy.home" value="${user.home}/.ant"/>
	<property name="ivy.jar.dir" value="${ivy.home}/lib"/>
	<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar"/>

	<target name="download-ivy" unless="offline">
		<available file="${ivy.jar.file}" property="ivy.available"/>
		<antcall target="-download-ivy"/>
	</target>

	<target name="-download-ivy" unless="ivy.available">
		<mkdir dir="${ivy.jar.dir}"/>
		<get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/>
	</target>

	<target name="init-ivy" depends="download-ivy" unless="ivy.lib.path">
		<path id="ivy.lib.path">
			<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
		</path>
		<taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
	</target>

	<target name="retrieve-deps" description="retrieve dependencies using ivy" depends="init-ivy" unless="offline">
		<ivy:settings file="ivysettings.xml"/>
		<ivy:resolve/>
		<ivy:retrieve sync="true" pattern="lib/[artifact]-[revision](-[classifier]).[ext]"/>
	</target>

	<target name="compile-test" depends="compile" description="compile the tests">
		<javac debug="on" srcdir="${test}" destdir="${build}" includeantruntime="false">
			<classpath refid="libraries"/>
		</javac>
	</target>

	<target name="compile" depends="init, set-library-path, retrieve-deps" description="compile the source">
		<!-- Compile the java code from ${src} into ${build} -->
		<javac debug="on" srcdir="${src}" destdir="${build}" classpathref="libraries" includeantruntime="false">
			<compilerarg value="-Xlint"/>
		</javac>
		<!-- Copy Bundle*.properties files into DataModel build directory, so they are included in the .jar -->
		<copy todir="${build-datamodel}">
			<fileset dir="${src}" includes="**/*.properties"/>
		</copy>

		<!-- Verify sample compiles -->
		<javac debug="on" srcdir="${sample}" destdir="${build}" includeantruntime="false">
			<classpath refid="libraries"/>
		</javac>
	</target>

	<target name="dist-SQLite" depends="check-build, init-ivy, compile, copyLibs-SQLite" unless="up-to-date" description="generate the distribution">
		<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
		<jar jarfile="${dist}/sleuthkit-${VERSION}.jar" basedir="${build}"/>
	</target>

	<target name="dist-PostgreSQL" depends="check-postgresql-build, init-ivy, compile, copyLibs-PostgreSQL" unless="postgres-up-to-date" description="generate the PostgreSQL distribution">
		<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
		<jar jarfile="${dist}/sleuthkit-postgresql-${VERSION}.jar" basedir="${build}"/>
	</target>

	<target name="check-build" depends="check-native-build">
		<uptodate property="java-up-to-date" targetfile="${dist}/sleuthkit-${VERSION}.jar">
			<srcfiles dir="${src}" includes="**/*.java"/>
		</uptodate>
		<condition property="up-to-date">
			<and>
				<isset property="java-up-to-date"/>
				<isset property="native-up-to-date"/>
			</and>
		</condition>
	</target>
	
	<target name="check-postgresql-build" depends="check-native-build">
		<uptodate property="java-postgres-up-to-date" targetfile="${dist}/sleuthkit-postgresql-${VERSION}.jar">
			<srcfiles dir="${src}" includes="**/*.java"/>
		</uptodate>
		<condition property="postgres-up-to-date">
			<and>
				<isset property="java-postgres-up-to-date"/>
				<isset property="native-up-to-date"/>
			</and>
		</condition>
	</target>

	<target name="dist" depends="check-build" unless="up-to-date">
		<antcall target="dist-SQLite"/>
	</target>

	<target name="Debug" depends="check-build" unless="up-to-date">
		<antcall target="Debug-SQLite"/>
	</target>

	<target name="Debug-SQLite" depends="check-build, init-ivy, compile, copyLibs-SQLiteDebug" unless="up-to-date" description="generate the debug distribution">
		<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
		<jar jarfile="${dist}/sleuthkit-${VERSION}.jar" basedir="${build}"/>
	</target>

	<target name="Debug-PostgreSQL" depends="check-postgresql-build, init-ivy,  compile, copyLibs-PostgreSQLDebug" unless="postgres-up-to-date" description="generate the PostgreSQL debug distribution">
		<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
		<jar jarfile="${dist}/sleuthkit-postgresql-${VERSION}.jar" basedir="${build}"/>
	</target>

	<target name="jni" depends="compile" description="make the jni.h file">
		<javah classpath="${build}" outputFile="jni/dataModel_SleuthkitJNI.h" force="yes">
			<class name="org.sleuthkit.datamodel.SleuthkitJNI"/>
		</javah>
	</target>

	<target name="clean" description="clean up">
		<delete dir="${build}"/>
		<delete dir="${dist}"/>
		<delete dir="${lib}"/>
	</target>

	<target name="javadoc" description="Make the API docs">
		<mkdir dir="javadoc"/>
		<javadoc sourcepath="src" destdir="javadoc" overview="src/overview.html"/>
	</target>

	<target name="test-download" description="download test images.">
		<mkdir dir="${test-input}"/>
		<get src="http://digitalcorpora.org/corp/nps/drives/nps-2009-canon2/nps-2009-canon2-gen6.E01" dest="${test-input}"/>
		<get src="http://digitalcorpora.org/corp/nps/drives/nps-2009-ntfs1/ntfs1-gen2.E01" dest="${test-input}"/>
		<!--<get src="http://www.cfreds.nist.gov/dfr-images/dfr-16-ext.dd.bz2" dest="${test-input}"/> <bunzip2 src="${test-input}/dfr-16-ext.dd.bz2" /> -->
	</target>

	<!-- NOTE: test and test-rebuild targets are in the OS-specific files -->

	<target name="run-sample" depends="compile" description="run the sample">
		<java classname="org.sleuthkit.datamodel.Examples.Sample" fork="true" failonerror="true">
			<env key="PATH" path="${env.TEMP}:${env.Path}:${env.TSK_HOME}/win32/x64/Release"/>
			<arg value="${image}"/>
			<classpath refid="libraries"/>
		</java>

	</target>
	<target name="doxygen" description="build doxygen docs, requires doxygen in PATH">
		<exec executable="doxygen" dir="${basedir}/doxygen">
			<arg value="Doxyfile"/>
		</exec>
	</target>

</project>