-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle.kts
96 lines (82 loc) · 3.07 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
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Configuration variables
val defaultGroupId = "org.onflow"
val defaultVersion = "2.1.1"
fun getProp(name: String, defaultValue: String? = null): String? {
return project.findProperty("flow.$name")?.toString()?.trim()?.ifBlank { null }
?: project.findProperty(name)?.toString()?.trim()?.ifBlank { null }
?: defaultValue
}
plugins {
kotlin("jvm") version "2.0.21" apply false
id("org.jetbrains.dokka") version "1.9.10" apply false
id("org.jmailen.kotlinter") version "4.4.1" apply false
id("kotlinx-serialization") version "1.8.0" apply false
id("com.vanniktech.maven.publish") version "0.28.0" apply false
}
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21")
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
maven { url = uri("https://dl.bintray.com/ethereum/maven/") }
}
}
subprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.dokka")
apply(plugin = "org.jmailen.kotlinter")
apply(plugin = "kotlinx-serialization")
apply(plugin = "com.vanniktech.maven.publish")
group = getProp("groupId", defaultGroupId)!!
version = when {
getProp("version") !in setOf("unspecified", null) -> getProp("version")!!
getProp("snapshotDate") != null -> "${defaultVersion.replace("-SNAPSHOT", "")}.${getProp("snapshotDate")!!}-SNAPSHOT"
else -> defaultVersion
}
val intTestImplementation: Configuration by configurations.creating {
extendsFrom(configurations["implementation"])
}
val intTestRuntimeOnly: Configuration by configurations.creating {
extendsFrom(configurations["runtimeOnly"])
}
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
freeCompilerArgs.addAll("-Xjsr305=strict", "-opt-in=kotlin.RequiresOptIn")
}
}
dependencies {
"api"("org.jetbrains.kotlin:kotlin-reflect:2.0.21")
//dokkaHtmlPlugin"("org.jetbrains.dokka:kotlin-as-java-plugin:2.0.0-Beta")
}
tasks.named<KotlinCompile>("compileTestKotlin") {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
freeCompilerArgs.addAll("-Xjsr305=strict", "-opt-in=kotlin.RequiresOptIn")
}
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showExceptions = true
showStackTraces = true
showCauses = true
}
systemProperty("logback.configurationFile", rootProject.file("./logback.xml").absolutePath)
systemProperty("org.slf4j.simpleLogger.defaultLogLevel", "info")
systemProperty("io.netty.logger.type", "slf4j")
systemProperty("io.netty.leakDetection.level", "DISABLED")
}
}