Skip to content

Commit 2026c8d

Browse files
committed
Make each project build dependent on unzipFirebase
Remove copy and reference the firebase in build for each project. Only download and unzip if a mac.
1 parent 5f13097 commit 2026c8d

File tree

7 files changed

+14
-56
lines changed

7 files changed

+14
-56
lines changed

build.gradle.kts

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -36,56 +36,9 @@ tasks {
3636
dependsOn(downloadFirebaseZipFile)
3737
from(zipTree(downloadFirebaseZipFile.dest))
3838
into("$buildDir")
39-
outputs.upToDateWhen { File("$buildDir").exists() }
39+
outputs.upToDateWhen { !Os.isFamily(Os.FAMILY_MAC) || Os.isFamily(Os.FAMILY_MAC) && File("$buildDir").exists() }
4040
}
41-
42-
val copyIOSFirebaseAuthFramework by creating(Copy::class){
43-
doFirst {
44-
project.delete(files("$rootDir/firebase-auth/src/iosMain/c_interop/modules/"))
45-
}
46-
dependsOn(unzipFirebase)
47-
from("$rootDir/$buildDir/Firebase/FirebaseAuth/FirebaseAuth.framework")
48-
into("$rootDir/firebase-auth/src/iosMain/c_interop/modules/FirebaseAuth.framework")
49-
}
50-
51-
val copyIOSFirebaseDatabaseFramework by creating(Copy::class){
52-
doFirst {
53-
project.delete(files("$rootDir/firebase-database/src/iosMain/c_interop/modules/"))
54-
}
55-
dependsOn(unzipFirebase)
56-
from("$rootDir/$buildDir/Firebase/FirebaseDatabase/FirebaseDatabase.framework")
57-
into("$rootDir/firebase-database/src/iosMain/c_interop/modules/FirebaseDatabase.framework")
58-
}
59-
60-
val copyIOSFirebaseFirestoreFramework by creating(Copy::class){
61-
doFirst {
62-
project.delete(files("$rootDir/firebase-firestore/src/iosMain/c_interop/modules/"))
63-
}
64-
dependsOn(unzipFirebase)
65-
from("$rootDir/$buildDir/Firebase/FirebaseFirestore/FirebaseFirestore.framework")
66-
into("$rootDir/firebase-firestore/src/iosMain/c_interop/modules/FirebaseFirestore.framework")
67-
}
68-
69-
val copyIOSFirebaseFunctionsFramework by creating(Copy::class){
70-
doFirst {
71-
project.delete(files("$rootDir/firebase-functions/src/iosMain/c_interop/modules/"))
72-
}
73-
dependsOn(unzipFirebase)
74-
from("$rootDir/$buildDir/Firebase/FirebaseFunctions/FirebaseFunctions.framework")
75-
into("$rootDir/firebase-functions/src/iosMain/c_interop/modules/FirebaseFunctions.framework")
76-
}
77-
78-
val copyIOSFirebaseAppFramework by creating(Copy::class){
79-
80-
doFirst {
81-
project.delete(files("$rootDir/firebase-app/src/iosMain/c_interop/modules/"))
82-
}
83-
84-
dependsOn(unzipFirebase)
85-
from("$rootDir/$buildDir/Firebase/FirebaseAnalytics/FirebaseCore.framework")
86-
into("$rootDir/firebase-app/src/iosMain/c_interop/modules/FirebaseCore.framework")
87-
}
88-
41+
8942
}
9043

9144
subprojects {

firebase-app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ kotlin {
6969
val firebasecore by cinterops.creating {
7070
packageName("cocoapods.FirebaseCore")
7171
defFile(file("$projectDir/src/iosMain/c_interop/FirebaseCore.def"))
72-
//includeDirs("$projectDir/../native/Avalon/Pods/FirebaseCore/Firebase/Core/Public")
73-
compilerOpts("-F$projectDir/src/iosMain/c_interop/modules")
72+
compilerOpts("-F$projectDir/../build/Firebase/FirebaseAnalytics")
7473
}
7574
}
7675
}
@@ -87,3 +86,4 @@ configure<SigningExtension> {
8786
sign(publishing.publications)
8887
}
8988

89+
tasks.getByPath("build").dependsOn(rootProject.tasks.named("unzipFirebase"))

firebase-auth/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ kotlin {
6161
val firebaseAuth by cinterops.creating {
6262
packageName("cocoapods.FirebaseAuth")
6363
defFile(file("$projectDir/src/iosMain/c_interop/FirebaseAuth.def"))
64-
compilerOpts("-F$projectDir/src/iosMain/c_interop/modules")
64+
compilerOpts("-F$projectDir/../build/Firebase/FirebaseAuth")
6565
}
6666
}
6767
}
@@ -76,3 +76,5 @@ kotlin {
7676
configure<SigningExtension> {
7777
sign(publishing.publications)
7878
}
79+
80+
tasks.getByPath("build").dependsOn(rootProject.tasks.named("unzipFirebase"))

firebase-common/build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,3 @@ kotlin {
8787
configure<SigningExtension> {
8888
sign(publishing.publications)
8989
}
90-

firebase-database/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ kotlin {
6262
val firebaseDatabase by cinterops.creating {
6363
packageName("cocoapods.FirebaseDatabase")
6464
defFile(file("$projectDir/src/iosMain/c_interop/FirebaseDatabase.def"))
65-
compilerOpts("-F$projectDir/src/iosMain/c_interop/modules")
65+
compilerOpts("-F$projectDir/../build/Firebase/FirebaseDatabase")
6666
}
6767
}
6868
}
@@ -78,3 +78,5 @@ configure<SigningExtension> {
7878
sign(publishing.publications)
7979
}
8080

81+
tasks.getByPath("build").dependsOn(rootProject.tasks.named("unzipFirebase"))
82+

firebase-firestore/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ kotlin {
6363
val firebasefirestore by cinterops.creating {
6464
packageName("cocoapods.FirebaseFirestore")
6565
defFile(file("$projectDir/src/iosMain/c_interop/FirebaseFirestore.def"))
66-
compilerOpts("-F$projectDir/src/iosMain/c_interop/modules")
66+
compilerOpts("-F$projectDir/../build/Firebase/FirebaseFirestore")
6767
}
6868
}
6969
}
@@ -79,3 +79,4 @@ configure<SigningExtension> {
7979
sign(publishing.publications)
8080
}
8181

82+
tasks.getByPath("build").dependsOn(rootProject.tasks.named("unzipFirebase"))

firebase-functions/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ kotlin {
6262
val firebasefunctions by cinterops.creating {
6363
packageName("cocoapods.FirebaseFunctions")
6464
defFile(file("$projectDir/src/iosMain/c_interop/FirebaseFunctions.def"))
65-
compilerOpts("-F$projectDir/src/iosMain/c_interop/modules")
65+
compilerOpts("-F$projectDir/../build/Firebase/FirebaseFunctions")
6666
}
6767
}
6868
}
@@ -78,3 +78,4 @@ configure<SigningExtension> {
7878
sign(publishing.publications)
7979
}
8080

81+
tasks.getByPath("build").dependsOn(rootProject.tasks.named("unzipFirebase"))

0 commit comments

Comments
 (0)