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

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

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

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

Loading…
Cancel
Save