1- import de.undercouch. gradle.tasks.download.Download
1+ import com.android.build. gradle.internal.cxx.configure.gradleLocalProperties
22import org.apache.tools.ant.taskdefs.condition.Os
33import org.gradle.api.tasks.testing.logging.TestExceptionFormat
44import org.gradle.api.tasks.testing.logging.TestLogEvent
55
66plugins {
7- kotlin(" multiplatform" ) version " 1.4.21" apply false
8- id(" de.undercouch.download" ).version(" 4.1.1" )
7+ kotlin(" multiplatform" ) version " 1.4.31" apply false
98 id(" base" )
109}
1110
@@ -19,15 +18,23 @@ buildscript {
1918 }
2019 }
2120 dependencies {
22- classpath(" com.android.tools.build:gradle:4.1.1" )
23- classpath(" de.undercouch:gradle-download-task:4.1.1" )
24- classpath(" com.adarshr:gradle-test-logger-plugin:2.0.0" )
21+ classpath(" com.android.tools.build:gradle:4.0.2" )
22+ classpath(" com.adarshr:gradle-test-logger-plugin:2.1.1" )
2523 }
2624}
2725
2826val targetSdkVersion by extra(28 )
2927val minSdkVersion by extra(16 )
3028
29+ // TODO: Hierarchical project structures are not fully supported in IDEA, enable only for a regular built (https://youtrack.jetbrains.com/issue/KT-35011)
30+ // add idea.active=true for local development
31+ val _ideaActive = gradleLocalProperties(rootDir)[" idea.active" ] == " true"
32+
33+ // if (!_ideaActive) {
34+ // ext["kotlin.mpp.enableGranularSourceSetsMetadata"] = "true"
35+ // ext["kotlin.native.enableDependencyPropagation"] = "false"
36+ // }
37+
3138tasks {
3239 val updateVersions by registering {
3340 dependsOn(
@@ -43,6 +50,8 @@ tasks {
4350
4451subprojects {
4552
53+ val ideaActive by extra(_ideaActive )
54+
4655 group = " dev.gitlive"
4756
4857 apply (plugin= " com.adarshr.test-logger" )
@@ -54,11 +63,9 @@ subprojects {
5463 jcenter()
5564 }
5665
57-
5866 tasks.withType<Sign >().configureEach {
5967 onlyIf { ! project.gradle.startParameter.taskNames.contains(" publishToMavenLocal" ) }
6068 }
61-
6269
6370 tasks {
6471
@@ -149,16 +156,18 @@ subprojects {
149156 }
150157 }
151158
152- listOf (" bootstrap" , " update" ).forEach {
153- task<Exec >(" carthage${it.capitalize()} " ) {
154- group = " carthage"
155- executable = " carthage"
156- args(
157- it,
158- " --project-directory" , " src/iosMain/c_interop" ,
159- " --platform" , " iOS" ,
160- " --cache-builds"
161- )
159+ if (projectDir.resolve(" src/nativeInterop/cinterop/Cartfile" ).exists()) { // skipping firebase-common module
160+ listOf (" bootstrap" , " update" ).forEach {
161+ task<Exec >(" carthage${it.capitalize()} " ) {
162+ group = " carthage"
163+ executable = " carthage"
164+ args(
165+ it,
166+ " --project-directory" , projectDir.resolve(" src/nativeInterop/cinterop" ),
167+ " --platform" , " iOS" ,
168+ " --cache-builds"
169+ )
170+ }
162171 }
163172 }
164173
@@ -170,8 +179,10 @@ subprojects {
170179
171180 create(" carthageClean" , Delete ::class .java) {
172181 group = " carthage"
173- delete(File (" $projectDir /src/iosMain/c_interop/Carthage" ))
174- delete(File (" $projectDir /src/iosMain/c_interop/Cartfile.resolved" ))
182+ delete(
183+ projectDir.resolve(" src/nativeInterop/cinterop/Carthage" ),
184+ projectDir.resolve(" src/nativeInterop/cinterop/Cartfile.resolved" )
185+ )
175186 }
176187 }
177188
@@ -187,15 +198,15 @@ subprojects {
187198
188199 dependencies {
189200 " commonMainImplementation" (kotlin(" stdlib-common" ))
190- " commonMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2 " )
201+ " commonMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3 " )
191202 " jsMainImplementation" (kotlin(" stdlib-js" ))
192- " androidMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.4.2 " )
203+ " androidMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.4.3 " )
193204 " commonTestImplementation" (kotlin(" test-common" ))
194205 " commonTestImplementation" (kotlin(" test-annotations-common" ))
195- " commonTestImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2 " )
206+ " commonTestImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3 " )
196207 " jsTestImplementation" (kotlin(" test-js" ))
197208 " androidAndroidTestImplementation" (kotlin(" test-junit" ))
198- " androidAndroidTestImplementation" (" junit:junit:4.13" )
209+ " androidAndroidTestImplementation" (" junit:junit:4.13.1 " )
199210 " androidAndroidTestImplementation" (" androidx.test:core:1.3.0" )
200211 " androidAndroidTestImplementation" (" androidx.test.ext:junit:1.1.2" )
201212 " androidAndroidTestImplementation" (" androidx.test:runner:1.3.0" )
@@ -254,11 +265,7 @@ subprojects {
254265 comments.set(" A business-friendly OSS license" )
255266 }
256267 }
257-
258268 }
259269 }
260-
261270 }
262-
263271}
264-
0 commit comments