1
+ import de.undercouch.gradle.tasks.download.Download
2
+
1
3
plugins {
2
4
kotlin(" multiplatform" ) version " 1.3.70" apply false
5
+ id(" de.undercouch.download" ).version(" 3.4.3" )
3
6
}
4
7
5
8
buildscript {
6
9
repositories {
10
+ jcenter()
7
11
google()
8
12
gradlePluginPortal()
9
13
}
10
14
dependencies {
11
15
classpath(" com.android.tools.build:gradle:3.4.2" )
16
+ classpath(" de.undercouch:gradle-download-task:4.0.4" )
12
17
}
13
18
}
14
19
15
20
val targetSdkVersion by extra(28 )
16
21
val minSdkVersion by extra(14 )
17
22
23
+
24
+
25
+ tasks {
26
+ val downloadZipFile by creating(Download ::class ) {
27
+ src(" https://github.com/firebase/firebase-ios-sdk/releases/download/6.17.0/Firebase-6.17.0.zip" )
28
+ dest(File (rootDir, " Firebase-6.17.0.zip" ))
29
+ overwrite(true )
30
+ }
31
+
32
+ val unzipFirebase by creating(Copy ::class ) {
33
+ dependsOn(downloadZipFile)
34
+ from(zipTree(downloadZipFile.dest))
35
+ into(rootDir)
36
+ }
37
+
38
+ val copyFirebaseAuth by creating(Copy ::class ){
39
+ dependsOn(unzipFirebase)
40
+ from(" $rootDir /Firebase/FirebaseAuth/FirebaseAuth.framework" )
41
+ into(" $rootDir /firebase-auth/src/iosMain/c_interop/modules/FirebaseAuth.framework" )
42
+ }
43
+
44
+ val copyFirebaseDatabase by creating(Copy ::class ){
45
+ dependsOn(copyFirebaseAuth)
46
+ from(" $rootDir /Firebase/FirebaseDatabase/FirebaseDatabase.framework" )
47
+ into(" $rootDir /firebase-database/src/iosMain/c_interop/modules/FirebaseDatabase.framework" )
48
+ }
49
+
50
+ val copyFirebaseFirestore by creating(Copy ::class ){
51
+ dependsOn(copyFirebaseDatabase)
52
+ from(" $rootDir /Firebase/FirebaseFirestore/FirebaseFirestore.framework" )
53
+ into(" $rootDir /firebase-database/src/iosMain/c_interop/modules/FirebaseFirestore.framework" )
54
+ }
55
+
56
+ val copyFirebaseFunctions by creating(Copy ::class ){
57
+ dependsOn(copyFirebaseFirestore)
58
+ from(" $rootDir /Firebase/FirebaseFunctions/FirebaseFunctions.framework" )
59
+ into(" $rootDir /firebase-database/src/iosMain/c_interop/modules/FirebaseFunctions.framework" )
60
+ }
61
+
62
+ val copyAllFirebaseFrameworks by creating(Copy ::class ){
63
+ dependsOn(copyFirebaseFunctions)
64
+ from(" $rootDir /Firebase/FirebaseAnalytics/FirebaseCore.framework" )
65
+ into(" $rootDir /firebase-app/src/iosMain/c_interop/modules/FirebaseCore.framework" )
66
+ }
67
+
68
+ }
69
+
70
+
71
+
18
72
subprojects {
19
73
20
74
group = " dev.gitlive"
@@ -24,6 +78,14 @@ subprojects {
24
78
mavenCentral()
25
79
google()
26
80
jcenter()
81
+ maven {
82
+ name = " github"
83
+ url = uri(" https://maven.pkg.github.com/gitliveapp/firebase-java" )
84
+ credentials {
85
+ username = project.property(" gpr.user" ) as String
86
+ password = project.property(" gpr.key" ) as String
87
+ }
88
+ }
27
89
}
28
90
29
91
@@ -56,6 +118,7 @@ subprojects {
56
118
into(file(" $buildDir /node_module" ))
57
119
}
58
120
121
+
59
122
val publishToNpm by registering(Exec ::class ) {
60
123
doFirst {
61
124
if (! File (" $buildDir /node_module" ).exists()) {
@@ -67,7 +130,25 @@ subprojects {
67
130
it.equals(" build" )
68
131
}
69
132
70
- dependsOn(buildTask, copyPackageJson, copyJS, copySourceMap, copyReadMe)
133
+ if (! File (rootDir, " Firebase" ).exists()) {
134
+ dependsOn(
135
+ rootProject.tasks.named(" copyAllFirebaseFrameworks" ).get(),
136
+ buildTask,
137
+ copyPackageJson,
138
+ copyJS,
139
+ copySourceMap,
140
+ copyReadMe
141
+ )
142
+ } else {
143
+ dependsOn(
144
+ buildTask,
145
+ copyPackageJson,
146
+ copyJS,
147
+ copySourceMap,
148
+ copyReadMe
149
+ )
150
+
151
+ }
71
152
workingDir(" $buildDir /node_module" )
72
153
// commandLine("npm", "publish")
73
154
commandLine(" ls" )
0 commit comments