Procházet zdrojové kódy

Upgrade to Gradle 5.3.1 and keep it happy.

Yao Wei Tjong 姚伟忠 před 6 roky
rodič
revize
9251f56160

+ 1 - 1
.gitignore

@@ -14,7 +14,7 @@ generated/
 /Source/Urho3D/tolua++-prefix/
 build/
 /captures/
-.externalNativeBuild/
+.cxx/
 
 # Output files
 /Source/**/*.a

+ 11 - 10
android/urho3d-lib/build.gradle.kts

@@ -79,7 +79,8 @@ android {
                 isEnable = project.hasProperty("ANDROID_ABI")
                 reset()
                 include(*(if (isEnable) project.property("ANDROID_ABI") as String else "")
-                        .split(',').toTypedArray())
+                        .split(',')
+                        .toTypedArray())
             }
         }
     }
@@ -123,15 +124,15 @@ afterEvaluate {
         val config = buildType.name.capitalize()
         tasks {
             create<Zip>("zipBuildTree$config") {
-                classifier = buildType.name
-                extension = "aar"
+                archiveClassifier.set(buildType.name)
+                archiveExtension.set("aar")
                 dependsOn("zipBuildTreeConfigurer$config", "bundle${config}Aar")
-                from(zipTree(tasks.getByName("bundle${config}Aar").outputs.files.first()))
+                from(zipTree(getByName("bundle${config}Aar").outputs.files.first()))
             }
             create("zipBuildTreeConfigurer$config") {
                 val externalNativeBuildDir = File(buildDir, "tree/$config")
                 doLast {
-                    val zipTask = tasks.getByName<Zip>("zipBuildTree$config")
+                    val zipTask = getByName<Zip>("zipBuildTree$config")
                     externalNativeBuildDir.list()?.forEach { abi ->
                         listOf("include", "lib").forEach {
                             zipTask.from(File(externalNativeBuildDir, "$abi/$it")) {
@@ -150,7 +151,7 @@ afterEvaluate {
 
 tasks {
     create<Jar>("sourcesJar") {
-        classifier = "sources"
+        archiveClassifier.set("sources")
         from(android.sourceSets.getByName("main").java.srcDirs)
     }
     create<Exec>("makeDoc") {
@@ -162,18 +163,18 @@ tasks {
         mustRunAfter("zipBuildTreeRelease")
     }
     create<Zip>("documentationZip") {
-        classifier = "documentation"
+        archiveClassifier.set("documentation")
         dependsOn("makeDoc")
     }
     create("makeDocConfigurer") {
         doLast {
             val buildTree = File(cmakeStagingDir(), "cmake/release/$docABI")
-            tasks.getByName<Exec>("makeDoc") {
+            getByName<Exec>("makeDoc") {
                 // This is a hack - expect the first line to contain the path to the embedded CMake executable
                 executable = File(buildTree, "cmake_build_command.txt").readLines().first().split(":").last().trim()
                 workingDir = buildTree
             }
-            tasks.getByName<Zip>("documentationZip") {
+            getByName<Zip>("documentationZip") {
                 from(File(buildTree, "Docs/html")) {
                     into("docs")
                 }
@@ -197,7 +198,7 @@ publishing {
     }
 }
 
-fun cmakeStagingDir() = android.externalNativeBuild.cmake.buildStagingDirectory ?: project.file(".externalNativeBuild")
+fun cmakeStagingDir() = android.externalNativeBuild.cmake.buildStagingDirectory ?: project.file(".cxx")
 
 val Project.libraryType: String
     get() = if (hasProperty("URHO3D_LIB_TYPE")) property("URHO3D_LIB_TYPE") as String else "STATIC"

+ 8 - 0
buildSrc/build.gradle.kts

@@ -23,3 +23,11 @@
 plugins {
     `kotlin-dsl`
 }
+
+kotlinDslPluginOptions {
+    experimentalWarning.set(false)
+}
+
+repositories {
+    jcenter()
+}

+ 2 - 2
buildSrc/src/main/kotlin/UrhoCommon.kt

@@ -24,8 +24,8 @@ import org.gradle.plugin.use.PluginDependenciesSpec
 import org.gradle.plugin.use.PluginDependencySpec
 import java.io.File
 
-const val androidToolsVersion = "3.2.0-beta04"
-const val kotlinVersion = "1.2.61"
+const val androidToolsVersion = "3.5.0-alpha10"
+const val kotlinVersion = "1.3.20"
 const val junitVersion = "4.12"
 const val testRunnerVersion = "1.0.2"
 const val testEspressoVersion = "3.0.2"

binární
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-4.9-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists

+ 10 - 13
settings.gradle.kts

@@ -20,25 +20,22 @@
 // THE SOFTWARE.
 //
 
-// See https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:deferred_configuration
-enableFeaturePreview("STABLE_PUBLISHING")
-
 pluginManagement {
-    repositories {
-        gradlePluginPortal()
-        google()
-        jcenter()
-    }
     resolutionStrategy {
         eachPlugin {
-            if (requested.id.id.startsWith("com.android.")) {
-                useModule("com.android.tools.build:gradle:$androidToolsVersion")
-            }
-            if (requested.id.id.startsWith("org.jetbrains.kotlin.")) {
-                useVersion(kotlinVersion)
+            when {
+                requested.id.id.startsWith("com.android.") ->
+                    useModule("com.android.tools.build:gradle:$androidToolsVersion")
+                requested.id.id.startsWith("org.jetbrains.kotlin.") ->
+                    useVersion(kotlinVersion)
             }
         }
     }
+    repositories {
+        gradlePluginPortal()
+        google()
+        jcenter()
+    }
 }
 
 include(":android:urho3d-lib", ":android:launcher-app")