diff --git a/.gitignore b/.gitignore index 7cc55d212..1e5bf3f07 100644 --- a/.gitignore +++ b/.gitignore @@ -34,12 +34,6 @@ /jme3-android-native/src/native/jme_decode/STBI/ /jme3-android-native/src/native/jme_decode/Tremor/ /jme3-android-native/stb_image.h -!/jme3-bullet-native/libs/native/windows/x86_64/bulletjme.dll -!/jme3-bullet-native/libs/native/windows/x86/bulletjme.dll -!/jme3-bullet-native/libs/native/osx/x86/libbulletjme.dylib -!/jme3-bullet-native/libs/native/osx/x86_64/libbulletjme.dylib -!/jme3-bullet-native/libs/native/linux/x86/libbulletjme.so -!/jme3-bullet-native/libs/native/linux/x86_64/libbulletjme.so /jme3-examples/private/ !/jme3-vr/src/main/resources/**/*.dylib !/jme3-vr/src/main/resources/**/*.so @@ -47,4 +41,8 @@ !/jme3-vr/src/main/resources/**/*.dll !/jme3-vr/src/main/resources/**/*.pdb /buildMaven.bat - +/private +.travis.yml +appveyor.yml +javadoc_deploy +javadoc_deploy.pub \ No newline at end of file diff --git a/build.gradle b/build.gradle index 791d7c78b..d6bdb3a22 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,6 @@ +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; + buildscript { repositories { google() @@ -146,6 +149,69 @@ task configureAndroidNDK { } } +gradle.rootProject.ext.set("usePrebuildNatives", buildNativeProjects!="true"); + +if(skipPrebuildLibraries!="true"&&buildNativeProjects!="true"){ + String rootPath = rootProject.projectDir.absolutePath + + Properties nativesSnasphotProp = new Properties() + File nativesSnasphotPropF=new File("${rootPath}/natives-snapshot.properties"); + + if(nativesSnasphotPropF.exists()){ + + nativesSnasphotPropF.withInputStream { nativesSnasphotProp.load(it) } + + String nativesSnasphot=nativesSnasphotProp.getProperty("natives.snapshot"); + String nativesUrl=PREBUILD_NATIVES_URL.replace('${natives.snapshot}',nativesSnasphot) + println "Use natives snapshot: "+nativesUrl + + String nativesZipFile="${rootPath}" + File.separator + "build"+ File.separator +nativesSnasphot+"-natives.zip" + String nativesPath="${rootPath}" + File.separator + "build"+ File.separator +"native" + + build.dependsOn('getPrebuiltNatives') + + task getPrebuiltNatives() { + doFirst { + File target = file(nativesZipFile); + + if (!target.exists()) { + println("Download natives from "+nativesUrl+" to "+nativesZipFile); + target.getParentFile().mkdirs(); + ant.get(src: nativesUrl, dest: target); + } + + for(File src : zipTree(nativesZipFile)){ + String srcRel=src.getAbsolutePath().substring((int)(nativesZipFile.length()+1)); + srcRel=srcRel.substring(srcRel.indexOf("/")+1); + + File dest=new File(nativesPath+File.separator+srcRel); + + boolean include=false; + if(!dest.exists()){ + include=true; + println("Copy "+src+" "+dest+ ". Destination does not exist"); + }else if(dest.lastModified()