|
|
|
@ -17,52 +17,23 @@ dependencies { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
task generateNativeHeaders(type: Exec, dependsOn: classes) { |
|
|
|
|
def 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" |
|
|
|
|
|
|
|
|
|
def files0 = fileTree("src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files |
|
|
|
|
def files1 = fileTree("src/common/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files |
|
|
|
|
def files2 = fileTree("../jme3-core/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files |
|
|
|
|
def files3 = fileTree("../jme3-core/src/plugins/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files |
|
|
|
|
def files4 = fileTree("../jme3-core/src/tools/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files |
|
|
|
|
def files5 = fileTree("../jme3-terrain/src/main/java/").filter { it.isFile() && it.getName().endsWith(".java") }.files |
|
|
|
|
def classpath = sourceSets.main.runtimeClasspath.asPath |
|
|
|
|
def nativeIncludes = new File(project(":jme3-bullet-native").projectDir, "src/native/cpp") |
|
|
|
|
|
|
|
|
|
executable org.gradle.internal.jvm.Jvm.current().getExecutable('javah') |
|
|
|
|
args "-d", nativeIncludes |
|
|
|
|
args "-classpath", classpath |
|
|
|
|
args classes.split(",").collect { it.trim() } |
|
|
|
|
def filesList = "\"" + files0.join("\"\n\"") + "\"\n\"" + files1.join("\"\n\"") + "\"\n\"" + files2.join("\"\n\"") + "\"\n\"" + files3.join("\"\n\"") + "\"\n\"" + files4.join("\"\n\"") + "\"\n\"" + files5.join("\"\n\"") + "\"" |
|
|
|
|
new File("$projectDir/java_classes.jtxt").text = filesList.replaceAll(java.util.regex.Pattern.quote("\\"), java.util.regex.Matcher.quoteReplacement("/")) |
|
|
|
|
//project.logger.lifecycle("Files: " + files0.size()) |
|
|
|
|
//project.logger.lifecycle("Files: " + files1.size()) |
|
|
|
|
executable org.gradle.internal.jvm.Jvm.current().getExecutable('javac') |
|
|
|
|
args "-h", nativeIncludes |
|
|
|
|
//args "-classpath", classpath |
|
|
|
|
args "@$projectDir/java_classes.jtxt" |
|
|
|
|
//args classes.split(",").collect { it.trim() } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
assemble.dependsOn(generateNativeHeaders) |