-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
42 lines (40 loc) · 1.34 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
allprojects {
group = "com.github.lamba92"
version = System.getenv("GITHUB_REF")?.split("/")?.last() ?: "0.2.5"
repositories {
jcenter()
mavenCentral()
}
}
subprojects {
apply(plugin = "kotlin-js-firebase-declarations-plugin")
}
task("generateReadme") {
group = "documentation"
inputs.file("README-TEMPLATE.md")
val packages = file("packages").listFiles { f -> f.isDirectory }!!
.filterIsInstance<File>()
.onEach {
inputs.dir(it.absolutePath)
}
outputs.file("README.md")
doLast {
with(file("README.md")) {
delete()
createNewFile()
writeText(file("README-TEMPLATE.md")
.readText()
.replace("%%%REPLACE-DEFINITIONS%%%", buildString {
packages.forEach {
appendln(" implementation(\"com.github.lamba92\", \"${rootProject.name}-${it.name}\", kotlinJsFirebaseDeclarationsVersion)")
}
})
.replace("%%%REPLACE-DEFINITIONS-2%%%", buildString {
packages.forEach {
appendln(" implementation(\"com.github.lamba92:${rootProject.name}-${it.name}:\$kotlinJsFirebaseDeclarationsVersion\")")
}
})
)
}
}
}