2
0
Yao Wei Tjong 姚伟忠 5 жил өмнө
parent
commit
92aaf19511

+ 13 - 6
android/launcher-app/build.gradle.kts

@@ -43,19 +43,23 @@ android {
                 arguments.apply {
                     System.getenv("ANDROID_CCACHE")?.let { add("-DANDROID_CCACHE=$it") }
                     add("-DGRADLE_BUILD_DIR=${findProject(":android:urho3d-lib")?.buildDir}")
-                    addAll(listOf(
+                    addAll(
+                        listOf(
                             "URHO3D_LIB_TYPE",
                             // TODO: "URHO3D_PACKAGING",
                             "URHO3D_ANGELSCRIPT",
-                            "URHO3D_LUA")
+                            "URHO3D_LUA"
+                        )
                             .filter { project.hasProperty(it) }
                             .map { "-D$it=${project.property(it)}" }
                     )
                     // In order to get clean module segregation, only build player/samples here
                     // unless it is explicitly excluded
-                    addAll(listOf(
+                    addAll(
+                        listOf(
                             "URHO3D_PLAYER",
-                            "URHO3D_SAMPLES")
+                            "URHO3D_SAMPLES"
+                        )
                             .map { "-D$it=${project.findProperty(it) ?: "1"}" }
                     )
                 }
@@ -65,8 +69,11 @@ android {
             abi {
                 isEnable = project.hasProperty("ANDROID_ABI")
                 reset()
-                include(*(project.findProperty("ANDROID_ABI") as String? ?: "")
-                        .split(',').toTypedArray())
+                include(
+                    *(project.findProperty("ANDROID_ABI") as String? ?: "")
+                        .split(',')
+                        .toTypedArray()
+                )
             }
         }
     }

+ 14 - 9
android/urho3d-lib/build.gradle.kts

@@ -46,7 +46,8 @@ android {
                     System.getenv("ANDROID_CCACHE")?.let { add("-DANDROID_CCACHE=$it") }
                     add("-DGRADLE_BUILD_DIR=$buildDir")
                     // Pass along matching Gradle properties as CMake build options
-                    addAll(listOf(
+                    addAll(
+                        listOf(
                             "URHO3D_LIB_TYPE",
                             "URHO3D_ANGELSCRIPT",
                             "URHO3D_LUA",
@@ -63,14 +64,15 @@ android {
                             "URHO3D_FILEWATCHER",
                             "URHO3D_PROFILING",
                             "URHO3D_LOGGING",
-                            "URHO3D_THREADING")
+                            "URHO3D_THREADING"
+                        )
                             .filter { project.hasProperty(it) }
                             .map { "-D$it=${project.property(it)}" }
                     )
                     // In order to get clean module segregation, always exclude player/samples from AAR
                     addAll(listOf(
-                            "URHO3D_PLAYER",
-                            "URHO3D_SAMPLES"
+                        "URHO3D_PLAYER",
+                        "URHO3D_SAMPLES"
                     ).map { "-D$it=0" })
                 }
                 targets.add("Urho3D")
@@ -80,8 +82,11 @@ android {
             abi {
                 isEnable = project.hasProperty("ANDROID_ABI")
                 reset()
-                include(*(project.findProperty("ANDROID_ABI") as String? ?: "")
-                        .split(',').toTypedArray())
+                include(
+                    *(project.findProperty("ANDROID_ABI") as String? ?: "")
+                        .split(',')
+                        .toTypedArray()
+                )
             }
         }
     }
@@ -210,9 +215,9 @@ publishing {
             afterEvaluate {
                 // Exclude publishing STATIC-debug AAR because its size exceeds 250MB limit allowed by Bintray
                 android.buildTypes
-                        .map { it.name }
-                        .filter { System.getenv("CI") == null || project.libraryType == "SHARED" || it == "release" }
-                        .forEach { artifact(tasks["zipBuildTree${it.capitalize()}"]) }
+                    .map { it.name }
+                    .filter { System.getenv("CI") == null || project.libraryType == "SHARED" || it == "release" }
+                    .forEach { artifact(tasks["zipBuildTree${it.capitalize()}"]) }
             }
             artifact(tasks["sourcesJar"])
             artifact(tasks["documentationZip"])

+ 8 - 8
build.gradle.kts

@@ -82,15 +82,15 @@ fun describeCommit(sha: String? = null) = ByteArrayOutputStream().also {
  * Bump the semantic versioning on the specified index, 0 for major version, 1 for minor version, and so on.
  */
 fun bumpSemVer(version: String, index: Int) = version
-        .split('.')
-        .mapIndexed { i: Int, s: String ->
-            when {
-                i < index -> s
-                i == index -> if (s.contains('-')) s else (s.toInt() + 1).toString()
-                else -> "0"
-            }
+    .split('.')
+    .mapIndexed { i: Int, s: String ->
+        when {
+            i < index -> s
+            i == index -> if (s.contains('-')) s else (s.toInt() + 1).toString()
+            else -> "0"
         }
-        .joinToString(".")
+    }
+    .joinToString(".")
 
 tasks.wrapper {
     distributionType = Wrapper.DistributionType.ALL

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

@@ -32,8 +32,7 @@ const val cmakeVersion = "3.10.2+"
  * Current supported platforms: android.
  */
 @Suppress("unused")
-fun PluginDependenciesSpec.urho3d(platform: String): PluginDependencySpec =
-    id("com.github.urho3d.$platform")
+fun PluginDependenciesSpec.urho3d(platform: String): PluginDependencySpec = id("com.github.urho3d.$platform")
 
 /**
  * Naive implementation of "touch" command.