- allow adding precompiled bullet binaries to natives jar for binaries that can't be built on the current system
- add precompiled bullet libraries
This commit is contained in:
parent
104254f6a6
commit
05e1d528ab
@ -126,8 +126,6 @@ task unzipBullet(type: Copy) {
|
|||||||
unzipBullet.dependsOn {
|
unzipBullet.dependsOn {
|
||||||
def zipFilePath = project.projectDir.absolutePath + File.separator + bulletZipFile
|
def zipFilePath = project.projectDir.absolutePath + File.separator + bulletZipFile
|
||||||
def zipFile = new File(zipFilePath)
|
def zipFile = new File(zipFilePath)
|
||||||
// println "zipFile path: " + zipFile.absolutePath
|
|
||||||
// println "zipFile exists: " + zipFile.exists()
|
|
||||||
if (!zipFile.exists()) {
|
if (!zipFile.exists()) {
|
||||||
downloadBullet
|
downloadBullet
|
||||||
}
|
}
|
||||||
@ -135,40 +133,45 @@ unzipBullet.dependsOn {
|
|||||||
|
|
||||||
compileJava.dependsOn {
|
compileJava.dependsOn {
|
||||||
def bulletUnzipDir = new File(project.projectDir.absolutePath + File.separator + bulletFolder)
|
def bulletUnzipDir = new File(project.projectDir.absolutePath + File.separator + bulletFolder)
|
||||||
// println "bulletUnzipDir path: " + bulletUnzipDir.absolutePath
|
|
||||||
// println "bulletUnzipDir exists: " + bulletUnzipDir.isDirectory()
|
|
||||||
if (!bulletUnzipDir.isDirectory()) {
|
if (!bulletUnzipDir.isDirectory()) {
|
||||||
unzipBullet
|
unzipBullet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//task buildAllExecutables {
|
// Adds all available binaries to java jar task
|
||||||
// dependsOn binaries.withType(SharedLibraryBinary).matching {
|
|
||||||
// it.buildable
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
// Adds all built binaries to java jar task
|
|
||||||
binaries.withType(SharedLibraryBinary) { binary ->
|
binaries.withType(SharedLibraryBinary) { binary ->
|
||||||
|
// For all binaries that can't be built on the current system
|
||||||
if (!buildable) {
|
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()){
|
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
|
return
|
||||||
}else{
|
} else{
|
||||||
// Add output to jar file if the binary exists in the build folder already,
|
// 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
|
// e.g. when the build of jme3-bullet-native has been run on a virtual box
|
||||||
// and the project hasn't been cleaned yet.
|
// and the project hasn't been cleaned yet.
|
||||||
jar.into("native/${targetPlatform.operatingSystem.name}/${targetPlatform.architecture.name}") { from binary.tasks.outputFile }
|
jar.into("native/${targetPlatform.operatingSystem.name}/${targetPlatform.architecture.name}") { from binary.tasks.outputFile }
|
||||||
return
|
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
|
// Add output to jar file
|
||||||
jar.into("native/${targetPlatform.operatingSystem.name}/${targetPlatform.architecture.name}") { from builderTask.outputFile }
|
jar.into("native/${targetPlatform.operatingSystem.name}/${targetPlatform.architecture.name}") { from builderTask.outputFile }
|
||||||
// Add depend on build
|
// Add depend on build
|
||||||
jar.dependsOn builderTask
|
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
|
// Helper class to wrap ant dowload task
|
||||||
|
BIN
jme3-bullet-native/libs/native/linux/x86/libbulletjme.so
Normal file
BIN
jme3-bullet-native/libs/native/linux/x86/libbulletjme.so
Normal file
Binary file not shown.
BIN
jme3-bullet-native/libs/native/linux/x86_64/libbulletjme.so
Normal file
BIN
jme3-bullet-native/libs/native/linux/x86_64/libbulletjme.so
Normal file
Binary file not shown.
BIN
jme3-bullet-native/libs/native/osx/x86/libbulletjme.dylib
Normal file
BIN
jme3-bullet-native/libs/native/osx/x86/libbulletjme.dylib
Normal file
Binary file not shown.
BIN
jme3-bullet-native/libs/native/osx/x86_64/libbulletjme.dylib
Normal file
BIN
jme3-bullet-native/libs/native/osx/x86_64/libbulletjme.dylib
Normal file
Binary file not shown.
BIN
jme3-bullet-native/libs/native/windows/x86/bulletjme.dll
Normal file
BIN
jme3-bullet-native/libs/native/windows/x86/bulletjme.dll
Normal file
Binary file not shown.
BIN
jme3-bullet-native/libs/native/windows/x86_64/bulletjme.dll
Normal file
BIN
jme3-bullet-native/libs/native/windows/x86_64/bulletjme.dll
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user