-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
149 lines (122 loc) · 3.98 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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpack
plugins {
base
alias(libs.plugins.dependencies)
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kover)
alias(libs.plugins.kotlinter)
`maven-publish`
signing
}
val jvmVersion = JavaVersion.VERSION_21
group = "me.kfricilone"
version = "1.0.0-SNAPSHOT"
description = "A Kotlin/JS library for generating github like repository cards."
tasks.withType<Wrapper> {
gradleVersion = libs.versions.gradle.get()
}
val rejectVersionRegex = Regex("(?i)[._-](?:alpha|beta|rc|cr|m|dev)")
tasks.withType<DependencyUpdatesTask> {
gradleReleaseChannel = "current"
revision = "release"
rejectVersionIf {
candidate.version.contains(rejectVersionRegex)
}
}
repositories {
mavenCentral()
}
kotlin {
explicitApi()
jvm {
jvmToolchain(jvmVersion.majorVersion.toInt())
}
js {
binaries.executable()
browser {
testTask {
useKarma {
useChromeHeadless()
}
}
}
}
sourceSets {
val jsMain by getting {
languageSettings.optIn("kotlin.js.ExperimentalJsExport")
dependencies {
implementation(kotlin("stdlib-js"))
implementation(libs.kotlin.react)
implementation(libs.kotlin.reactdom)
implementation(libs.kotlin.styled)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.html)
implementation(libs.kotlinx.serialization.json)
implementation(libs.ktor.client.content.negotiation)
implementation(libs.ktor.client.core)
implementation(libs.ktor.serialization.kotlinx.json)
}
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
implementation(libs.kotlinx.coroutines.test)
}
}
}
}
val copyJs = tasks.register<Copy>("copyJsResources") {
val distTask = tasks.getByName("jsBrowserDistribution")
val webpackTask = tasks.getByName<KotlinWebpack>("jsBrowserProductionWebpack")
dependsOn(distTask)
from({
webpackTask.outputDirectory.file(webpackTask.mainOutputFileName)
})
into({
layout.buildDirectory.file(
"processedResources/jvm/main/META-INF/resources/webjars/${rootProject.name}/${project.version}/${webpackTask.mainOutputFileName.get()}"
)
})
}
tasks.named("jvmProcessResources") {
dependsOn(copyJs)
}
publishing {
publications.withType<MavenPublication> {
pom {
url.set("https://github.com/kfricilone/${rootProject.name}")
inceptionYear.set("2021")
licenses {
license {
name.set("ISC License")
url.set("https://opensource.org/licenses/isc-license.txt")
}
}
developers {
developer {
name.set("Kyle Fricilone")
url.set("https://kfricilone.me")
}
}
scm {
connection.set("scm:git:https://github.com/kfricilone/${rootProject.name}")
developerConnection.set("scm:git:git@github.com:kfricilone/${rootProject.name}.git")
url.set("https://github.com/kfricilone/${rootProject.name}")
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/kfricilone/${rootProject.name}/issues")
}
ciManagement {
system.set("GitHub")
url.set("https://github.com/kfricilone/${rootProject.name}/actions?query=workflow%3Aci")
}
}
}
}
signing {
useGpgCmd()
sign(publishing.publications)
}