forked from hfhbd/routing-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
161 lines (146 loc) · 4.39 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import org.jetbrains.compose.*
import java.util.*
import io.gitlab.arturbosch.detekt.*
plugins {
kotlin("multiplatform") version "1.8.0"
id("org.jetbrains.compose") version "1.3.0"
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("io.gitlab.arturbosch.detekt") version "1.22.0"
id("app.cash.licensee") version "1.6.0"
}
group = "app.softwork"
repositories {
mavenCentral()
google()
maven(url = "https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
kotlin {
jvm()
js(IR) {
browser()
}
explicitApi()
targets.configureEach {
compilations.configureEach {
kotlinOptions.allWarningsAsErrors = true
}
}
sourceSets {
configureEach {
languageSettings {
progressiveMode = true
}
}
commonMain {
dependencies {
api(compose.runtime)
api("app.softwork:kotlinx-uuid-core:0.0.17")
}
}
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
named("jsMain") {
dependencies {
api(compose.web.core)
}
}
named("jsTest") {
dependencies {
implementation(compose.web.testUtils)
}
}
named("jvmTest") {
dependencies {
@OptIn(ExperimentalComposeLibrary::class)
implementation(compose.uiTestJUnit4) // there is no non-ui testing
implementation(compose.desktop.currentOs) // ui-testings needs skiko
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-swing:1.6.4")
}
}
}
}
licensee {
allow("Apache-2.0")
}
val emptyJar by tasks.registering(Jar::class) { }
publishing {
publications.configureEach {
this as MavenPublication
artifact(emptyJar) {
classifier = "javadoc"
}
pom {
name.set("app.softwork Routing Compose")
description.set("A multiplatform library for routing to use with JetPack Compose Web and Desktop")
url.set("https://github.com/hfhbd/routing-compose")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("hfhbd")
name.set("Philip Wedemann")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git://github.com/hfhbd/routing-compose.git")
developerConnection.set("scm:git://github.com/hfhbd/routing-compose.git")
url.set("https://github.com/hfhbd/routing-compose")
}
}
}
}
(System.getProperty("signing.privateKey") ?: System.getenv("SIGNING_PRIVATE_KEY"))?.let {
String(Base64.getDecoder().decode(it)).trim()
}?.let { key ->
signing {
val signingPassword = System.getProperty("signing.password") ?: System.getenv("SIGNING_PASSWORD")
useInMemoryPgpKeys(key, signingPassword)
sign(publishing.publications)
}
}
nexusPublishing {
repositories {
sonatype {
username.set(System.getProperty("sonartype.apiKey") ?: System.getenv("SONARTYPE_APIKEY"))
password.set(System.getProperty("sonartype.apiToken") ?: System.getenv("SONARTYPE_APITOKEN"))
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
detekt {
source = files(rootProject.rootDir)
parallel = true
buildUponDefaultConfig = true
}
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.22.0")
}
tasks {
fun SourceTask.config() {
include("**/*.kt")
exclude("**/*.kts")
exclude("**/resources/**")
exclude("**/generated/**")
exclude("**/build/**")
}
withType<DetektCreateBaselineTask>().configureEach {
config()
}
withType<Detekt>().configureEach {
config()
reports {
sarif.required.set(true)
}
}
}