diff --git a/jme3-bullet-native/build.gradle b/jme3-bullet-native/build.gradle index 99d7f9e63..b62ef3e84 100644 --- a/jme3-bullet-native/build.gradle +++ b/jme3-bullet-native/build.gradle @@ -126,8 +126,6 @@ task unzipBullet(type: Copy) { unzipBullet.dependsOn { def zipFilePath = project.projectDir.absolutePath + File.separator + bulletZipFile def zipFile = new File(zipFilePath) -// println "zipFile path: " + zipFile.absolutePath -// println "zipFile exists: " + zipFile.exists() if (!zipFile.exists()) { downloadBullet } @@ -135,40 +133,45 @@ unzipBullet.dependsOn { compileJava.dependsOn { def bulletUnzipDir = new File(project.projectDir.absolutePath + File.separator + bulletFolder) -// println "bulletUnzipDir path: " + bulletUnzipDir.absolutePath -// println "bulletUnzipDir exists: " + bulletUnzipDir.isDirectory() if (!bulletUnzipDir.isDirectory()) { unzipBullet } } -//task buildAllExecutables { -// dependsOn binaries.withType(SharedLibraryBinary).matching { -// it.buildable -// } -//} - -// Adds all built binaries to java jar task +// Adds all available binaries to java jar task binaries.withType(SharedLibraryBinary) { binary -> + // For all binaries that can't be built on the current system if (!buildable) { - //TODO: obtain elsewhere if not available + //Get from libs folder if no fresh build is available in the build folder and add to jar file if(!binary.tasks.outputFile.get(0).exists()){ + def fileName = binary.tasks.outputFile.get(0).getName(); + def precompiledFile = new File("libs/native/${targetPlatform.operatingSystem.name}/${targetPlatform.architecture.name}/${fileName}") + if(precompiledFile.exists()){ + jar.into("native/${targetPlatform.operatingSystem.name}/${targetPlatform.architecture.name}") { from precompiledFile } + } return - }else{ - // Add output to jar file if the binary exists in the build folder already, + } else{ + // Add binary to jar file if the binary exists in the build folder already, // e.g. when the build of jme3-bullet-native has been run on a virtual box // and the project hasn't been cleaned yet. jar.into("native/${targetPlatform.operatingSystem.name}/${targetPlatform.architecture.name}") { from binary.tasks.outputFile } return } } - // Get builder of this binary - def builderTask = binary.tasks + // For all binaries that can be built on the current system + def builderTask = binary.tasks // Add output to jar file jar.into("native/${targetPlatform.operatingSystem.name}/${targetPlatform.architecture.name}") { from builderTask.outputFile } // Add depend on build jar.dependsOn builderTask + // Add output to libs folder + task "copyBinaryToLibs${targetPlatform}"(type: Copy) { + from builderTask.outputFile + into "libs/native/${targetPlatform.operatingSystem.name}/${targetPlatform.architecture.name}" + } + // Add depend on copy + jar.dependsOn("copyBinaryToLibs${targetPlatform}") } // Helper class to wrap ant dowload task diff --git a/jme3-bullet-native/libs/native/linux/x86/libbulletjme.so b/jme3-bullet-native/libs/native/linux/x86/libbulletjme.so new file mode 100644 index 000000000..ae3d96db9 Binary files /dev/null and b/jme3-bullet-native/libs/native/linux/x86/libbulletjme.so differ diff --git a/jme3-bullet-native/libs/native/linux/x86_64/libbulletjme.so b/jme3-bullet-native/libs/native/linux/x86_64/libbulletjme.so new file mode 100644 index 000000000..7a5b255c6 Binary files /dev/null and b/jme3-bullet-native/libs/native/linux/x86_64/libbulletjme.so differ diff --git a/jme3-bullet-native/libs/native/osx/x86/libbulletjme.dylib b/jme3-bullet-native/libs/native/osx/x86/libbulletjme.dylib new file mode 100644 index 000000000..1e52e1ce4 Binary files /dev/null and b/jme3-bullet-native/libs/native/osx/x86/libbulletjme.dylib differ diff --git a/jme3-bullet-native/libs/native/osx/x86_64/libbulletjme.dylib b/jme3-bullet-native/libs/native/osx/x86_64/libbulletjme.dylib new file mode 100644 index 000000000..981e3e12d Binary files /dev/null and b/jme3-bullet-native/libs/native/osx/x86_64/libbulletjme.dylib differ diff --git a/jme3-bullet-native/libs/native/windows/x86/bulletjme.dll b/jme3-bullet-native/libs/native/windows/x86/bulletjme.dll new file mode 100644 index 000000000..6839705bf Binary files /dev/null and b/jme3-bullet-native/libs/native/windows/x86/bulletjme.dll differ diff --git a/jme3-bullet-native/libs/native/windows/x86_64/bulletjme.dll b/jme3-bullet-native/libs/native/windows/x86_64/bulletjme.dll new file mode 100644 index 000000000..3a2aa3449 Binary files /dev/null and b/jme3-bullet-native/libs/native/windows/x86_64/bulletjme.dll differ