diff --git a/bindings/java/build-unix.xml b/bindings/java/build-unix.xml index 52e8df9caa6a6cb502f0dfa3f4d893247154949a..cd0ef4934b8d82b083ce704d08328bc3dcae072e 100644 --- a/bindings/java/build-unix.xml +++ b/bindings/java/build-unix.xml @@ -37,13 +37,26 @@ <property environment="env"/> <copy file="./jni/.libs/libtsk_jni.dylib" tofile="./libtsk_jni.jnilib"/> </target> + + <target name="copyMacLibs" depends="testTSKLibs" if="tsk_dylib.present"> + <property environment="env"/> + <property name="jni.dylib" location="${basedir}/jni/.libs/libtsk_jni.dylib" /> + <property name="jni.jnilib" value="libtsk_jni.jnilib" /> + <copy file="${jni.dylib}" tofile="${x86_64}/mac/${jni.jnilib}"/> + </target> <!-- Non-OS X --> <target name="copyTskLibs_so" depends="testTSKLibs" if="tsk_so.present"> <property environment="env"/> <copy file="./jni/.libs/libtsk_jni.so" tofile="./libtsk_jni.so"/> </target> + + <target name="copyUnixLibs" depends="testTSKLibs" if="tsk_so.present"> + <!-- does nothing for now --> + </target> + <target name="copyLibs" depends="copyUnixLibs,copyMacLibs" /> + <target name="copyTSKLibs" depends="copyTskLibs_so,copyTskLibs_dylib"> <!-- 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 --> diff --git a/bindings/java/build-windows.xml b/bindings/java/build-windows.xml index f39120063a3df3a8f23e4c3c686b18e600e64727..375e389d1d67173be321c0eab94c39be7276f479 100644 --- a/bindings/java/build-windows.xml +++ b/bindings/java/build-windows.xml @@ -33,4 +33,63 @@ <sysproperty key="types" value="${test-types}"/> </java> </target> + + <target name="copyLibs" depends="copyWinLibs" description="Copy native libs to the correct folder" /> + + <target name="copyWinLibs" depends="copyWinLibs64,copyWinLibs32" description="Copy windows dlls to the correct location." /> + + <target name="checkLibDirs"> + <available property="win64.exists" type="dir" file="${basedir}/../../win32/x64/Release" /> + <available property="win32.exists" type="dir" file="${basedir}/../../win32/Release" /> + </target> + + <target name="copyWinLibs64" depends="checkLibDirs" if="win64.exists"> + <property name="win64dir" location="${basedir}/../../win32/x64/Release" /> + <fileset dir="${win64dir}" id="win64dlls"> + <include name="*.dll" /> + </fileset> + <copy todir="${amd64}/win"> + <fileset refid="win64dlls" /> + </copy> + <copy todir="${x86_64}/win"> + <fileset refid="win64dlls" /> + </copy> + <fileset dir="${crt}/win64" id="crt64dlls"> + <include name="*.dll" /> + </fileset> + <copy todir="${amd64}/win"> + <fileset refid="crt64dlls" /> + </copy> + <copy todir="${x86_64}/win"> + <fileset refid="crt64dlls" /> + </copy> + </target> + + <target name="copyWinLibs32" depends="checkLibDirs" if="win32.exists"> + <property name="win32dir" location="${basedir}/../../win32/Release" /> + <fileset dir="${win32dir}" id="win32dlls"> + <include name="*.dll" /> + </fileset> + <copy todir="${i386}/win"> + <fileset refid="win32dlls" /> + </copy> + <copy todir="${x86}/win"> + <fileset refid="win32dlls" /> + </copy> + <copy todir="${i586}/win"> + <fileset refid="win32dlls" /> + </copy> + <fileset dir="${crt}/win32" id="crt32dlls"> + <include name="*.dll" /> + </fileset> + <copy todir="${i386}/win"> + <fileset refid="crt32dlls" /> + </copy> + <copy todir="${x86}/win"> + <fileset refid="crt32dlls" /> + </copy> + <copy todir="${i586}/win"> + <fileset refid="crt32dlls" /> + </copy> + </target> </project> diff --git a/bindings/java/build.xml b/bindings/java/build.xml index d790b070572e3cbd1fcdc68507478555093befbb..f159a739dc765649154cfdcf46627a554a08aa26 100755 --- a/bindings/java/build.xml +++ b/bindings/java/build.xml @@ -50,6 +50,7 @@ <mkdir dir="${x86}/win" /> <mkdir dir="${x86_64}" /> <mkdir dir="${x86_64}/win" /> + <mkdir dir="${x86_64}/mac" /> <mkdir dir="${i386}" /> <mkdir dir="${i386}/win" /> <mkdir dir="${i586}" /> @@ -64,7 +65,6 @@ <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" /> @@ -112,64 +112,7 @@ pattern="lib/[artifact]-[revision](-[classifier]).[ext]" /> <jar jarfile="${dist}/Tsk_DataModel.jar" basedir="${build}"/> </target> - <target name="copyLibs" depends="copyWinLibs" description="Copy native libs to the correct folder" /> - - <target name="copyWinLibs" depends="copyWinLibs64,copyWinLibs32" description="Copy windows dlls to the correct location." /> - - <target name="checkLibDirs"> - <available property="win64.exists" type="dir" file="${basedir}/../../win32/x64/Release" /> - <available property="win32.exists" type="dir" file="${basedir}/../../win32/Release" /> - </target> - <target name="copyWinLibs64" depends="checkLibDirs" if="win64.exists"> - <property name="win64dir" location="${basedir}/../../win32/x64/Release" /> - <fileset dir="${win64dir}" id="win64dlls"> - <include name="*.dll" /> - </fileset> - <copy todir="${amd64}/win"> - <fileset refid="win64dlls" /> - </copy> - <copy todir="${x86_64}/win"> - <fileset refid="win64dlls" /> - </copy> - <fileset dir="${crt}/win64" id="crt64dlls"> - <include name="*.dll" /> - </fileset> - <copy todir="${amd64}/win"> - <fileset refid="crt64dlls" /> - </copy> - <copy todir="${x86_64}/win"> - <fileset refid="crt64dlls" /> - </copy> - </target> - - <target name="copyWinLibs32" depends="checkLibDirs" if="win32.exists"> - <property name="win32dir" location="${basedir}/../../win32/Release" /> - <fileset dir="${win32dir}" id="win32dlls"> - <include name="*.dll" /> - </fileset> - <copy todir="${i386}/win"> - <fileset refid="win32dlls" /> - </copy> - <copy todir="${x86}/win"> - <fileset refid="win32dlls" /> - </copy> - <copy todir="${i586}/win"> - <fileset refid="win32dlls" /> - </copy> - <fileset dir="${crt}/win32" id="crt32dlls"> - <include name="*.dll" /> - </fileset> - <copy todir="${i386}/win"> - <fileset refid="crt32dlls" /> - </copy> - <copy todir="${x86}/win"> - <fileset refid="crt32dlls" /> - </copy> - <copy todir="${i586}/win"> - <fileset refid="crt32dlls" /> - </copy> - </target> <target name="jni" depends="compile" description="make the jni.h file"> <javah classpath = "${build}" outputFile="jni/dataModel_SleuthkitJNI.h" force="yes"> diff --git a/bindings/java/src/org/sleuthkit/datamodel/LibraryUtils.java b/bindings/java/src/org/sleuthkit/datamodel/LibraryUtils.java index 4f7d76e872b744abf575223c142509c2462e5dd4..cac821e8c8c1c83091fa5b17c614ce7269d8d78d 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/LibraryUtils.java +++ b/bindings/java/src/org/sleuthkit/datamodel/LibraryUtils.java @@ -145,11 +145,8 @@ public static void loadLibrary(Lib library) { in.close(); out.close(); - System.out.println(libTemp.getAbsolutePath()); System.load(libTemp.getAbsolutePath()); } catch (IOException e) { - System.out.println("IO Exception:"); - System.out.println(System.getProperty("java.io.tmpdir")); e.printStackTrace(); } }