11import de.undercouch.gradle.tasks.download.Download
2- import org.apache.tools.ant.taskdefs.condition.Os
32
43plugins {
54 kotlin(" multiplatform" ) version " 1.3.70" apply false
65 id(" de.undercouch.download" ).version(" 3.4.3" )
6+ id(" base" )
77}
88
99buildscript {
@@ -24,19 +24,19 @@ val minSdkVersion by extra(14)
2424
2525
2626tasks {
27- val downloadFirebaseZipFile by creating(Download ::class ) {
27+ val downloadIOSFirebaseZipFile by creating(Download ::class ) {
2828 onlyIfModified(true )
2929 src(" https://github.com/firebase/firebase-ios-sdk/releases/download/6.17.0/Firebase-6.17.0.zip" )
3030 dest(File (" $buildDir " , " Firebase-6.17.0.zip" ))
3131 overwrite(true )
3232
3333 }
3434
35- val unzipFirebase by creating(Copy ::class ) {
36- dependsOn(downloadFirebaseZipFile )
37- from(zipTree(downloadFirebaseZipFile .dest))
35+ val unzipIOSFirebase by creating(Copy ::class ) {
36+ dependsOn(downloadIOSFirebaseZipFile )
37+ from(zipTree(downloadIOSFirebaseZipFile .dest))
3838 into(" $buildDir " )
39- outputs.upToDateWhen { ! Os .isFamily( Os . FAMILY_MAC ) || Os .isFamily( Os . FAMILY_MAC ) && File (" $buildDir " ).exists() }
39+ outputs.upToDateWhen { File (" $rootDir / $ buildDir/Firebase " ).isDirectory }
4040 }
4141
4242}
@@ -121,6 +121,9 @@ subprojects {
121121 mkdir(" $buildDir /node_module" )
122122 }
123123
124+ tasks.getByPath(" compileKotlinIos" ).dependsOn(rootProject.tasks.named(" unzipIOSFirebase" ))
125+ tasks.getByPath(" compileKotlinIosArm64" ).dependsOn(rootProject.tasks.named(" unzipIOSFirebase" ))
126+
124127 dependencies {
125128 " commonMainImplementation" (kotlin(" stdlib-common" ))
126129 " commonMainImplementation" (" org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.4" )
@@ -136,6 +139,7 @@ subprojects {
136139 apply (plugin= " maven-publish" )
137140 apply (plugin= " signing" )
138141
142+
139143 configure<PublishingExtension > {
140144
141145 repositories {
@@ -147,7 +151,7 @@ subprojects {
147151 }
148152 }
149153 }
150-
154+
151155 publications.all {
152156 this as MavenPublication
153157
@@ -172,5 +176,6 @@ subprojects {
172176 }
173177
174178 }
179+
175180}
176181
0 commit comments