From aff7cf4390ccf4eb55128931eb2276ac4963a5e9 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Wed, 28 Oct 2020 12:43:35 -0700 Subject: Update the gradle plugins --- platform/android/java/app/config.gradle | 6 +++--- platform/android/java/gradle.properties | 2 ++ platform/android/java/gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'platform') diff --git a/platform/android/java/app/config.gradle b/platform/android/java/app/config.gradle index d1176e6196..d9e110b0bd 100644 --- a/platform/android/java/app/config.gradle +++ b/platform/android/java/app/config.gradle @@ -1,11 +1,11 @@ ext.versions = [ - androidGradlePlugin: '3.5.3', + androidGradlePlugin: '4.1.0', compileSdk : 29, minSdk : 18, targetSdk : 29, - buildTools : '29.0.3', + buildTools : '30.0.1', supportCoreUtils : '1.0.0', - kotlinVersion : '1.3.61', + kotlinVersion : '1.4.10', v4Support : '1.0.0' ] diff --git a/platform/android/java/gradle.properties b/platform/android/java/gradle.properties index e14cd5ba5c..2dc069ad2f 100644 --- a/platform/android/java/gradle.properties +++ b/platform/android/java/gradle.properties @@ -18,3 +18,5 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true + +org.gradle.warning.mode=all diff --git a/platform/android/java/gradle/wrapper/gradle-wrapper.properties b/platform/android/java/gradle/wrapper/gradle-wrapper.properties index f56b0f6a5e..a7d8a0f310 100644 --- a/platform/android/java/gradle/wrapper/gradle-wrapper.properties +++ b/platform/android/java/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip -- cgit v1.2.3 From edf762fba6b305771191b706e4d097f7b5285360 Mon Sep 17 00:00:00 2001 From: Fredia Huya-Kouadio Date: Wed, 28 Oct 2020 16:32:45 -0700 Subject: Add a separate `nativeSrcsConfigs` module to handle Android Studio constraints for native code editor support. --- platform/android/java/app/build.gradle | 4 +- platform/android/java/app/config.gradle | 3 +- platform/android/java/lib/CMakeLists.txt | 18 -------- platform/android/java/lib/build.gradle | 20 ++------ .../java/nativeSrcsConfigs/AndroidManifest.xml | 2 + .../android/java/nativeSrcsConfigs/CMakeLists.txt | 19 ++++++++ platform/android/java/nativeSrcsConfigs/README.md | 4 ++ .../android/java/nativeSrcsConfigs/build.gradle | 54 ++++++++++++++++++++++ platform/android/java/settings.gradle | 1 + 9 files changed, 89 insertions(+), 36 deletions(-) delete mode 100644 platform/android/java/lib/CMakeLists.txt create mode 100644 platform/android/java/nativeSrcsConfigs/AndroidManifest.xml create mode 100644 platform/android/java/nativeSrcsConfigs/CMakeLists.txt create mode 100644 platform/android/java/nativeSrcsConfigs/README.md create mode 100644 platform/android/java/nativeSrcsConfigs/build.gradle (limited to 'platform') diff --git a/platform/android/java/app/build.gradle b/platform/android/java/app/build.gradle index ceacfec9e1..6de1d2dd30 100644 --- a/platform/android/java/app/build.gradle +++ b/platform/android/java/app/build.gradle @@ -70,8 +70,8 @@ android { buildToolsVersion versions.buildTools compileOptions { - sourceCompatibility 1.8 - targetCompatibility 1.8 + sourceCompatibility versions.javaVersion + targetCompatibility versions.javaVersion } defaultConfig { diff --git a/platform/android/java/app/config.gradle b/platform/android/java/app/config.gradle index d9e110b0bd..e6c45b73a7 100644 --- a/platform/android/java/app/config.gradle +++ b/platform/android/java/app/config.gradle @@ -6,7 +6,8 @@ ext.versions = [ buildTools : '30.0.1', supportCoreUtils : '1.0.0', kotlinVersion : '1.4.10', - v4Support : '1.0.0' + v4Support : '1.0.0', + javaVersion : 1.8 ] diff --git a/platform/android/java/lib/CMakeLists.txt b/platform/android/java/lib/CMakeLists.txt deleted file mode 100644 index d3bdf6a5f2..0000000000 --- a/platform/android/java/lib/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.6) -project(godot) - -set(CMAKE_CXX_STANDARD 14) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) - -set(GODOT_ROOT_DIR ../../../..) - -# Get sources -file(GLOB_RECURSE SOURCES ${GODOT_ROOT_DIR}/*.c**) -file(GLOB_RECURSE HEADERS ${GODOT_ROOT_DIR}/*.h**) - -add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS}) -target_include_directories(${PROJECT_NAME} - SYSTEM PUBLIC - ${GODOT_ROOT_DIR} - ${GODOT_ROOT_DIR}/modules/gdnative/include) diff --git a/platform/android/java/lib/build.gradle b/platform/android/java/lib/build.gradle index 19eee5a315..e3c5a02203 100644 --- a/platform/android/java/lib/build.gradle +++ b/platform/android/java/lib/build.gradle @@ -18,6 +18,11 @@ android { targetSdkVersion versions.targetSdk } + compileOptions { + sourceCompatibility versions.javaVersion + targetCompatibility versions.javaVersion + } + lintOptions { abortOnError false disable 'MissingTranslation', 'UnusedResources' @@ -50,15 +55,6 @@ android { def buildType = variant.buildType.name.capitalize() - def taskPrefix = "" - if (project.path != ":") { - taskPrefix = project.path + ":" - } - - // Disable the externalNativeBuild* task as it would cause build failures since the cmake build - // files is only setup for editing support. - gradle.startParameter.excludedTaskNames += taskPrefix + "externalNativeBuild" + buildType - def releaseTarget = buildType.toLowerCase() if (releaseTarget == null || releaseTarget == "") { throw new GradleException("Invalid build type: " + buildType) @@ -78,10 +74,4 @@ android { // Schedule the tasks so the generated libs are present before the aar file is packaged. tasks["merge${buildType}JniLibFolders"].dependsOn taskName } - - externalNativeBuild { - cmake { - path "CMakeLists.txt" - } - } } diff --git a/platform/android/java/nativeSrcsConfigs/AndroidManifest.xml b/platform/android/java/nativeSrcsConfigs/AndroidManifest.xml new file mode 100644 index 0000000000..dc180375d5 --- /dev/null +++ b/platform/android/java/nativeSrcsConfigs/AndroidManifest.xml @@ -0,0 +1,2 @@ + + diff --git a/platform/android/java/nativeSrcsConfigs/CMakeLists.txt b/platform/android/java/nativeSrcsConfigs/CMakeLists.txt new file mode 100644 index 0000000000..34925684da --- /dev/null +++ b/platform/android/java/nativeSrcsConfigs/CMakeLists.txt @@ -0,0 +1,19 @@ +# Non functional cmake build file used to provide Android Studio editor support to the project. +cmake_minimum_required(VERSION 3.6) +project(godot) + +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +set(GODOT_ROOT_DIR ../../../..) + +# Get sources +file(GLOB_RECURSE SOURCES ${GODOT_ROOT_DIR}/*.c**) +file(GLOB_RECURSE HEADERS ${GODOT_ROOT_DIR}/*.h**) + +add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS}) +target_include_directories(${PROJECT_NAME} + SYSTEM PUBLIC + ${GODOT_ROOT_DIR} + ${GODOT_ROOT_DIR}/modules/gdnative/include) diff --git a/platform/android/java/nativeSrcsConfigs/README.md b/platform/android/java/nativeSrcsConfigs/README.md new file mode 100644 index 0000000000..e48505ccda --- /dev/null +++ b/platform/android/java/nativeSrcsConfigs/README.md @@ -0,0 +1,4 @@ +## Native sources configs + +This is a non functional Android library used to provide Android Studio editor support to the Godot project native files. +Nothing else should be added to this library. diff --git a/platform/android/java/nativeSrcsConfigs/build.gradle b/platform/android/java/nativeSrcsConfigs/build.gradle new file mode 100644 index 0000000000..65b7bb9dc9 --- /dev/null +++ b/platform/android/java/nativeSrcsConfigs/build.gradle @@ -0,0 +1,54 @@ +// Non functional android library used to provide Android Studio editor support to the project. +plugins { + id 'com.android.library' +} + +android { + compileSdkVersion versions.compileSdk + buildToolsVersion versions.buildTools + + defaultConfig { + minSdkVersion versions.minSdk + targetSdkVersion versions.targetSdk + } + + compileOptions { + sourceCompatibility versions.javaVersion + targetCompatibility versions.javaVersion + } + + packagingOptions { + exclude 'META-INF/LICENSE' + exclude 'META-INF/NOTICE' + + // Should be uncommented for development purpose within Android Studio + // doNotStrip '**/*.so' + } + + sourceSets { + main { + manifest.srcFile 'AndroidManifest.xml' + } + } + + externalNativeBuild { + cmake { + path "CMakeLists.txt" + } + } + + libraryVariants.all { variant -> + def buildType = variant.buildType.name.capitalize() + + def taskPrefix = "" + if (project.path != ":") { + taskPrefix = project.path + ":" + } + + // Disable the externalNativeBuild* task as it would cause build failures since the cmake build + // files is only setup for editing support. + gradle.startParameter.excludedTaskNames += taskPrefix + "externalNativeBuild" + buildType + } +} + +dependencies {} diff --git a/platform/android/java/settings.gradle b/platform/android/java/settings.gradle index f6921c70aa..524031d93f 100644 --- a/platform/android/java/settings.gradle +++ b/platform/android/java/settings.gradle @@ -3,3 +3,4 @@ rootProject.name = "Godot" include ':app' include ':lib' +include ':nativeSrcsConfigs' -- cgit v1.2.3