forked from sleuthkit/autopsy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
217 lines (180 loc) · 9.78 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
<!-- for some information on what you could do (e.g. targets to override). -->
<!-- If you delete this file and reopen the project it will be recreated. -->
<project name="Autopsy3" basedir=".">
<description>Builds the module suite Autopsy3.</description>
<import file="nbproject/build-impl.xml"/>
<property name="netbeans-plat-version" value="7.2" />
<property name="nbplatform.active.dir" value="${basedir}/netbeans-plat/${netbeans-plat-version}" />
<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"/>
<property name="thirdparty.dir" value="${basedir}/thirdparty" />
<!-- import ant-contrib tools -->
<property name="ant-contrib.dir" value="${thirdparty.dir}/ant-contrib/1.0b3" />
<property name="ant.contrib.jar" value="${ant-contrib.dir}/ant-contrib.jar" />
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="${ant.contrib.jar}"/>
</classpath>
</taskdef>
<!-- This seems really bad to be hard coded, but I couldn't find a better solution -->
<path id="jni-path">
<pathelement location="${basedir}/build/cluster/modules/org-sleuthkit-datamodel.jar"/>
<path refid="cluster.path.id" />
</path>
<!-- Verify that the TSK_HOME env variable is set -->
<target name="findTSK">
<property environment="env"/>
<condition property="tskFound">
<isset property="env.TSK_HOME"/>
</condition>
<fail unless="tskFound" message="TSK_HOME must be set as an environment variable."/>
<echo> TSK_HOME: ${env.TSK_HOME}</echo>
</target>
<!-- Verify that the JRE_HOME env variable is set -->
<target name="findJRE">
<property environment="env"/>
<condition property="jreFound">
<isset property="env.JRE_HOME"/>
</condition>
<fail unless="jreFound" message="JRE_HOME must be set as an environment variable."/>
</target>
<target name="getExternals" depends="findTSK,copyTSKLibsToRelease">
<property environment="env"/>
<!-- Done in core module
<copy file="${env.TSK_HOME}/bindings/java/dist/Tsk_DataModel.jar" tofile="${basedir}/Core/release/modules/ext/Tsk_DataModel.jar"/>
<copy file="${env.TSK_HOME}/bindings/java/lib/sqlite-jdbc-3.7.2.jar" tofile="${basedir}/Core/release/modules/ext/sqlite-jdbc-3.7.2.jar"/>
-->
</target>
<target name="getJunit">
<property name="junit.dir" value="${thirdparty.dir}/junit/${netbeans-plat-version}" />
<unzip src="${junit.dir}/junit.zip" dest="${nbplatform.active.dir}"/>
</target>
<!-- This target will create a custom ZIP file for us. It first uses the general
ZIP target and then opens it up and adds in any files that we want. This is where we customize the
version number. -->
<target name="build-zip" depends="suite.build-zip,findJRE">
<property name="nbdist.dir" value="dist"/>
<property name="release.dir" value="${nbdist.dir}/${app.name}"/>
<!-- step (2) unzip the result -->
<property name="zip-tmp" value="${nbdist.dir}/tmp"/>
<delete dir="${zip-tmp}"/>
<mkdir dir="${zip-tmp}"/>
<unzip src="${nbdist.dir}/${app.name}.zip" dest="${zip-tmp}"/>
<!-- step (3) do your copying stuff here, check the ant doc for copy, move, etc file -->
<copy file="${basedir}/README.txt" tofile="${zip-tmp}/${app.name}/README.txt"/>
<copy file="${basedir}/LICENSE-2.0.txt" tofile="${zip-tmp}/${app.name}/LICENSE-2.0.txt"/>
<copy file="${basedir}/NEWS.txt" tofile="${zip-tmp}/${app.name}/NEWS.txt"/>
<copy file="${basedir}/KNOWN_ISSUES.txt" tofile="${zip-tmp}/${app.name}/KNOWN_ISSUES.txt"/>
<unzip src="${thirdparty.dir}/gstreamer/${os.family}/i386/0.10.7/gstreamer.zip" dest="${zip-tmp}/${app.name}/gstreamer"/>
<copy todir="${zip-tmp}/${app.name}/jre6">
<fileset dir="${env.JRE_HOME}"/>
</copy>
<copy file="${basedir}/branding_${app.name}/icon.ico" tofile="${zip-tmp}/${app.name}/icon.ico" overwrite="true"/>
<antcall target="copyExternalLibsToZip"></antcall>
<propertyfile
file="${zip-tmp}/${app.name}/etc/${app.name}.conf">
<entry key="default_options" value=""--branding ${app.name} -J-Xms24m -J-Xmx1024m"" />
<entry key="jdkhome" value=""jre6"" />
</propertyfile>
<!-- step (4) zip again, but with the version numbers in the dir -->
<zip destfile="${nbdist.dir}/${app.name}-${app.version}.zip">
<zipfileset dir="${zip-tmp}/${app.name}"/>
</zip>
<delete dir="${zip-tmp}"/>
<delete file="${nbdist.dir}/${app.name}.zip"/>
<echo message=" "/>
<echo message="cleaning and finalizing release" />
<delete dir="${release.dir}"/>
</target>
<target name="getProps" depends="prop-files,input-build-type,input-version"></target>
<target name="prop-files">
<property file="nbproject/private/private.properties"/>
<property file="nbproject/project.properties"/>
</target>
<target name="input-build-type" unless="build.type">
<input addProperty="build.type"
message="Enter the desired build type:"
validargs="DEVELOPMENT,RELEASE"
defaultvalue="DEVELOPMENT"/>
</target>
<target name="input-version" unless="app.version">
<tstamp/>
<property name="app.version" value="${DSTAMP}"/>
</target>
<target name="-init" depends="-taskdefs,-convert-old-project,getExternals,getProps,getJunit">
<convertclusterpath from="${cluster.path.evaluated}" to="cluster.path.final" id="cluster.path.id"/>
<sortsuitemodules unsortedmodules="${modules}" sortedmodulesproperty="modules.sorted"/>
<property name="cluster" location="build/cluster"/>
<echo level="verbose">Suite in ${basedir} with clusters ${cluster.path.final}, build cluster ${cluster}, and sorted modules ${modules.sorted}</echo>
<!-- synchronize with SuiteProject -->
<property name="disabled.modules" value=""/>
<property name="enabled.clusters" value=""/>
<property name="disabled.clusters" value=""/>
<condition property="branding.dir" value="branding_${app.name}">
<not>
<equals arg1="${app.name}" arg2="autopsy"/>
</not>
</condition>
<property name="branding.dir" location="branding"/>
<property name="dist.dir" location="dist"/>
<!-- MOVE THE .DLL FILES TO THE NETBEANS DIRECTORY -->
<condition property="run.branding"> <!-- #84689 -->
<and>
<available file="${branding.dir}" type="dir"/>
<isset property="branding.token"/>
</and>
</condition>
</target>
<!-- override build to add branding -->
<target name="build" depends="build-brand,suite.build" description="Compiles autopsy and produces a basic branded build that can run on a dev. system" />
<target name="build-brand" depends="-init">
<echo>${app.name} branding</echo>
<copy file="${basedir}/branding_${app.name}/welcome_logo.png" tofile="${basedir}/Core/src/org/sleuthkit/autopsy/casemodule/welcome_logo.png" overwrite="true"/>
<propertyfile
file="${branding.dir}/core/core.jar/org/netbeans/core/startup/Bundle.properties"
comment="Updated by build script">
<entry key="currentVersion" value="${app.title} ${app.version}" />
</propertyfile>
<propertyfile
file="${branding.dir}/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties"
comment="Updated by build script">
<entry key="CTL_MainWindow_Title" value="${app.title} ${app.version}" />
<entry key="CTL_MainWindow_Title_No_Project" value="${app.title} ${app.version}" />
</propertyfile>
<propertyfile
file="${basedir}/Core/src/org/sleuthkit/autopsy/coreutils/Version.properties"
comment="Updated by build script">
<entry key="app.name" value="${app.title}" />
<entry key="app.version" value="${app.version}" />
<entry key="build.type" value="${build.type}" />
</propertyfile>
<copy todir="${basedir}" failonerror="false">
<fileset dir="${branding.dir}/bundles"
includes="**/*"/>
</copy>
</target>
<target name="jni" depends="build,findTSK">
<javah verbose="yes" outputFile="${env.TSK_HOME}/bindings/java/tsk_jni/tsk_jni/dataModel_SleuthkitJNI.h">
<class name="org.sleuthkit.datamodel.SleuthkitJNI" />
<classpath refid="jni-path"/>
</javah>
</target>
<target name="doxygen" description="build doxygen docs, requires doxygen in PATH" depends="-init,-hide-excluded-modules">
<exec executable="doxygen" dir="${basedir}/docs/doxygen">
<arg value="Doxyfile"/>
</exec>
</target>
<target name="build-installer-dir" depends="build-zip" description="Builds Autopsy with branding and all dependencies" >
<unzip src="${nbdist.dir}/${app.name}-${app.version}.zip" dest="${nbdist.dir}/${app.name}-installer"/>
</target>
<target name="build-installer" depends="build-installer-dir" description="Builds Autopsy installer.">
<antcall target="build-installer-${os.family}" />
</target>
</project>