-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
107 lines (94 loc) · 2.63 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
plugins {
kotlin("multiplatform") version "1.4.10"
id("org.jlleitschuh.gradle.ktlint") version "9.3.0"
id("org.sonarqube") version "3.0"
jacoco
}
group = "com.lpicanco.chip8"
version = "1.0-SNAPSHOT"
apply(plugin = "jacoco")
repositories {
mavenCentral()
jcenter()
}
kotlin {
targets.all {
compilations.all {
kotlinOptions {
freeCompilerArgs = listOf("-Xinline-classes", "-Xuse-experimental=kotlin.ExperimentalUnsignedTypes")
}
}
}
jvm {
compilations.all {
kotlinOptions.jvmTarget = "1.8"
}
withJava()
}
js {
compilations.all {
kotlinOptions {
sourceMap = true
metaInfo = true
}
}
browser {
testTask {
enabled = false
}
}
}
sourceSets {
val commonMain by getting {
dependencies {
implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val jvmMain by getting
val jvmTest by getting {
dependencies {
implementation(kotlin("test-junit"))
}
}
val jsMain by getting {
dependencies {
implementation(kotlin("stdlib-js"))
implementation("org.jetbrains.kotlinx:kotlinx-html-js:0.7.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.3.9")
}
}
val jsTest by getting {
dependencies {
implementation(kotlin("test-js"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-js:1.3.9")
}
}
}
}
tasks.withType<JacocoReport> {
dependsOn("jvmTest")
executionData.setFrom(files("$buildDir/jacoco/jvmTest.exec"))
reports {
xml.isEnabled = true
xml.destination = File("$buildDir/reports/jacoco/test/jacocoTestReport.xml")
}
}
tasks.register("jvmBuild") {
dependsOn("jvmTest", "ktlintCheck", "jvmJar")
}
tasks.register("jsBuild") {
dependsOn("jsTest", "ktlintCheck", "jsJar")
}
sonarqube {
properties {
property("sonar.junit.reportPaths", "build/test-results/jvmTest")
property("sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml")
}
}