-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathbuild.gradle.kts
110 lines (92 loc) · 2.79 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
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
group = "org.olafneumann.regexgenerator"
version = "1.0-SNAPSHOT"
plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.detekt)
alias(libs.plugins.sonarqube)
}
repositories {
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-js-wrappers/")
}
kotlin {
sourceSets {
jsMain.dependencies {
implementation(libs.kotlinx.html)
implementation(kotlin("stdlib-js"))
implementation(libs.kotlin.extension)
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.js)
implementation(libs.kotlin.multiplatform.diff)
implementation(npm("driver.js", "0.9.8"))
}
jsTest.dependencies {
implementation(kotlin("test"))
}
}
js {
useCommonJs()
binaries.executable()
browser {
commonWebpackConfig {
cssSupport {
//enabled.set(true)
}
}
webpackTask {
cssSupport {
enabled.set(true)
}
}
runTask {
cssSupport {
enabled.set(true)
}
}
testTask {
useKarma {
useFirefoxHeadless()
webpackConfig.cssSupport {
enabled.set(true)
}
}
}
}
}
}
tasks.withType<Detekt>().configureEach {
reports {
html.required.set(true)
txt.required.set(true)
sarif.required.set(true)
md.required.set(true)
}
}
detekt {
// Define the detekt configuration(s) you want to use.
config.from(file("$projectDir/.config/detekt.yml"))
source.from(file("$projectDir/src/"))
// Applies the config files on top of detekt's default config file. `false` by default.
buildUponDefaultConfig = true
// Turns on all the rules. `false` by default.
allRules = false
ignoreFailures = true
}
tasks.withType(Detekt::class.java).configureEach {
jvmTarget = "17"
}
sonar {
properties {
property("sonar.projectKey", "regex-generator")
property("sonar.organization", "noxone")
property("sonar.host.url", "https://sonarcloud.io")
}
}
// https://kotlinlang.org/docs/js-project-setup.html#installing-npm-dependencies-with-ignore-scripts-by-default
plugins.withType<YarnPlugin> {
rootProject.the<YarnRootExtension>().ignoreScripts = false
}