소스 검색

Upgrade Gradle to 6.9 (#1588)

* Upgrade Gradle to 6.9

* Remove obsolete repo

* Remove deprecated keywords

* Use the annotations

* Remove deprecated keywords

* Expose some dependencies

* Remove deprecated

* Remove deprecated

* Expose Nifty, jBullet and LWJGL 2

* Expose LWJGL 3, fix VR project dependencies

* Expose the VR libraries

* Remove deprecated

* Remove obsolete bintray workarounds and deprecated maven plugin

* Set the default duplicates strategy to get rid of warnings

* Set the annotations compileOnly

* Remove trailing whitespace

* Expose more dependencies

* Bump JNA version

* Bump Android tools gradle

* Fix the examples mainClass

* Use mainClassName variable and remove the obsolete mainClass variable
Toni Helenius 4 년 전
부모
커밋
ec136bac24

+ 9 - 4
build.gradle

@@ -10,7 +10,7 @@ buildscript {
         }
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.5.3'
+        classpath 'com.android.tools.build:gradle:4.2.0'
         classpath 'me.tatarka:gradle-retrolambda:3.7.1'
         classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.5.1"
     }
@@ -21,6 +21,9 @@ allprojects {
         mavenCentral()
         google()
     }
+    tasks.withType(Jar) {
+        duplicatesStrategy = 'include'
+    }
 }
 
 // Set the license for IDEs that understand this
@@ -69,7 +72,7 @@ task libDist(dependsOn: subprojects.build, description: 'Builds and copies the e
         File sourceFolder = mkdir("$buildDir/libDist/sources")
         File javadocFolder = mkdir("$buildDir/libDist/javadoc")
         subprojects.each {project ->
-            if(project.ext.mainClass == ''){
+            if(!project.hasProperty('mainClassName')){
                 project.tasks.withType(Jar).each {archiveTask ->
                     if(archiveTask.classifier == "sources"){
                         copy {
@@ -97,7 +100,9 @@ task libDist(dependsOn: subprojects.build, description: 'Builds and copies the e
 }
 
 task createZipDistribution(type:Zip,dependsOn:["dist","libDist"], description:"Package the nightly zip distribution"){
-    archiveName "jME" + jmeFullVersion + ".zip"
+    archiveFileName = provider {
+        "jME" + jmeFullVersion + ".zip"
+    }
     into("/") {
          from {"./dist"}
     }
@@ -269,7 +274,7 @@ if (skipPrebuildLibraries != "true" && buildNativeProjects != "true") {
 //}
 
 wrapper {
-    gradleVersion = '5.6.4'
+    gradleVersion = '6.9'
 }
 
 

+ 5 - 26
common.gradle

@@ -2,9 +2,8 @@
 // This file is to be applied to every subproject.
 //
 
-apply plugin: 'java'
+apply plugin: 'java-library'
 apply plugin: 'groovy'
-apply plugin: 'maven'
 apply plugin: 'maven-publish'
 apply plugin: 'signing'
 
@@ -16,8 +15,7 @@ sourceCompatibility = '1.8'
 
 if(JavaVersion.current() >= JavaVersion.VERSION_1_9) {
     compileJava {
-	options.compilerArgs.addAll(['--release', '8'])
-        //Replace previous with "options.release = 8" if updated to gradle 6.6 or newer
+		options.release = 8
     }
 }
 
@@ -29,9 +27,6 @@ gradle.projectsEvaluated {
 
 repositories {
     mavenCentral()
-    maven {
-        url "http://nifty-gui.sourceforge.net/nifty-maven-repo"
-    }
     flatDir {
         dirs rootProject.file('lib')
     }
@@ -39,9 +34,9 @@ repositories {
 
 dependencies {
     // Adding dependencies here will add the dependencies to each subproject.
-    testCompile 'junit:junit:4.13.2'
-    testCompile 'org.mockito:mockito-core:3.8.0'
-    testCompile 'org.codehaus.groovy:groovy-all:3.0.7'
+    testImplementation 'junit:junit:4.13.2'
+    testImplementation 'org.mockito:mockito-core:3.8.0'
+    testImplementation 'org.codehaus.groovy:groovy-all:3.0.7'
 }
 
 
@@ -117,28 +112,12 @@ ext.pomConfig = {
     }
 }
 
-// workaround to be able to use same custom pom with 'maven' and 'bintray' plugin
-task writeFullPom {
-    ext.pomFile = "$mavenPomDir/${project.name}-${project.version}.pom"
-    outputs.file pomFile
-    doLast {
-        pom {
-            project pomConfig
-        }.writeTo(pomFile)
-    }
-}
-
-assemble.dependsOn(writeFullPom)
-install.dependsOn(writeFullPom)
-uploadArchives.dependsOn(writeFullPom)
-
 artifacts {
     archives jar
     archives sourcesJar
     if (buildJavaDoc == "true") {
         archives javadocJar
     }
-    archives writeFullPom.outputs.files[0]
 }
 
 publishing {

BIN
gradle/wrapper/gradle-wrapper.jar


+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists

+ 12 - 17
gradlew

@@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
         else
             eval `echo args$i`="\"$arg\""
         fi
-        i=$((i+1))
+        i=`expr $i + 1`
     done
     case $i in
-        (0) set -- ;;
-        (1) set -- "$args0" ;;
-        (2) set -- "$args0" "$args1" ;;
-        (3) set -- "$args0" "$args1" "$args2" ;;
-        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
-        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
-        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
-        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
-        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
-        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+        0) set -- ;;
+        1) set -- "$args0" ;;
+        2) set -- "$args0" "$args1" ;;
+        3) set -- "$args0" "$args1" "$args2" ;;
+        4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
     esac
 fi
 
@@ -175,14 +175,9 @@ save () {
     for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
     echo " "
 }
-APP_ARGS=$(save "$@")
+APP_ARGS=`save "$@"`
 
 # Collect all arguments for the java command, following the shell quoting and substitution rules
 eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
 
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
-  cd "$(dirname "$0")"
-fi
-
 exec "$JAVACMD" "$@"

+ 3 - 0
gradlew.bat

@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
 set APP_BASE_NAME=%~n0
 set APP_HOME=%DIRNAME%
 
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
 @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
 set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
 

+ 14 - 14
jme3-android-examples/build.gradle

@@ -45,19 +45,19 @@ android {
 }
 
 dependencies {
-    compile fileTree(dir: 'libs', include: ['*.jar'])
-    testCompile 'junit:junit:4.12'
-    compile 'com.android.support:appcompat-v7:28.0.0'
-
-    compile project(':jme3-core')
-    compile project(':jme3-android')
-    compile project(':jme3-android-native')
-    compile project(':jme3-effects')
-    compile project(':jme3-jbullet')
-    compile project(':jme3-networking')
-    compile project(':jme3-niftygui')
-    compile project(':jme3-plugins')
-    compile project(':jme3-terrain')
-    compile fileTree(dir: '../jme3-examples/build/libs', include: ['*.jar'], exclude: ['*sources*.*'])
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
+    testImplementation 'junit:junit:4.12'
+    implementation 'com.android.support:appcompat-v7:28.0.0'
+
+    implementation project(':jme3-core')
+    implementation project(':jme3-android')
+    implementation project(':jme3-android-native')
+    implementation project(':jme3-effects')
+    implementation project(':jme3-jbullet')
+    implementation project(':jme3-networking')
+    implementation project(':jme3-niftygui')
+    implementation project(':jme3-plugins')
+    implementation project(':jme3-terrain')
+    implementation fileTree(dir: '../jme3-examples/build/libs', include: ['*.jar'], exclude: ['*sources*.*'])
 //    compile project(':jme3-examples')
 }

+ 2 - 14
jme3-android-native/build.gradle

@@ -2,18 +2,6 @@
 //   for this project. This initialization is applied in the "build.gradle"
 //   of the root project.
 
-// NetBeans will automatically add "run" and "debug" tasks relying on the
-// "mainClass" property. You may however define the property prior executing
-// tasks by passing a "-PmainClass=<QUALIFIED_CLASS_NAME>" argument.
-//
-// Note however, that you may define your own "run" and "debug" task if you
-// prefer. In this case NetBeans will not add these tasks but you may rely on
-// your own implementation.
-
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 sourceSets {
     main {
         java {
@@ -30,13 +18,13 @@ dependencies {
     //
     // You can read more about how to add dependency here:
     //   http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:how_to_declare_your_dependencies
-    compile project(':jme3-android')
+    api project(':jme3-android')
 }
 
 ext {
     // stores the native project classpath to be used in each native
     // build to generate native header files
-    projectClassPath = configurations.runtime.asFileTree.matching {
+    projectClassPath = configurations.runtimeClasspath.asFileTree.matching {
         exclude ".gradle"
     }.asPath
 }

+ 3 - 7
jme3-android/build.gradle

@@ -1,14 +1,10 @@
 apply plugin: 'java'
 
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 dependencies {
     //added annotations used by JmeSurfaceView.
-    implementation 'androidx.appcompat:appcompat:1.2.0'
-    compile project(':jme3-core')
-    compile project(':jme3-plugins')
+    compileOnly 'androidx.annotation:annotation:1.2.0'
+    api project(':jme3-core')
+    api project(':jme3-plugins')
     compileOnly 'android:android'
 }
 

+ 1 - 5
jme3-core/build.gradle

@@ -1,7 +1,3 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 sourceSets {
     main {
         java {
@@ -18,7 +14,7 @@ sourceSets {
 }
 
 dependencies {
-    testCompile project(':jme3-testdata')
+    testImplementation project(':jme3-testdata')
 }
 
 task updateVersionPropertiesFile {

+ 1 - 5
jme3-desktop/build.gradle

@@ -1,7 +1,3 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 dependencies {
-    compile project(':jme3-core')
+    api project(':jme3-core')
 }

+ 1 - 5
jme3-effects/build.gradle

@@ -1,7 +1,3 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 dependencies {
-    compile project(':jme3-core')
+    api project(':jme3-core')
 }

+ 17 - 21
jme3-examples/build.gradle

@@ -1,11 +1,7 @@
-//apply plugin:'application'
-
-if (!hasProperty('mainClass')) {
-    ext.mainClass = 'jme3test.TestChooser'
-}
+ext.mainClassName = 'jme3test.TestChooser'
 
 task run(dependsOn: 'build', type:JavaExec) {
-    main = mainClass
+    mainClass = mainClassName
     classpath = sourceSets.main.runtimeClasspath
 
     if (System.properties['java.util.logging.config.file'] != null) {
@@ -18,18 +14,18 @@ task run(dependsOn: 'build', type:JavaExec) {
 }
 
 dependencies {
-    compile project(':jme3-core')
-    compile project(':jme3-desktop')
-    compile project(':jme3-effects')
-    compile project(':jme3-jbullet')
-    compile project(':jme3-jogg')
-    compile project(':jme3-lwjgl')
-//    compile project(':jme3-lwjgl3')
-    compile project(':jme3-networking')
-    compile project(':jme3-niftygui')
-    compile project(':jme3-plugins')
-    compile project(':jme3-terrain')
-    compile project(':jme3-testdata')
+    implementation project(':jme3-core')
+    implementation project(':jme3-desktop')
+    implementation project(':jme3-effects')
+    implementation project(':jme3-jbullet')
+    implementation project(':jme3-jogg')
+    implementation project(':jme3-lwjgl')
+//    implementation project(':jme3-lwjgl3')
+    implementation project(':jme3-networking')
+    implementation project(':jme3-niftygui')
+    implementation project(':jme3-plugins')
+    implementation project(':jme3-terrain')
+    implementation project(':jme3-testdata')
 }
 
 jar.doFirst{
@@ -42,9 +38,9 @@ jar.doFirst{
 //                'Implementation-Title'   : appName,
 //                'Implementation-Version' : version,
 //                'Implementation-Vendor'  : vendor,
-                'Main-Class'             : getProperty('mainClass'),
+                'Main-Class'             : getProperty('mainClassName'),
                 // Add dependencies to manifest, remove version
-                'Class-Path'             : configurations.compile.resolvedConfiguration.resolvedArtifacts.collect {
+                'Class-Path'             : configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.collect {
                                                         'lib/' +
                                                         it.name +
                                                         (it.classifier != null ? '-' + it.classifier : '') +
@@ -56,7 +52,7 @@ jar.doFirst{
 task dist (dependsOn: ['build', ':jme3-android:jar', ':jme3-android-native:jar']) {
     doLast {
         // Copy all dependencies to ../dist/lib, remove versions from jar files
-        configurations.compile.resolvedConfiguration.resolvedArtifacts.each { artifact ->
+        configurations.compileClasspath.resolvedConfiguration.resolvedArtifacts.each { artifact ->
             copy {
                 from artifact.file
                 into '../dist/lib'

+ 2 - 6
jme3-ios/build.gradle

@@ -1,11 +1,7 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 sourceCompatibility = JavaVersion.VERSION_1_8
 targetCompatibility = JavaVersion.VERSION_1_8
 
 dependencies {
-    compile project(':jme3-core')
-    compile project(':jme3-plugins')
+    api project(':jme3-core')
+    api project(':jme3-plugins')
 }

+ 4 - 8
jme3-jbullet/build.gradle

@@ -1,7 +1,3 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 sourceSets {
     main {
         java {
@@ -12,8 +8,8 @@ sourceSets {
 }
 
 dependencies {
-    compile 'com.github.stephengold:jbullet:1.0.1'
-    compile 'javax.vecmath:vecmath:1.5.2'
-    compile project(':jme3-core')
-    compile project(':jme3-terrain')
+    api 'com.github.stephengold:jbullet:1.0.1'
+    api 'javax.vecmath:vecmath:1.5.2'
+    api project(':jme3-core')
+    api project(':jme3-terrain')
 }

+ 2 - 6
jme3-jogg/build.gradle

@@ -1,8 +1,4 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 dependencies {
-    compile project(':jme3-core')
-    compile 'com.github.stephengold:j-ogg-all:1.0.1'
+    api project(':jme3-core')
+    api 'com.github.stephengold:j-ogg-all:1.0.1'
 }

+ 5 - 9
jme3-lwjgl/build.gradle

@@ -1,15 +1,11 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 dependencies {
-    compile project(':jme3-core')
-    compile project(':jme3-desktop')
-    compile 'org.lwjgl.lwjgl:lwjgl:2.9.3'
+    api project(':jme3-core')
+    api project(':jme3-desktop')
+    api 'org.lwjgl.lwjgl:lwjgl:2.9.3'
     /*
      * Upgrades the default jinput-2.0.5 to jinput-2.0.9 to fix a bug with gamepads on Linux.
      * See https://hub.jmonkeyengine.org/t/linux-gamepad-input-on-jme3-lwjgl-splits-input-between-two-logical-gamepads
      */
-    compile 'net.java.jinput:jinput:2.0.9'
-    compile 'net.java.jinput:jinput:2.0.9:natives-all'
+    api 'net.java.jinput:jinput:2.0.9'
+    api 'net.java.jinput:jinput:2.0.9:natives-all'
 }

+ 44 - 48
jme3-lwjgl3/build.gradle

@@ -1,56 +1,52 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 def lwjglVersion = '3.2.3'
 
 sourceCompatibility = '1.8'
 
 dependencies {
-    compile project(':jme3-core')
-    compile project(':jme3-desktop')
-
-    compile "org.lwjgl:lwjgl:${lwjglVersion}"
-    compile "org.lwjgl:lwjgl-glfw:${lwjglVersion}"
-    compile "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}"
-    compile "org.lwjgl:lwjgl-openal:${lwjglVersion}"
-    compile "org.lwjgl:lwjgl-opencl:${lwjglVersion}"
-    compile "org.lwjgl:lwjgl-opengl:${lwjglVersion}"
-
-    runtime "org.lwjgl:lwjgl:${lwjglVersion}:natives-windows"
-    runtime "org.lwjgl:lwjgl:${lwjglVersion}:natives-windows-x86"
-    runtime "org.lwjgl:lwjgl:${lwjglVersion}:natives-linux"
-    runtime "org.lwjgl:lwjgl:${lwjglVersion}:natives-linux-arm32"
-    runtime "org.lwjgl:lwjgl:${lwjglVersion}:natives-linux-arm64"
-    runtime "org.lwjgl:lwjgl:${lwjglVersion}:natives-macos"
-
-    runtime "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-windows"
-    runtime "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-windows-x86"
-    runtime "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-linux"
-    runtime "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-linux-arm32"
-    runtime "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-linux-arm64"
-    runtime "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-macos"
-
-    runtime "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-windows"
-    runtime "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-windows-x86"
-    runtime "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-linux"
-    runtime "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-linux-arm32"
-    runtime "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-linux-arm64"
-    runtime "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-macos"
-
-    runtime "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-windows"
-    runtime "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-windows-x86"
-    runtime "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-linux"
-    runtime "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-linux-arm32"
-    runtime "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-linux-arm64"
-    runtime "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-macos"
-
-    runtime "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-windows"
-    runtime "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-windows-x86"
-    runtime "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-linux"
-    runtime "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-linux-arm32"
-    runtime "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-linux-arm64"
-    runtime "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-macos"
+    api project(':jme3-core')
+    api project(':jme3-desktop')
+
+    api "org.lwjgl:lwjgl:${lwjglVersion}"
+    api "org.lwjgl:lwjgl-glfw:${lwjglVersion}"
+    api "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}"
+    api "org.lwjgl:lwjgl-openal:${lwjglVersion}"
+    api "org.lwjgl:lwjgl-opencl:${lwjglVersion}"
+    api "org.lwjgl:lwjgl-opengl:${lwjglVersion}"
+
+    runtimeOnly "org.lwjgl:lwjgl:${lwjglVersion}:natives-windows"
+    runtimeOnly "org.lwjgl:lwjgl:${lwjglVersion}:natives-windows-x86"
+    runtimeOnly "org.lwjgl:lwjgl:${lwjglVersion}:natives-linux"
+    runtimeOnly "org.lwjgl:lwjgl:${lwjglVersion}:natives-linux-arm32"
+    runtimeOnly "org.lwjgl:lwjgl:${lwjglVersion}:natives-linux-arm64"
+    runtimeOnly "org.lwjgl:lwjgl:${lwjglVersion}:natives-macos"
+
+    runtimeOnly "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-windows"
+    runtimeOnly "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-windows-x86"
+    runtimeOnly "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-linux"
+    runtimeOnly "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-linux-arm32"
+    runtimeOnly "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-linux-arm64"
+    runtimeOnly "org.lwjgl:lwjgl-glfw:${lwjglVersion}:natives-macos"
+
+    runtimeOnly "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-windows"
+    runtimeOnly "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-windows-x86"
+    runtimeOnly "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-linux"
+    runtimeOnly "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-linux-arm32"
+    runtimeOnly "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-linux-arm64"
+    runtimeOnly "org.lwjgl:lwjgl-jemalloc:${lwjglVersion}:natives-macos"
+
+    runtimeOnly "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-windows"
+    runtimeOnly "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-windows-x86"
+    runtimeOnly "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-linux"
+    runtimeOnly "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-linux-arm32"
+    runtimeOnly "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-linux-arm64"
+    runtimeOnly "org.lwjgl:lwjgl-opengl:${lwjglVersion}:natives-macos"
+
+    runtimeOnly "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-windows"
+    runtimeOnly "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-windows-x86"
+    runtimeOnly "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-linux"
+    runtimeOnly "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-linux-arm32"
+    runtimeOnly "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-linux-arm64"
+    runtimeOnly "org.lwjgl:lwjgl-openal:${lwjglVersion}:natives-macos"
 }
 
 javadoc {

+ 1 - 5
jme3-networking/build.gradle

@@ -1,9 +1,5 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 dependencies {
-    compile project(':jme3-core')
+    api project(':jme3-core')
 }
 
 javadoc {

+ 4 - 8
jme3-niftygui/build.gradle

@@ -1,12 +1,8 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 def niftyVersion = '1.4.3'
 
 dependencies {
-    compile project(':jme3-core')
-    compile "com.github.nifty-gui:nifty:${niftyVersion}"
-    compile "com.github.nifty-gui:nifty-default-controls:${niftyVersion}"
-    compile "com.github.nifty-gui:nifty-style-black:${niftyVersion}"
+    api project(':jme3-core')
+    api "com.github.nifty-gui:nifty:${niftyVersion}"
+    api "com.github.nifty-gui:nifty-default-controls:${niftyVersion}"
+    api "com.github.nifty-gui:nifty-style-black:${niftyVersion}"
 }

+ 3 - 7
jme3-plugins/build.gradle

@@ -1,7 +1,3 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 sourceSets {
     main {
         java {
@@ -14,7 +10,7 @@ sourceSets {
 }
 
 dependencies {
-    compile project(':jme3-core')
-    compile 'com.google.code.gson:gson:2.8.1'
-    testCompile project(':jme3-desktop')
+    api project(':jme3-core')
+    api 'com.google.code.gson:gson:2.8.1'
+    testImplementation project(':jme3-desktop')
 }

+ 5 - 9
jme3-terrain/build.gradle

@@ -1,13 +1,9 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 dependencies {
-    compile project(':jme3-core')
-    testCompile project(':jme3-core')
-    testCompile project(':jme3-desktop')
-    testCompile project(':jme3-core').sourceSets.test.output
-    testCompile project(':jme3-testdata')
+    api project(':jme3-core')
+    testImplementation project(':jme3-core')
+    testImplementation project(':jme3-desktop')
+    testImplementation project(':jme3-core').sourceSets.test.output
+    testImplementation project(':jme3-testdata')
 }
 
 javadoc {

+ 2 - 6
jme3-testdata/build.gradle

@@ -1,10 +1,6 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 def niftyVersion = '1.4.3'
 
 dependencies {
-    runtime "com.github.nifty-gui:nifty-examples:$niftyVersion"
-    runtime "com.github.nifty-gui:nifty-style-black:$niftyVersion"
+    runtimeOnly "com.github.nifty-gui:nifty-examples:$niftyVersion"
+    runtimeOnly "com.github.nifty-gui:nifty-style-black:$niftyVersion"
 }

+ 16 - 19
jme3-vr/build.gradle

@@ -1,31 +1,28 @@
-if (!hasProperty('mainClass')) {
-    ext.mainClass = ''
-}
-
 def lwjglVersion = '3.2.3'
 
 sourceCompatibility = '1.8'
 
 dependencies {
-    compile project(':jme3-core')
-    compile project(':jme3-lwjgl3')
-    compile project(':jme3-effects')
+    api project(':jme3-core')
+    api project(':jme3-lwjgl3')
+    api project(':jme3-desktop')
+    api project(':jme3-effects')
 	
-	// https://mvnrepository.com/artifact/net.java.dev.jna/jna
-    compile group: 'net.java.dev.jna', name: 'jna', version: '4.3.0'
-    compile 'com.nativelibs4java:jnaerator-runtime:0.12'
+    // https://mvnrepository.com/artifact/net.java.dev.jna/jna
+    implementation group: 'net.java.dev.jna', name: 'jna', version: '5.8.0'
+    implementation 'com.nativelibs4java:jnaerator-runtime:0.12'
 
     // Native LibOVR/Oculus support
-    compile "org.lwjgl:lwjgl-ovr:${lwjglVersion}"
-    runtime "org.lwjgl:lwjgl-ovr:${lwjglVersion}:natives-windows"
+    api "org.lwjgl:lwjgl-ovr:${lwjglVersion}"
+    runtimeOnly "org.lwjgl:lwjgl-ovr:${lwjglVersion}:natives-windows"
     
-        // Native OpenVR/LWJGL support
-    compile "org.lwjgl:lwjgl-openvr:${lwjglVersion}"
-    compile "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-linux"
-    compile "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-macos"
-    runtime "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-windows"
-    runtime "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-linux"
-    runtime "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-macos"
+    // Native OpenVR/LWJGL support
+    api "org.lwjgl:lwjgl-openvr:${lwjglVersion}"
+    implementation "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-linux"
+    implementation "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-macos"
+    runtimeOnly "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-windows"
+    runtimeOnly "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-linux"
+    runtimeOnly "org.lwjgl:lwjgl-openvr:${lwjglVersion}:natives-macos"
 }
 
 javadoc {