Skip to content

Commit d4dcfae

Browse files
authored
Merge pull request #7 from GitLiveApp/publish_maven_central
publish to maven central
2 parents b0bfd81 + 7b58d6a commit d4dcfae

File tree

54 files changed

+345
-505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+345
-505
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
/.idea/
55
local.properties
66
/**/*.iml
7-
7+
*.iml
88
firebase-app/src/iosMain/c_interop/modules/
99
firebase-functions/src/iosMain/c_interop/modules/
1010
firebase-auth/src/iosMain/c_interop/modules/
1111
firebase-firestore/src/iosMain/c_interop/modules/
1212
firebase-database/src/iosMain/c_interop/modules/
13+
Firebase*.zip
14+
/Firebase
15+
/.DS_Store

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h1 align="left">Firebase Kotlin SDK <img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/gitliveapp/firebase-kotlin-sdk?style=flat-square"> <a href="https://teamhub.dev"><img src="https://img.shields.io/badge/collaborate-on%20gitlive-blueviolet?style=flat-square"></a></h1>
22
<img align="left" width="75px" src="https://avatars2.githubusercontent.com/u/42865805?s=200&v=4">
3-
<b>Built and maintained with 🧡 by <a href="https://teamhub.dev">TeamHub</a></b><br/>
3+
<b>Built and maintained with 🧡 by <a href="https://teamhub.dev">GitLive</a></b><br/>
44
<i>Real-time code collaboration inside any IDE</i><br/>
55
🔓 <a href="https://teamhub.typeform.com/to/uSS8cv">Request Early Access</a>
66
<h4></h4>
@@ -13,12 +13,12 @@ The following libraries are available for the various Firebase products.
1313

1414
| Service or Product | Gradle Dependency | API Coverage |
1515
| ------------------------------------------------------------------------------------ | :-----------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16-
| [Authentication](https://firebase.google.com/docs/auth#kotlin-android) | [`dev.gitlive.firebase:firebase-auth:0.1.0`](https://mvnrepository.com/artifact/dev.teamhub.firebase/firebase-auth/0.1.0) | [![40%](https://img.shields.io/badge/-40%25-red?style=flat-square)](/firebase-auth/src/commonMain/kotlin/dev/teamhub/firebase/auth/auth.kt) |
17-
| [Realtime Database](https://firebase.google.com/docs/database#kotlin-android) | [`dev.gitlive.firebase:firebase-database:0.1.0`](https://mvnrepository.com/artifact/dev.teamhub.firebase/firebase-database/0.1.0) | [![70%](https://img.shields.io/badge/-70%25-orange?style=flat-square)](/firebase-database/src/commonMain/kotlin/dev/teamhub/firebase/database/database.kt) |
18-
| [Cloud Firestore](https://firebase.google.com/docs/firestore#kotlin-android) | [`dev.gitlive.firebase:firebase-firestore:0.1.0`](https://mvnrepository.com/artifact/dev.teamhub.firebase/firebase-firestore/0.1.0) | [![60%](https://img.shields.io/badge/-60%25-orange?style=flat-square)](/firebase-firestore/src/commonMain/kotlin/dev/teamhub/firebase/firestore/firestore.kt) |
19-
| [Cloud Functions](https://firebase.google.com/docs/functions/callable#kotlin-android)| [`dev.gitlive.firebase:firebase-functions:0.1.0`](https://mvnrepository.com/artifact/dev.teamhub.firebase/firebase-functions/0.1.0) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-functions/src/commonMain/kotlin/dev/teamhub/firebase/functions/functions.kt) |
20-
| [Cloud Messaging](https://firebase.google.com/docs/messaging#kotlin-android) | [`dev.gitlive.firebase:firebase-messaging:0.1.0`](https://mvnrepository.com/artifact/dev.teamhub.firebase/firebase-messaging/0.1.0) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
21-
| [Cloud Storage](https://firebase.google.com/docs/storage#kotlin-android) | [`dev.gitlive.firebase:firebase-storage:0.1.0`](https://mvnrepository.com/artifact/dev.teamhub.firebase/firebase-storage/0.1.0) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
16+
| [Authentication](https://firebase.google.com/docs/auth#kotlin-android) | [`dev.gitlive.firebase:firebase-auth:0.1.0`](https://mvnrepository.com/artifact/dev.gitlive.firebase/firebase-auth/0.1.0) | [![40%](https://img.shields.io/badge/-40%25-red?style=flat-square)](/firebase-auth/src/commonMain/kotlin/dev/gitlive/firebase/auth/auth.kt) |
17+
| [Realtime Database](https://firebase.google.com/docs/database#kotlin-android) | [`dev.gitlive.firebase:firebase-database:0.1.0`](https://mvnrepository.com/artifact/dev.gitlive.firebase/firebase-database/0.1.0) | [![70%](https://img.shields.io/badge/-70%25-orange?style=flat-square)](/firebase-database/src/commonMain/kotlin/dev/gitlive/firebase/database/database.kt) |
18+
| [Cloud Firestore](https://firebase.google.com/docs/firestore#kotlin-android) | [`dev.gitlive.firebase:firebase-firestore:0.1.0`](https://mvnrepository.com/artifact/dev.gitlive.firebase/firebase-firestore/0.1.0) | [![60%](https://img.shields.io/badge/-60%25-orange?style=flat-square)](/firebase-firestore/src/commonMain/kotlin/dev/gitlive/firebase/firestore/firestore.kt) |
19+
| [Cloud Functions](https://firebase.google.com/docs/functions/callable#kotlin-android)| [`dev.gitlive.firebase:firebase-functions:0.1.0`](https://mvnrepository.com/artifact/dev.gitlive.firebase/firebase-functions/0.1.0) | [![80%](https://img.shields.io/badge/-80%25-green?style=flat-square)](/firebase-functions/src/commonMain/kotlin/dev/gitlive/firebase/functions/functions.kt) |
20+
| [Cloud Messaging](https://firebase.google.com/docs/messaging#kotlin-android) | [`dev.gitlive.firebase:firebase-messaging:0.1.0`](https://mvnrepository.com/artifact/dev.gitlive.firebase/firebase-messaging/0.1.0) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
21+
| [Cloud Storage](https://firebase.google.com/docs/storage#kotlin-android) | [`dev.gitlive.firebase:firebase-storage:0.1.0`](https://mvnrepository.com/artifact/dev.gitlive.firebase/firebase-storage/0.1.0) | ![0%](https://img.shields.io/badge/-0%25-lightgrey?style=flat-square) |
2222

2323
Is the Firebase library or API you need missing? [Create an issue](https://github.com/GitLiveApp/firebase-kotlin-sdk/issues/new?labels=API+coverage&template=increase-api-coverage.md&title=Add+%5Bclass+name%5D.%5Bfunction+name%5D+to+%5Blibrary+name%5D+for+%5Bplatform+names%5D) to request additional API coverage or be awesome and [submit a PR](https://github.com/GitLiveApp/firebase-kotlin-sdk/fork)
2424

build.gradle.kts

Lines changed: 142 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,50 @@
1+
import de.undercouch.gradle.tasks.download.Download
2+
13
plugins {
24
kotlin("multiplatform") version "1.3.70" apply false
5+
id("de.undercouch.download").version("3.4.3")
6+
id("base")
37
}
48

59
buildscript {
610
repositories {
11+
jcenter()
712
google()
813
gradlePluginPortal()
914
}
1015
dependencies {
1116
classpath("com.android.tools.build:gradle:3.4.2")
17+
classpath("de.undercouch:gradle-download-task:4.0.4")
1218
}
1319
}
1420

1521
val targetSdkVersion by extra(28)
1622
val minSdkVersion by extra(14)
1723

24+
25+
26+
tasks {
27+
val downloadIOSFirebaseZipFile by creating(Download::class) {
28+
onlyIfModified(true)
29+
src("https://github.com/firebase/firebase-ios-sdk/releases/download/6.17.0/Firebase-6.17.0.zip")
30+
dest(File("$buildDir", "Firebase-6.17.0.zip"))
31+
overwrite(true)
32+
33+
}
34+
35+
val unzipIOSFirebase by creating(Copy::class) {
36+
dependsOn(downloadIOSFirebaseZipFile)
37+
from(zipTree(downloadIOSFirebaseZipFile.dest))
38+
into("$buildDir")
39+
outputs.upToDateWhen { File("$rootDir/$buildDir/Firebase").isDirectory }
40+
}
41+
42+
}
43+
1844
subprojects {
1945

20-
group = "dev.teamhub.firebase"
46+
47+
group = "dev.gitlive"
2148

2249
repositories {
2350
mavenLocal()
@@ -26,6 +53,52 @@ subprojects {
2653
jcenter()
2754
}
2855

56+
57+
tasks {
58+
59+
val copyReadMe by registering(Copy::class) {
60+
from(rootProject.file("README.md"))
61+
into(file("$buildDir/node_module"))
62+
}
63+
64+
val copyPackageJson by registering(Copy::class) {
65+
from(file("package.json"))
66+
into(file("$buildDir/node_module"))
67+
}
68+
69+
val copyJS by registering {
70+
doLast {
71+
val from = File("$buildDir/classes/kotlin/js/main/${project.name}.js")
72+
val into = File("$buildDir/node_module/${project.name}.js")
73+
into.createNewFile()
74+
into.writeText(from.readText()
75+
.replace("require('firebase-", "require('@gitlive/firebase-")
76+
// .replace("require('kotlinx-serialization-kotlinx-serialization-runtime')", "require('@gitlive/kotlinx-serialization-runtime')")
77+
)
78+
}
79+
}
80+
81+
val copySourceMap by registering(Copy::class) {
82+
from(file("$buildDir/classes/kotlin/js/main/${project.name}.js.map"))
83+
into(file("$buildDir/node_module"))
84+
}
85+
86+
87+
val publishToNpm by creating(Exec::class) {
88+
89+
dependsOn(
90+
copyPackageJson,
91+
copyJS,
92+
copySourceMap,
93+
copyReadMe
94+
)
95+
96+
workingDir("$buildDir/node_module")
97+
//commandLine("npm", "publish")
98+
commandLine("ls")
99+
}
100+
}
101+
29102
// tasks.withType<KotlinCompile<*>> {
30103
// kotlinOptions.freeCompilerArgs += listOf(
31104
// "-Xuse-experimental=kotlin.Experimental",
@@ -35,20 +108,84 @@ subprojects {
35108
// }
36109

37110
afterEvaluate {
111+
// create the projects node_modules if they don't exist
112+
if(!File("$buildDir/node_module").exists()) {
113+
mkdir("$buildDir/node_module")
114+
}
115+
116+
tasks.getByPath("compileKotlinIos").dependsOn(rootProject.tasks.named("unzipIOSFirebase"))
117+
tasks.getByPath("compileKotlinIosArm64").dependsOn(rootProject.tasks.named("unzipIOSFirebase"))
118+
38119
dependencies {
39120
"commonMainImplementation"(kotlin("stdlib-common"))
40121
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.4")
41122
"jsMainImplementation"(kotlin("stdlib-js"))
42123
"jsMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.3.4")
43124
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.4")
44125
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.3.4")
45-
"jvmMainImplementation"(kotlin("stdlib-jdk8"))
46-
"jvmMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.4")
47-
"jvmMainApi"("app.teamhub:firebase-java:0.3.1")
48-
"jvmMainApi"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.3.4")
49126
"iosMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.4")
50127
"iosMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.4")
51128
}
52129
}
130+
131+
apply(plugin="maven-publish")
132+
apply(plugin="signing")
133+
134+
135+
configure<PublishingExtension> {
136+
137+
repositories {
138+
maven {
139+
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
140+
credentials {
141+
username = project.findProperty("sonatypeUsername") as String? ?: System.getenv("sonatypeUsername")
142+
password = project.findProperty("sonatypePassword") as String? ?: System.getenv("sonatypePassword")
143+
}
144+
}
145+
}
146+
147+
publications.all {
148+
this as MavenPublication
149+
150+
pom {
151+
name.set("firebase-kotlin-sdk")
152+
description.set("The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. It's API is similar to the Firebase Android SDK Kotlin Extensions but also supports multiplatform projects, enabling you to use Firebase directly from your common source targeting iOS, Android or JS.")
153+
url.set("https://github.com/GitLiveApp/firebase-kotlin-sdk")
154+
inceptionYear.set("2019")
155+
156+
scm {
157+
url.set("https://github.com/GitLiveApp/firebase-kotlin-sdk")
158+
connection.set("scm:git:https://github.com/GitLiveApp/firebase-kotlin-sdk.git")
159+
developerConnection.set("scm:git:https://github.com/GitLiveApp/firebase-kotlin-sdk.git")
160+
tag.set("HEAD")
161+
}
162+
163+
issueManagement {
164+
system.set("GitHub Issues")
165+
url.set("https://github.com/GitLiveApp/firebase-kotlin-sdk/issues")
166+
}
167+
168+
developers {
169+
developer {
170+
name.set("Nicholas Bransby-Williams")
171+
email.set("[email protected]")
172+
}
173+
}
174+
175+
licenses {
176+
license {
177+
name.set("The Apache Software License, Version 2.0")
178+
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
179+
distribution.set("repo")
180+
comments.set("A business-friendly OSS license")
181+
}
182+
}
183+
184+
}
185+
}
186+
187+
188+
}
189+
53190
}
54191

firebase-app/build.gradle.kts

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
/*
22
* Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license.
33
*/
4+
version = "0.1.0-beta"
45

5-
import org.apache.tools.ant.taskdefs.condition.Os
66

77
plugins {
88
id("com.android.library")
99
kotlin("multiplatform")
1010
kotlin("native.cocoapods")
11-
`maven-publish`
1211
}
12+
1313
repositories {
1414
mavenCentral()
1515
google()
1616
}
1717

18-
version = "0.1.0-beta"
19-
2018
android {
2119
compileSdkVersion(property("targetSdkVersion") as Int)
2220
defaultConfig {
@@ -48,13 +46,6 @@ kotlin {
4846
android {
4947
publishLibraryVariants("release", "debug")
5048
}
51-
jvm {
52-
val main by compilations.getting {
53-
kotlinOptions {
54-
jvmTarget = "1.8"
55-
}
56-
}
57-
}
5849

5950
val iosArm64 = iosArm64()
6051
val iosX64 = iosX64("ios")
@@ -70,9 +61,6 @@ kotlin {
7061
api("com.google.firebase:firebase-common:19.2.0")
7162
}
7263
}
73-
val jvmMain by getting {
74-
kotlin.srcDir("src/androidMain/kotlin")
75-
}
7664
// val iosMain by creating
7765

7866
configure(listOf(iosArm64, iosX64)) {
@@ -81,8 +69,7 @@ kotlin {
8169
val firebasecore by cinterops.creating {
8270
packageName("cocoapods.FirebaseCore")
8371
defFile(file("$projectDir/src/iosMain/c_interop/FirebaseCore.def"))
84-
//includeDirs("$projectDir/../native/Avalon/Pods/FirebaseCore/Firebase/Core/Public")
85-
compilerOpts("-F$projectDir/src/iosMain/c_interop/modules/FirebaseCore-6.0.2")
72+
compilerOpts("-F$projectDir/../build/Firebase/FirebaseAnalytics")
8673
}
8774
}
8875
}
@@ -95,40 +82,9 @@ kotlin {
9582
}
9683
}
9784

98-
tasks {
99-
val copyPackageJson by registering(Copy::class) {
100-
from(file("package.json"))
101-
into(file("$buildDir/node_module"))
102-
}
103-
104-
val copyJS by registering {
105-
doLast {
106-
val from = File("$buildDir/classes/kotlin/js/main/${project.name}.js")
107-
val into = File("$buildDir/node_module/${project.name}.js")
108-
into.createNewFile()
109-
into.writeText(from.readText()
110-
.replace("require('firebase-", "require('@teamhubapp/firebase-")
111-
// .replace("require('kotlinx-serialization-kotlinx-serialization-runtime')", "require('@teamhub/kotlinx-serialization-runtime')")
112-
)
113-
}
114-
}
115-
116-
val copySourceMap by registering(Copy::class) {
117-
from(file("$buildDir/classes/kotlin/js/main/${project.name}.js.map"))
118-
into(file("$buildDir/node_module"))
119-
}
120-
121-
val publishToNpm by registering(Exec::class) {
122-
doFirst {
123-
mkdir("$buildDir/node_module")
124-
}
85+
signing {
86+
sign(publishing.publications)
87+
}
12588

126-
dependsOn(copyPackageJson, copyJS, copySourceMap)
127-
workingDir("$buildDir/node_module")
128-
if(Os.isFamily(Os.FAMILY_WINDOWS)) {
129-
commandLine("cmd", "/c", "npm publish --registry http://localhost:4873")
130-
} else {
131-
commandLine("npm", "publish", "--registry http://localhost:4873")
132-
}
133-
}
134-
}
89+
tasks.getByPath("compileKotlinIos").dependsOn(rootProject.tasks.named("unzipIOSFirebase"))
90+
tasks.getByPath("compileKotlinIosArm64").dependsOn(rootProject.tasks.named("unzipIOSFirebase"))

firebase-app/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@teamhubapp/firebase-app",
2+
"name": "@gitlive/firebase-app",
33
"version": "0.1.0-beta4",
44
"description": "Wrapper around firebase for usage in Kotlin Multiplatform projects",
55
"main": "firebase-app.js",
@@ -8,22 +8,22 @@
88
},
99
"repository": {
1010
"type": "git",
11-
"url": "git+https://github.com/TeamHubApp/firebase-kotlin-multiplatform-sdk.git"
11+
"url": "git+https://github.com/GitLiveApp/firebase-kotlin-sdk.git"
1212
},
1313
"keywords": [
1414
"kotlin",
1515
"multiplatform",
1616
"kotlin-js",
1717
"firebase"
1818
],
19-
"author": "teamhub.dev",
19+
"author": "dev.gitlive",
2020
"license": "Apache-2.0",
2121
"bugs": {
22-
"url": "https://github.com/TeamHubApp/firebase-kotlin-sdk/issues"
22+
"url": "https://github.com/GitLiveApp/firebase-kotlin-sdk/issues"
2323
},
24-
"homepage": "https://github.com/TeamHubApp/firebase-kotlin-sdk",
24+
"homepage": "https://github.com/GitLiveApp/firebase-kotlin-sdk",
2525
"dependencies": {
26-
"@teamhubapp/firebase-common": "0.1.0-beta4",
26+
"@gitlive/firebase-common": "0.1.0-beta4",
2727
"firebase": "6.2.3",
2828
"kotlin": "1.3.70",
2929
"kotlinx-coroutines-core": "1.3.4"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<manifest package="dev.teamhub.firebase"/>
1+
<manifest package="dev.gitlive.firebase"/>

firebase-app/src/androidMain/kotlin/dev/teamhub/firebase/firebase.kt renamed to firebase-app/src/androidMain/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2020 GitLive Ltd. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
package dev.teamhub.firebase
5+
package dev.gitlive.firebase
66

77
import android.content.Context
88

firebase-app/src/commonMain/kotlin/dev/teamhub/firebase/firebase.kt renamed to firebase-app/src/commonMain/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
@file:JvmMultifileClass
66
@file:JvmName("CommonKt")
7-
package dev.teamhub.firebase
7+
package dev.gitlive.firebase
88

99
import kotlin.jvm.JvmMultifileClass
1010
import kotlin.jvm.JvmName

0 commit comments

Comments
 (0)