diff --git a/bindings/java/build-unix.xml b/bindings/java/build-unix.xml index 4f802989eac7243d47438b3260c3597a4432aad0..47ba9ed8cd2c987e3364dd688ed79055ddb689fb 100644 --- a/bindings/java/build-unix.xml +++ b/bindings/java/build-unix.xml @@ -95,4 +95,8 @@ <!-- depends targets take care of the actual copying since the file differs on OS X and Linux --> <!-- This assumes that TSK, libewf, and zlib have been installed on the system and those libraries will be with normal loading approaches --> </target> + + <target name="setupEnvPath" /> + + </project> diff --git a/bindings/java/build-windows.xml b/bindings/java/build-windows.xml index 9bf061fea6b6cd3588a4725e69df10268b242ad7..0afb6c3306c3d1959eb130e1ae82c7892cc68986 100644 --- a/bindings/java/build-windows.xml +++ b/bindings/java/build-windows.xml @@ -36,42 +36,42 @@ <target name="check-native-build" depends="check-build-32,check-build-64"/> - <target name="check-build-32" if="win32.exists"> + <target name="check-build-32" if="win32.TskLib.exists"> <uptodate property="native-up-to-date" srcfile="${basedir}/../../win32/Release/libtsk_jni.dll" targetfile="${x86}/win/libtsk_jni.dll"/> </target> - <target name="check-build-64" if="win32.exists"> + <target name="check-build-64" if="win32.TskLib.exists"> <uptodate property="native-up-to-date" srcfile="${basedir}/../../win32/x64/Release/libtsk_jni.dll" targetfile="${amd64}/win/libtsk_jni.dll"/> </target> - <target name="copyLibs" depends="copyWinLibs" description="Copy native libs to the correct folder"> + <target name="copyLibs" description="Copy native libs to the correct folder"> <property name="tsk.config" value="Release"/> - <antcall target="copyWinLibs" /> + <antcall target="copyWinTskLibsToBuild" /> </target> - <target name="copyLibsDebug" depends="copyWinLibs" description="Copy native libs to the correct folder"> + <target name="copyLibsDebug" description="Copy native libs to the correct folder"> <property name="tsk.config" value="Debug"/> - <antcall target="copyWinLibs" /> + <antcall target="copyWinTskLibsToBuild" /> </target> - <target name="copyWinLibs" depends="copyWinLibs64,copyWinLibs32" description="Copy windows dlls to the correct location." /> + <target name="copyWinTskLibsToBuild" depends="copyWinTskLibs64ToBuild,copyWinTskLibs32ToBuild" description="Copy windows dlls to the correct location." /> - <target name="checkLibDirs"> - <available property="win64.exists" type="file" file="${basedir}/../../win32/x64/${tsk.config}/libtsk_jni.dll" /> - <available property="win32.exists" type="file" file="${basedir}/../../win32/${tsk.config}/libtsk_jni.dll" /> + <target name="checkTskLibDirs"> + <available property="win64.TskLib.exists" type="file" file="${basedir}/../../win32/x64/${tsk.config}/libtsk_jni.dll" /> + <available property="win32.TskLib.exists" type="file" file="${basedir}/../../win32/${tsk.config}/libtsk_jni.dll" /> </target> - <target name="copyWinLibs64" depends="checkLibDirs" if="win64.exists"> + <target name="copyWinTskLibs64ToBuild" depends="checkTskLibDirs" if="win64.TskLib.exists"> <property name="tsk.jni.64" location="${basedir}/../../win32/x64/${tsk.config}/libtsk_jni.dll" /> <copy file="${tsk.jni.64}" todir="${amd64}/win" overwrite="true"/> <copy file="${tsk.jni.64}" todir="${x86_64}/win" overwrite="true"/> </target> - <target name="copyWinLibs32" depends="checkLibDirs" if="win32.exists"> + <target name="copyWinTskLibs32ToBuild" depends="checkTskLibDirs" if="win32.TskLib.exists"> <property name="tsk.jni.32" location="${basedir}/../../win32/${tsk.config}/libtsk_jni.dll" /> <copy file="${tsk.jni.32}" todir="${i386}/win" overwrite="true"/> @@ -79,4 +79,10 @@ <copy file="${tsk.jni.32}" todir="${i586}/win" overwrite="true"/> <copy file="${tsk.jni.32}" todir="${i686}/win" overwrite="true"/> </target> + + <target name="setupEnvPath"> + <!-- Add both of these to env path: + "${basedir}/../../win32/x64/${tsk.config}/libtsk_jni.dll" /> + "${basedir}/../../win32/${tsk.config}/libtsk_jni.dll" /> --> + </target> </project> diff --git a/bindings/java/build.xml b/bindings/java/build.xml index 5f3725ce4db4e6ed00b88d37d22e2956b5699c98..3c0e9f1803289713affb15205cb4187a63fb6026 100755 --- a/bindings/java/build.xml +++ b/bindings/java/build.xml @@ -12,6 +12,7 @@ <!-- set global properties for this build --> <property name="src" location="src/org/sleuthkit/datamodel"/> + <property name="sample" location="src/org/sleuthkit/datamodel/Examples"/> <property name="build" location="build/"/> <property name="dist" location="dist"/> <property name="lib" location="lib"/> @@ -173,4 +174,18 @@ pattern="lib/[artifact]-[revision](-[classifier]).[ext]" /> </target> <!-- NOTE: test and test-rebuild targets are in the OS-specific files --> + + + <target name="compile-sample" depends="compile" + description="compile the sample" > + <javac debug="on" srcdir="${sample}" destdir="${build}" includeantruntime="false"> + <classpath refid="libraries"/> + </javac> + </target> + + <target name="run-sample" depends="setupEnvPath" + description="run the sample" > + + </target> + </project> diff --git a/bindings/java/src/Examples/Sample.java b/bindings/java/src/org/sleuthkit/datamodel/Examples/Sample.java similarity index 96% rename from bindings/java/src/Examples/Sample.java rename to bindings/java/src/org/sleuthkit/datamodel/Examples/Sample.java index 7ef711425d72db42bd5c1ab7c5006c7f6ce054a1..830eb67a6ecd393172a1478fc09fb057fb80ae41 100755 --- a/bindings/java/src/Examples/Sample.java +++ b/bindings/java/src/org/sleuthkit/datamodel/Examples/Sample.java @@ -4,7 +4,7 @@ * and open the template in the editor. */ -package Examples; +package org.sleuthkit.datamodel.Examples; import java.util.List; import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.Content;