generated from EdwinChang24/android-app-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
59 lines (55 loc) · 1.87 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import com.diffplug.gradle.spotless.SpotlessExtension
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.composeCompiler) apply false
alias(libs.plugins.composeJB) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.serialization) apply false
alias(libs.plugins.spotless) apply true
}
configure<SpotlessExtension> {
kotlin {
target(
fileTree(".") {
include("**/*.kt")
exclude("**/build/**")
}
)
ktfmt().kotlinlangStyle().configure { it.setManageTrailingCommas(true) }
}
kotlinGradle {
target("**/*.gradle.kts")
ktfmt().kotlinlangStyle().configure { it.setManageTrailingCommas(true) }
}
}
val mergeWeb: Task by
tasks.creating {
group = "custom"
dependsOn(":display:buildWebApp")
inputs.file(project("display").file("version.txt"))
doLast {
delete { delete("build/web") }
copy {
from(project.file("website"))
exclude("node_modules", "dist")
into(layout.buildDirectory.dir("web"))
}
copy {
from(project("display").layout.buildDirectory.file("webApp"))
rename("index.html", "display.html")
into(layout.buildDirectory.dir("web/public"))
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
layout.buildDirectory
.file("web/src/version/version.json")
.get()
.asFile
.writeText(
"\"${project("display").file("version.txt").readText().lines().first()}\""
)
}
}
true