11import org.gradle.api.tasks.testing.logging.TestExceptionFormat
22import org.gradle.api.tasks.testing.logging.TestLogEvent
3+ import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
34
45repositories {
56 google()
67 mavenCentral()
78}
89
910plugins {
10- kotlin(" multiplatform" ) version " 1.8.20 " apply false
11- kotlin(" native.cocoapods" ) version " 1.8.20 " apply false
11+ kotlin(" multiplatform" ) apply false
12+ kotlin(" native.cocoapods" ) apply false
1213 id(" base" )
1314 id(" com.github.ben-manes.versions" ) version " 0.42.0"
1415}
@@ -23,17 +24,17 @@ buildscript {
2324 }
2425 }
2526 dependencies {
26- classpath(" com.android.tools.build:gradle:7.2.2 " )
27- classpath(" org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20-RC " )
27+ classpath(" com.android.tools.build:gradle:${project.extra[ " gradlePluginVersion " ]} " )
28+ classpath(" org.jetbrains.kotlin:kotlin-gradle-plugin:${project.extra[ " kotlinVersion " ]} " )
2829 classpath(" com.adarshr:gradle-test-logger-plugin:3.2.0" )
2930 }
3031}
3132
32- val targetSdkVersion by extra(32 )
33- val minSdkVersion by extra(19 )
33+ val compileSdkVersion by extra(34 )
34+ val minSdkVersion by extra(23 )
3435
3536tasks {
36- val updateVersions by registering {
37+ register( " updateVersions" ) {
3738 dependsOn(
3839 " firebase-app:updateVersion" , " firebase-app:updateDependencyVersion" ,
3940 " firebase-auth:updateVersion" , " firebase-auth:updateDependencyVersion" ,
@@ -52,7 +53,7 @@ tasks {
5253subprojects {
5354
5455 group = " dev.gitlive"
55-
56+
5657 apply (plugin = " com.adarshr.test-logger" )
5758
5859 repositories {
@@ -88,11 +89,11 @@ subprojects {
8889
8990 if (skipPublishing) return @tasks
9091
91- val updateVersion by registering( Exec :: class ) {
92+ register< Exec >( " updateVersion " ) {
9293 commandLine(" npm" , " --allow-same-version" , " --prefix" , projectDir, " version" , " ${project.property(" ${project.name} .version" )} " )
9394 }
9495
95- val updateDependencyVersion by registering( Copy :: class ) {
96+ register< Copy >( " updateDependencyVersion " ) {
9697 mustRunAfter(" updateVersion" )
9798 val from = file(" package.json" )
9899 from.writeText(
@@ -106,28 +107,30 @@ subprojects {
106107
107108 afterEvaluate {
108109
110+ val coroutinesVersion: String by project
111+ val firebaseBoMVersion: String by project
112+
109113 dependencies {
110- " commonMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 " )
111- " androidMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.4 " )
112- " androidMainImplementation" (platform(" com.google.firebase:firebase-bom:32.3.1 " ))
114+ " commonMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion " )
115+ " androidMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion " )
116+ " androidMainImplementation" (platform(" com.google.firebase:firebase-bom:$firebaseBoMVersion " ))
113117 " commonTestImplementation" (kotlin(" test-common" ))
114118 " commonTestImplementation" (kotlin(" test-annotations-common" ))
115- " commonTestImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4" )
116- " commonTestImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4" )
117119 if (this @afterEvaluate.name != " firebase-crashlytics" ) {
118120 " jvmMainApi" (" dev.gitlive:firebase-java-sdk:0.1.2" )
119- " jvmMainApi" (" org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.6.0 " ) {
121+ " jvmMainApi" (" org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion " ) {
120122 exclude(" com.google.android.gms" )
121123 }
122124 " jsTestImplementation" (kotlin(" test-js" ))
123125 " jvmTestImplementation" (kotlin(" test-junit" ))
124126 " jvmTestImplementation" (" junit:junit:4.13.2" )
125127 }
126- " androidAndroidTestImplementation" (kotlin(" test-junit" ))
127- " androidAndroidTestImplementation" (" junit:junit:4.13.2" )
128- " androidAndroidTestImplementation" (" androidx.test:core:1.4.0" )
129- " androidAndroidTestImplementation" (" androidx.test.ext:junit:1.1.3" )
130- " androidAndroidTestImplementation" (" androidx.test:runner:1.4.0" )
128+ " androidInstrumentedTestImplementation" (kotlin(" test-junit" ))
129+ " androidUnitTestImplementation" (kotlin(" test-junit" ))
130+ " androidInstrumentedTestImplementation" (" junit:junit:4.13.2" )
131+ " androidInstrumentedTestImplementation" (" androidx.test:core:1.5.0" )
132+ " androidInstrumentedTestImplementation" (" androidx.test.ext:junit:1.1.5" )
133+ " androidInstrumentedTestImplementation" (" androidx.test:runner:1.5.2" )
131134 }
132135 }
133136
@@ -145,6 +148,7 @@ subprojects {
145148 repositories {
146149 maven {
147150 url = uri(" https://oss.sonatype.org/service/local/staging/deploy/maven2" )
151+
148152 credentials {
149153 username = project.findProperty(" sonatypeUsername" ) as String? ? : System .getenv(" sonatypeUsername" )
150154 password = project.findProperty(" sonatypePassword" ) as String? ? : System .getenv(" sonatypePassword" )
@@ -193,12 +197,16 @@ subprojects {
193197 }
194198
195199 }
200+
201+ tasks.withType(AbstractPublishToMaven ::class .java).configureEach {
202+ dependsOn(tasks.withType(Sign ::class .java))
203+ }
196204}
197205
198206tasks.withType< com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask > {
199207
200208 fun isNonStable (version : String ): Boolean {
201- val stableKeyword = listOf (" RELEASE" , " FINAL" , " GA" ).any { version.toUpperCase( ).contains(it) }
209+ val stableKeyword = listOf (" RELEASE" , " FINAL" , " GA" ).any { version.uppercase(java.util. Locale . ENGLISH ).contains(it) }
202210 val versionMatch = " ^[0-9,.v-]+(-r)?$" .toRegex().matches(version)
203211
204212 return (stableKeyword || versionMatch).not ()
0 commit comments