autopsy-flatpak/build-windows.xml
2016-06-28 11:50:15 -04:00

172 lines
7.0 KiB
XML

<project name="AutopsyTSKTargets">
<!-- Directory paths -->
<property name="amd64" location="${basedir}/Core/release/modules/lib/amd64" />
<property name="x86" location="${basedir}/Core/release/modules/lib/x86" />
<property name="x86_64" location="${basedir}/Core/release/modules/lib/x86_64" />
<property name="i386" location="${basedir}/Core/release/modules/lib/i386" />
<property name="i586" location="${basedir}/Core/release/modules/lib/i586" />
<property name="i686" location="${basedir}/Core/release/modules/lib/i686"/>
<property name="crt" location="${basedir}/thirdparty/crt" />
<import file="build-windows-installer.xml" />
<target name="makeBaseLibDirs" description="Set up folder hierarchy under release/modules/lib">
<mkdir dir="${amd64}"/>
<mkdir dir="${x86_64}"/>
<mkdir dir="${x86}"/>
<mkdir dir="${i386}"/>
<mkdir dir="${i586}"/>
<mkdir dir="${i686}"/>
</target>
<target name="checkTskLibDirs">
<property environment="env"/>
<condition property="ewfFound">
<isset property="env.LIBEWF_HOME"/>
</condition>
<fail unless="ewfFound" message="LIBEWF_HOME must be set as an environment variable."/>
<property name="win64.TskLib.path" value="${env.TSK_HOME}/win32/x64/Release_PostgreSQL"/>
<property name="win32.TskLib.path" value="${env.TSK_HOME}/win32/Release_PostgreSQL" />
<property name="win64.TskLib.postgres_path" value="${env.TSK_HOME}/win32/x64/Release_PostgreSQL"/>
<property name="win32.TskLib.postgres_path" value="${env.TSK_HOME}/win32/Release_PostgreSQL"/>
<available property="win64.TskLib.exists" type="dir" file="${win64.TskLib.path}" />
<available property="win32.TskLib.exists" type="dir" file="${win32.TskLib.path}" />
<available property="win64.TskLib_postgres.exists" type="dir" file="{win64.TskLib.postgres_path}" />
<available property="win32.TskLib_postgres.exists" type="dir" file="{win32.TskLib.postgres_path}" />
</target>
<!-- The following copy the libtsk_jni dependencies to the Autopsy
folder structure. libtsk_jni is inside of the JAR file and contains
libtsk and the JNI code. -->
<!-- copy 64-bit dlls into the installer folder -->
<target name="copyWinTskLibs64ToBaseDir" if="win64.TskLib.exists">
<fileset dir="${win64.TskLib.path}" id="win64dlls">
<include name="libewf.dll" />
<include name="libvmdk.dll"/>
<include name="libvhdi.dll"/>
<include name="zlib.dll"/>
</fileset>
<fileset dir="${win64.TskLib.postgres_path}" id="postgres64dlls">
<include name="libeay32.dll"/>
<include name="ssleay32.dll"/>
<include name="libintl-8.dll"/>
<include name="libiconv-2.dll"/>
<include name="libpq.dll"/>
<include name="msvcr120.dll"/>
</fileset>
<copy todir="${amd64}" overwrite="true">
<fileset refid="win64dlls" />
<fileset refid="postgres64dlls" />
</copy>
<copy todir="${x86_64}" overwrite="true">
<fileset refid="win64dlls" />
<fileset refid="postgres64dlls" />
</copy>
</target>
<!-- copy 32-bit dlls into the installer folder -->
<target name="copyWinTskLibs32ToBaseDir" if="win32.TskLib.exists">
<fileset dir="${win32.TskLib.path}" id="win32dlls">
<include name="zlib.dll" />
<include name="libvmdk.dll"/>
<include name="libvhdi.dll"/>
<include name="libewf.dll"/>
</fileset>
<fileset dir="${win32.TskLib.postgres_path}" id="postgres32dlls">
<include name="libeay32.dll"/>
<include name="ssleay32.dll"/>
<include name="libintl-8.dll"/>
<include name="libiconv-2.dll"/>
<include name="libpq.dll"/>
<include name="msvcr120.dll"/>
</fileset>
<copy todir="${i386}" overwrite="true">
<fileset refid="win32dlls" />
<fileset refid="postgres32dlls" />
</copy>
<copy todir="${x86}" overwrite="true">
<fileset refid="win32dlls" />
<fileset refid="postgres32dlls" />
</copy>
<copy todir="${i586}" overwrite="true">
<fileset refid="win32dlls" />
<fileset refid="postgres32dlls" />
</copy>
<copy todir="${i686}" overwrite="true">
<fileset refid="win32dlls" />
<fileset refid="postgres32dlls" />
</copy>
</target>
<!-- This gets called from the main build.xml -->
<target name="copyLibsToBaseDir" depends="checkTskLibDirs" description="Copy windows dlls to the correct location." >
<antcall target="makeBaseLibDirs" inheritRefs="true" />
<antcall target="copyWinTskLibs32ToBaseDir" inheritRefs="true" />
<antcall target="copyWinTskLibs64ToBaseDir" inheritRefs="true" />
</target>
<!-- CRT LIBS TO ZIP - gets called from build.xml -->
<target name="copyLibsToZip" depends="copyCRT32ToZIP,copyCRT64ToZIP"/>
<target name="copyCRT32ToZIP">
<!-- verify we have the 32-bit dlls -->
<property name="CRT32.path" value="${thirdparty.dir}/crt/win32"/>
<available file="${CRT32.path}" property="crtFound"/>
<fail unless="crtFound" message="32-bit CRT not found in the thirdparty repo in path: ${CRT32.path}"/>
<!-- copy them from third party -->
<property name="zip-lib-path" value="${zip-tmp}/${app.name}/${app.name}/modules/lib/"/>
<fileset dir="${CRT32.path}" id="crt32dlls">
<include name="*.dll"/>
</fileset>
<copy todir="${zip-lib-path}/x86" overwrite="true">
<fileset refid="crt32dlls"/>
</copy>
<copy todir="${zip-lib-path}/i386" overwrite="true">
<fileset refid="crt32dlls"/>
</copy>
<copy todir="${zip-lib-path}/i586" overwrite="true">
<fileset refid="crt32dlls"/>
</copy>
<copy todir="${zip-lib-path}/i686" overwrite="true">
<fileset refid="crt32dlls"/>
</copy>
</target>
<target name="copyCRT64ToZIP">
<!-- Verify we have the 64-bit -->
<property name="CRT64.path" value="${thirdparty.dir}/crt/win64"/>
<available file="${CRT64.path}" property="crtFound"/>
<fail unless="crtFound" message="64-bit CRT not found in the thirdparty repo in path: ${CRT64.path}"/>
<!-- Copy the libs -->
<property name="zip-lib-path" value="${zip-tmp}/${app.name}/${app.name}/modules/lib/"/>
<fileset dir="${CRT64.path}" id="crt64dlls">
<include name="*.dll"/>
</fileset>
<copy todir="${zip-lib-path}/x86_64" overwrite="true">
<fileset refid="crt64dlls"/>
</copy>
<copy todir="${zip-lib-path}/amd64" overwrite="true">
<fileset refid="crt64dlls"/>
</copy>
</target>
</project>