Skip to content

Commit d05b644

Browse files
authored
Merge branch 'master' into add-authDomain-to-FirebaseOptions
2 parents 58227ee + 7122b86 commit d05b644

File tree

35 files changed

+431
-269
lines changed

35 files changed

+431
-269
lines changed

.gitignore

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
local.properties
66
/**/*.iml
77
*.iml
8-
firebase-app/src/iosMain/c_interop/modules/
9-
firebase-functions/src/iosMain/c_interop/modules/
10-
firebase-auth/src/iosMain/c_interop/modules/
11-
firebase-firestore/src/iosMain/c_interop/modules/
12-
firebase-database/src/iosMain/c_interop/modules/
8+
firebase-app/src/nativeInterop/cinterop/modules/
9+
firebase-functions/src/nativeInterop/cinterop/modules/
10+
firebase-auth/src/nativeInterop/cinterop/modules/
11+
firebase-firestore/src/nativeInterop/cinterop/modules/
12+
firebase-database/src/nativeInterop/cinterop/modules/
1313
Firebase*.zip
1414
/Firebase
1515
/.DS_Store
1616
*.log
1717

1818

19-
/**/Cartfile.resolved
20-
/**/c_interop/Carthage/
19+
/**/nativeInterop/cinterop/Cartfile.resolved
20+
/**/nativeInterop/cinterop/Carthage/

build.gradle.kts

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import de.undercouch.gradle.tasks.download.Download
1+
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
22
import org.apache.tools.ant.taskdefs.condition.Os
33
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
44
import org.gradle.api.tasks.testing.logging.TestLogEvent
55

66
plugins {
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

2826
val targetSdkVersion by extra(28)
2927
val 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+
3138
tasks {
3239
val updateVersions by registering {
3340
dependsOn(
@@ -43,6 +50,8 @@ tasks {
4350

4451
subprojects {
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-

firebase-app/build.gradle.kts

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/*
22
* Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license.
33
*/
4+
5+
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
6+
47
version = project.property("firebase-app.version") as String
58

69
plugins {
@@ -41,47 +44,67 @@ android {
4144
}
4245

4346
kotlin {
44-
js {
45-
useCommonJs()
46-
nodejs()
47-
browser()
48-
}
47+
4948
android {
50-
publishLibraryVariants("release", "debug")
49+
publishAllLibraryVariants()
5150
}
5251

53-
val iosArm64 = iosArm64()
54-
val iosX64 = iosX64("ios") {
52+
fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = {
53+
val nativeFrameworkPaths = listOf(
54+
projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS")
55+
)
56+
5557
binaries {
5658
getTest("DEBUG").apply {
57-
linkerOpts("-F$projectDir/src/iosMain/c_interop/Carthage/Build/iOS/")
59+
linkerOpts(nativeFrameworkPaths.map { "-F$it" })
5860
linkerOpts("-ObjC")
5961
}
6062
}
63+
64+
compilations.getByName("main") {
65+
cinterops.create("FirebaseCore") {
66+
compilerOpts(nativeFrameworkPaths.map { "-F$it" })
67+
extraOpts("-verbose")
68+
}
69+
}
70+
}
71+
72+
if (project.extra["ideaActive"] as Boolean) {
73+
iosX64("ios", nativeTargetConfig())
74+
} else {
75+
ios(configure = nativeTargetConfig())
76+
}
77+
78+
js {
79+
useCommonJs()
80+
nodejs()
81+
browser()
6182
}
6283

6384
sourceSets {
85+
all {
86+
languageSettings.apply {
87+
apiVersion = "1.4"
88+
languageVersion = "1.4"
89+
progressiveMode = true
90+
}
91+
}
92+
6493
val commonMain by getting {
6594
dependencies {
6695
implementation(project(":firebase-common"))
6796
}
6897
}
98+
6999
val androidMain by getting {
70100
dependencies {
71101
api("com.google.firebase:firebase-common:19.5.0")
72102
}
73103
}
74104

75-
configure(listOf(iosArm64, iosX64)) {
76-
compilations.getByName("main") {
77-
source(sourceSets.get("iosMain"))
78-
val firebasecore by cinterops.creating {
79-
packageName("cocoapods.FirebaseCore")
80-
defFile(file("$projectDir/src/iosMain/c_interop/FirebaseCore.def"))
81-
compilerOpts("-F$projectDir/src/iosMain/c_interop/Carthage/Build/iOS/")
82-
}
83-
}
84-
}
105+
val iosMain by getting
106+
107+
val jsMain by getting
85108
}
86109
}
87110

firebase-app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
2626
"@gitlive/firebase-common": "1.2.0",
27-
"firebase": "8.2.3",
28-
"kotlin": "1.4.21",
29-
"kotlinx-coroutines-core": "1.4.2"
27+
"firebase": "8.2.10",
28+
"kotlin": "1.4.31",
29+
"kotlinx-coroutines-core": "1.4.3"
3030
}
3131
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
language = Objective-C
2+
package = cocoapods.FirebaseCore
23
modules = FirebaseCore
34
compilerOpts = -framework FirebaseCore
45
linkerOpts = -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseAnalytics -framework FIRAnalyticsConnector -framework GoogleAppMeasurement -framework FirebaseInstallations -framework GoogleDataTransport -framework GoogleUtilities -framework PromisesObjC -framework nanopb -framework StoreKit -lsqlite3

firebase-auth/build.gradle.kts

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/*
22
* Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license.
33
*/
4+
5+
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
6+
47
version = project.property("firebase-auth.version") as String
58

69
plugins {
@@ -65,34 +68,54 @@ android {
6568
//}
6669

6770
kotlin {
68-
js {
69-
useCommonJs()
70-
nodejs()
71-
browser()
72-
}
71+
7372
android {
74-
publishLibraryVariants("release", "debug")
73+
publishAllLibraryVariants()
7574
}
76-
val iosArm64 = iosArm64()
77-
val iosX64 = iosX64("ios") {
75+
76+
fun nativeTargetConfig(): KotlinNativeTarget.() -> Unit = {
77+
val nativeFrameworkPaths = listOf(
78+
rootProject.project("firebase-app").projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS"),
79+
projectDir.resolve("src/nativeInterop/cinterop/Carthage/Build/iOS")
80+
)
81+
7882
binaries {
7983
getTest("DEBUG").apply {
80-
linkerOpts(
81-
"-F${rootProject.projectDir}/firebase-app/src/iosMain/c_interop/Carthage/Build/iOS/",
82-
"-F$projectDir/src/iosMain/c_interop/Carthage/Build/iOS/")
84+
linkerOpts(nativeFrameworkPaths.map { "-F$it" })
8385
linkerOpts("-ObjC")
8486
}
8587
}
88+
89+
compilations.getByName("main") {
90+
cinterops.create("FirebaseAuth") {
91+
compilerOpts(nativeFrameworkPaths.map { "-F$it" })
92+
extraOpts("-verbose")
93+
}
94+
}
8695
}
8796

88-
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
89-
kotlinOptions.freeCompilerArgs += listOf(
90-
"-Xuse-experimental=kotlin.Experimental",
91-
"-Xuse-experimental=kotlinx.coroutines.ExperimentalCoroutinesApi"
92-
)
97+
if (project.extra["ideaActive"] as Boolean) {
98+
iosX64("ios", nativeTargetConfig())
99+
} else {
100+
ios(configure = nativeTargetConfig())
101+
}
102+
103+
js {
104+
useCommonJs()
105+
nodejs()
106+
browser()
93107
}
94108

95109
sourceSets {
110+
all {
111+
languageSettings.apply {
112+
apiVersion = "1.4"
113+
languageVersion = "1.4"
114+
progressiveMode = true
115+
useExperimentalAnnotation("kotlinx.coroutines.ExperimentalCoroutinesApi")
116+
}
117+
}
118+
96119
val commonMain by getting {
97120
dependencies {
98121
api(project(":firebase-app"))
@@ -102,22 +125,13 @@ kotlin {
102125

103126
val androidMain by getting {
104127
dependencies {
105-
api("com.google.firebase:firebase-auth:20.0.2")
128+
api("com.google.firebase:firebase-auth:20.0.3")
106129
}
107130
}
108131

109-
configure(listOf(iosArm64, iosX64)) {
110-
compilations.getByName("main") {
111-
source(sourceSets.get("iosMain"))
112-
val firebaseAuth by cinterops.creating {
113-
packageName("cocoapods.FirebaseAuth")
114-
defFile(file("$projectDir/src/iosMain/c_interop/FirebaseAuth.def"))
115-
compilerOpts(
116-
"-F$projectDir/src/iosMain/c_interop/Carthage/Build/iOS/"
117-
)
118-
}
119-
}
120-
}
132+
val iosMain by getting
133+
134+
val jsMain by getting
121135
}
122136
}
123137

firebase-auth/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
2626
"@gitlive/firebase-app": "1.2.0",
27-
"firebase": "8.2.3",
28-
"kotlin": "1.4.21",
29-
"kotlinx-coroutines-core": "1.4.2"
27+
"firebase": "8.2.10",
28+
"kotlin": "1.4.31",
29+
"kotlinx-coroutines-core": "1.4.3"
3030
}
3131
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json" == 7.4.0
1+
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json" == 7.7.0

0 commit comments

Comments
 (0)