build: fix gradle 3.2.1 deprecations

native-compilation-test
Kirill Vainer 8 years ago
parent 36e9a0d1c6
commit 356b3d6726
  1. 51
      build.gradle
  2. 102
      jme3-bullet-native-android/build.gradle
  3. 2
      jme3-bullet-native/build.gradle
  4. 118
      jme3-examples/build.gradle

@ -29,31 +29,32 @@ task run(dependsOn: ':jme3-examples:run') {
defaultTasks 'run' defaultTasks 'run'
task libDist(dependsOn: subprojects.build) << { task libDist(dependsOn: subprojects.build, description: 'Builds and copies the engine binaries, sources and javadoc to build/libDist') {
// description 'Builds and copies the engine binaries, sources and javadoc to build/libDist' doLast {
File libFolder = mkdir("$buildDir/libDist/lib") File libFolder = mkdir("$buildDir/libDist/lib")
File sourceFolder = mkdir("$buildDir/libDist/sources") File sourceFolder = mkdir("$buildDir/libDist/sources")
File javadocFolder = mkdir("$buildDir/libDist/javadoc") File javadocFolder = mkdir("$buildDir/libDist/javadoc")
subprojects.each {project -> subprojects.each {project ->
if(project.ext.mainClass == ''){ if(project.ext.mainClass == ''){
project.tasks.withType(Jar).each {archiveTask -> project.tasks.withType(Jar).each {archiveTask ->
if(archiveTask.classifier == "sources"){ if(archiveTask.classifier == "sources"){
copy { copy {
from archiveTask.archivePath from archiveTask.archivePath
into sourceFolder into sourceFolder
rename {project.name + '-' + archiveTask.classifier +'.'+ archiveTask.extension} rename {project.name + '-' + archiveTask.classifier +'.'+ archiveTask.extension}
} }
} else if(archiveTask.classifier == "javadoc"){ } else if(archiveTask.classifier == "javadoc"){
copy { copy {
from archiveTask.archivePath from archiveTask.archivePath
into javadocFolder into javadocFolder
rename {project.name + '-' + archiveTask.classifier +'.'+ archiveTask.extension} rename {project.name + '-' + archiveTask.classifier +'.'+ archiveTask.extension}
} }
} else{ } else{
copy { copy {
from archiveTask.archivePath from archiveTask.archivePath
into libFolder into libFolder
rename {project.name + '.' + archiveTask.extension} rename {project.name + '.' + archiveTask.extension}
}
} }
} }
} }

@ -102,56 +102,58 @@ task copyJmeAndroid(type: Copy, dependsOn:copyJmeCpp) {
into outputDir into outputDir
} }
task generateNativeHeaders(dependsOn: copyJmeAndroid) << { task generateNativeHeaders(dependsOn: copyJmeAndroid) {
String destDirPath = jniPath doLast {
String classes = " \ String destDirPath = jniPath
com.jme3.bullet.PhysicsSpace, \ String classes = " \
\ com.jme3.bullet.PhysicsSpace, \
com.jme3.bullet.collision.PhysicsCollisionEvent, \ \
com.jme3.bullet.collision.PhysicsCollisionObject,\ com.jme3.bullet.collision.PhysicsCollisionEvent, \
com.jme3.bullet.objects.PhysicsCharacter, \ com.jme3.bullet.collision.PhysicsCollisionObject,\
com.jme3.bullet.objects.PhysicsGhostObject, \ com.jme3.bullet.objects.PhysicsCharacter, \
com.jme3.bullet.objects.PhysicsRigidBody, \ com.jme3.bullet.objects.PhysicsGhostObject, \
com.jme3.bullet.objects.PhysicsVehicle, \ com.jme3.bullet.objects.PhysicsRigidBody, \
com.jme3.bullet.objects.VehicleWheel, \ com.jme3.bullet.objects.PhysicsVehicle, \
com.jme3.bullet.objects.infos.RigidBodyMotionState, \ com.jme3.bullet.objects.VehicleWheel, \
\ com.jme3.bullet.objects.infos.RigidBodyMotionState, \
com.jme3.bullet.collision.shapes.CollisionShape, \ \
com.jme3.bullet.collision.shapes.BoxCollisionShape, \ com.jme3.bullet.collision.shapes.CollisionShape, \
com.jme3.bullet.collision.shapes.CapsuleCollisionShape, \ com.jme3.bullet.collision.shapes.BoxCollisionShape, \
com.jme3.bullet.collision.shapes.CompoundCollisionShape, \ com.jme3.bullet.collision.shapes.CapsuleCollisionShape, \
com.jme3.bullet.collision.shapes.ConeCollisionShape, \ com.jme3.bullet.collision.shapes.CompoundCollisionShape, \
com.jme3.bullet.collision.shapes.CylinderCollisionShape, \ com.jme3.bullet.collision.shapes.ConeCollisionShape, \
com.jme3.bullet.collision.shapes.GImpactCollisionShape, \ com.jme3.bullet.collision.shapes.CylinderCollisionShape, \
com.jme3.bullet.collision.shapes.HeightfieldCollisionShape, \ com.jme3.bullet.collision.shapes.GImpactCollisionShape, \
com.jme3.bullet.collision.shapes.HullCollisionShape, \ com.jme3.bullet.collision.shapes.HeightfieldCollisionShape, \
com.jme3.bullet.collision.shapes.MeshCollisionShape, \ com.jme3.bullet.collision.shapes.HullCollisionShape, \
com.jme3.bullet.collision.shapes.PlaneCollisionShape, \ com.jme3.bullet.collision.shapes.MeshCollisionShape, \
com.jme3.bullet.collision.shapes.SimplexCollisionShape, \ com.jme3.bullet.collision.shapes.PlaneCollisionShape, \
com.jme3.bullet.collision.shapes.SphereCollisionShape, \ com.jme3.bullet.collision.shapes.SimplexCollisionShape, \
\ com.jme3.bullet.collision.shapes.SphereCollisionShape, \
com.jme3.bullet.joints.PhysicsJoint, \ \
com.jme3.bullet.joints.ConeJoint, \ com.jme3.bullet.joints.PhysicsJoint, \
com.jme3.bullet.joints.HingeJoint, \ com.jme3.bullet.joints.ConeJoint, \
com.jme3.bullet.joints.Point2PointJoint, \ com.jme3.bullet.joints.HingeJoint, \
com.jme3.bullet.joints.SixDofJoint, \ com.jme3.bullet.joints.Point2PointJoint, \
com.jme3.bullet.joints.SixDofSpringJoint, \ com.jme3.bullet.joints.SixDofJoint, \
com.jme3.bullet.joints.SliderJoint, \ com.jme3.bullet.joints.SixDofSpringJoint, \
com.jme3.bullet.joints.motors.RotationalLimitMotor, \ com.jme3.bullet.joints.SliderJoint, \
com.jme3.bullet.joints.motors.TranslationalLimitMotor, \ com.jme3.bullet.joints.motors.RotationalLimitMotor, \
\ com.jme3.bullet.joints.motors.TranslationalLimitMotor, \
com.jme3.bullet.util.NativeMeshUtil, \ \
com.jme3.bullet.util.DebugShapeFactory" com.jme3.bullet.util.NativeMeshUtil, \
com.jme3.bullet.util.DebugShapeFactory"
String projectClassPath = configurations.runtime.asFileTree.matching {
exclude ".gradle" String projectClassPath = configurations.runtime.asFileTree.matching {
}.asPath exclude ".gradle"
}.asPath
exec {
executable org.gradle.internal.jvm.Jvm.current().getExecutable('javah') exec {
args '-d', destDirPath executable org.gradle.internal.jvm.Jvm.current().getExecutable('javah')
args '-classpath', projectClassPath args '-d', destDirPath
args classes.split(",").collect { it.trim() } args '-classpath', projectClassPath
args classes.split(",").collect { it.trim() }
}
} }
} }

@ -215,7 +215,7 @@ unzipBullet.dependsOn {
} }
} }
task unzipBulletIfNeeded << { task unzipBulletIfNeeded {
} }
unzipBulletIfNeeded.dependsOn { unzipBulletIfNeeded.dependsOn {

@ -63,69 +63,71 @@ jar.doFirst{
task dist (dependsOn: ['build', ':jme3-jogl:jar', ':jme3-bullet:jar', ':jme3-android:jar', \ task dist (dependsOn: ['build', ':jme3-jogl:jar', ':jme3-bullet:jar', ':jme3-android:jar', \
':jme3-android-native:jar', ':jme3-bullet-native-android:jar', \ ':jme3-android-native:jar', ':jme3-bullet-native-android:jar', \
':jme3-bullet-native:jar']) << { ':jme3-bullet-native:jar']) {
// Copy all dependencies to ../dist/lib, remove versions from jar files doLast {
configurations.compile.resolvedConfiguration.resolvedArtifacts.each { artifact -> // Copy all dependencies to ../dist/lib, remove versions from jar files
copy { configurations.compile.resolvedConfiguration.resolvedArtifacts.each { artifact ->
from artifact.file copy {
into '../dist/lib' from artifact.file
if(artifact.classifier != null){ into '../dist/lib'
rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" } if(artifact.classifier != null){
} else{ rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
rename { "${artifact.name}.${artifact.extension}" } } else{
rename { "${artifact.name}.${artifact.extension}" }
}
} }
} }
} copy {
copy { from jar.archivePath
from jar.archivePath into '../dist'
into '../dist' rename { "jMonkeyEngine3.jar" }
rename { "jMonkeyEngine3.jar" } }
} // Copy JOGL packages, remove version
// Copy JOGL packages, remove version def config = project(':jme3-jogl').configurations.runtime.copyRecursive({ !(it instanceof ProjectDependency); })
def config = project(':jme3-jogl').configurations.runtime.copyRecursive({ !(it instanceof ProjectDependency); }) config.resolvedConfiguration.resolvedArtifacts.each {artifact ->
config.resolvedConfiguration.resolvedArtifacts.each {artifact -> copy{
copy{ from artifact.file
from artifact.file into '../dist/opt/jogl/lib'
into '../dist/opt/jogl/lib' if(artifact.classifier != null){
if(artifact.classifier != null){ rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" }
rename { "${artifact.name}-${artifact.classifier}.${artifact.extension}" } } else{
} else{ rename { "${artifact.name}.${artifact.extension}" }
rename { "${artifact.name}.${artifact.extension}" } }
} }
} }
} copy {
copy { from project(':jme3-jogl').jar.archivePath
from project(':jme3-jogl').jar.archivePath into '../dist/opt/jogl'
into '../dist/opt/jogl' rename {project(':jme3-jogl').name+".jar"}
rename {project(':jme3-jogl').name+".jar"} }
}
// Copy bullet packages, remove version // Copy bullet packages, remove version
copy { copy {
from project(':jme3-bullet').jar.archivePath from project(':jme3-bullet').jar.archivePath
into '../dist/opt/native-bullet' into '../dist/opt/native-bullet'
rename {project(':jme3-bullet').name+".jar"} rename {project(':jme3-bullet').name+".jar"}
} }
copy { copy {
from project(':jme3-bullet-native').jar.archivePath from project(':jme3-bullet-native').jar.archivePath
into '../dist/opt/native-bullet' into '../dist/opt/native-bullet'
rename {project(':jme3-bullet-native').name+".jar"} rename {project(':jme3-bullet-native').name+".jar"}
} }
// Copy android packages, remove version // Copy android packages, remove version
copy { copy {
from project(':jme3-android').jar.archivePath from project(':jme3-android').jar.archivePath
into '../dist/opt/android' into '../dist/opt/android'
rename {project(':jme3-android').name+".jar"} rename {project(':jme3-android').name+".jar"}
} }
copy { copy {
from project(':jme3-android-native').jar.archivePath from project(':jme3-android-native').jar.archivePath
into '../dist/opt/android' into '../dist/opt/android'
rename {project(':jme3-android-native').name+".jar"} rename {project(':jme3-android-native').name+".jar"}
} }
copy { copy {
from project(':jme3-bullet-native-android').jar.archivePath from project(':jme3-bullet-native-android').jar.archivePath
into '../dist/opt/native-bullet' into '../dist/opt/native-bullet'
rename {project(':jme3-bullet-native-android').name+".jar"} rename {project(':jme3-bullet-native-android').name+".jar"}
}
} }
} }

Loading…
Cancel
Save