This repository has been archived by the owner on Aug 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
148 lines (138 loc) · 4.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
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
plugins {
kotlin("multiplatform") version "1.5.30"
id("maven-publish")
id("io.gitlab.arturbosch.detekt") version "1.18.0"
id("org.jlleitschuh.gradle.ktlint") version "10.1.0"
}
group = "org.chiachat"
version = "1.0.5"
repositories {
mavenCentral()
maven("https://jitpack.io")
maven("https://artifacts.consensys.net/public/maven/maven/")
}
val okioVersion = "3.0.0-alpha.9"
val ktorVersion = "1.6.3"
kotlin {
jvm {
compilations.all {
kotlinOptions.jvmTarget = "11"
}
testRuns["test"].executionTask.configure {
useJUnitPlatform()
}
}
/*js(IR) {
useCommonJs()
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
testTask {
useKarma {
useChromeHeadless()
useFirefox()
}
}
}
}*/
/*
iosArm64 {
binaries {
framework {
baseName = "library"
}
}
}
iosX64 {
binaries {
framework {
baseName = "library"
}
}
}*/
/*val publicationsFromMainHost =
listOf(jvm(), js()).map { it.name } + "kotlinMultiplatform"
publishing {
publications {
matching { it.name in publicationsFromMainHost }.all {
val targetPublication = this@all
tasks.withType<AbstractPublishToMaven>()
.matching { it.publication == targetPublication }
.configureEach { onlyIf { findProperty("isMainHost") == "true" } }
}
}
}*/
sourceSets {
val commonMain by getting {
dependencies {
api("com.squareup.okio:okio-multiplatform:$okioVersion")
implementation("io.ktor:ktor-client-websockets:$ktorVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("com.ionspin.kotlin:bignum:0.3.1")
}
}
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
}
}
val jvmMain by getting {
dependencies {
implementation("com.squareup.okio:okio:$okioVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("com.github.chiachat:jbls:1.0.5")
implementation("org.apache.tuweni:tuweni-ssz:2.0.0")
implementation("org.apache.tuweni:tuweni-bytes:2.0.0")
}
}
val jvmTest by getting {
dependencies {
api("com.squareup.okio:okio-fakefilesystem:$okioVersion")
}
}
/*val jsMain by getting {
dependencies {
api("com.squareup.okio:okio-nodefilesystem-js:$okioVersion")
implementation("io.ktor:ktor-client-js:$ktorVersion")
}
}*/
/*
val jsTest by getting
val iosArm64Main by getting
val iosArm64Test by getting
val iosX64Main by getting
val iosX64Test by getting*/
}
}
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.18.0")
}
// configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
// debug.set(true)
// }
detekt {
buildUponDefaultConfig = true // preconfigure defaults
allRules = true // activate all available (even unstable) rules.
// point to your custom config defining rules to run, overwriting default behavior
config = files("../config/detekt.yml")
// a way of suppressing issues before introducing detekt
baseline = file("../config/baseline.xml")
reports {
html.enabled = true // observe findings in your browser with structure and code snippets
xml.enabled = true // checkstyle like format mainly for integrations like Jenkins
txt.enabled = true
// similar to the console output, contains issue signature to
// manually edit baseline files
sarif.enabled = true
// standardized SARIF format (https://sarifweb.azurewebsites.net/) to support integrations with Github Code Scanning
}
}
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
// Target version of the generated JVM bytecode. It is used for type resolution.
jvmTarget = "11"
}
rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin::class.java) {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>()
.versions.webpackDevServer.version = "4.0.0-rc.0"
}