Răsfoiți Sursa

build: fix gradle 3.2.1 deprecations

Kirill Vainer 8 ani în urmă
părinte
comite
c37f0e59d2

+ 26 - 25
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}
+                        }
                     }
                 }
             }

+ 52 - 50
jme3-bullet-native-android/build.gradle

@@ -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() }
+        }
     }
 }
 

+ 1 - 1
jme3-bullet-native/build.gradle

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

+ 60 - 58
jme3-examples/build.gradle

@@ -62,69 +62,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"}
+        }
     }
 }