forked from stellar/kotlin-wallet-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
86 lines (70 loc) · 2.03 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
// The alias call in plugins scope produces IntelliJ false error which is suppressed here.
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.spotless)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.detekt)
}
apply(plugin = "base")
val jvmVersion = JavaVersion.VERSION_11
allprojects {
group = "org.stellar.wallet-sdk"
version = "1.7.2"
}
subprojects {
val subProject = this
apply(plugin = "com.diffplug.spotless")
apply(plugin = "kotlin")
apply(plugin = "io.gitlab.arturbosch.detekt")
repositories {
mavenLocal()
mavenCentral()
}
// Do not apply spotless and detekt to auto-generated files
if (subProject.name != "documentation") {
spotless {
val javaVersion = JavaVersion.current()
if (javaVersion < JavaVersion.VERSION_11) {
throw GradleException("Java 11 or greater is required for spotless Gradle plugin.")
}
kotlin { ktfmt("0.39").googleStyle() }
}
detekt {
toolVersion = "1.22.0"
config = files("$rootDir/config/detekt/detekt.yml")
buildUponDefaultConfig = true
}
}
dependencies {
// Define common dependencies here
}
tasks {
compileKotlin {
// Ignore spotless for auto-generated files
if (subProject.name != "documentation") {
dependsOn("spotlessKotlinApply")
}
kotlinOptions.jvmTarget = jvmVersion.toString()
compilerOptions {
freeCompilerArgs.add("-opt-in=kotlin.io.encoding.ExperimentalEncodingApi")
}
}
compileTestKotlin {
kotlinOptions.jvmTarget = jvmVersion.toString()
compilerOptions {
freeCompilerArgs.add("-opt-in=kotlin.io.encoding.ExperimentalEncodingApi")
}
}
test { useJUnitPlatform() }
}
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
reports {
xml.required.set(false)
html.required.set(true)
txt.required.set(false)
sarif.required.set(false)
md.required.set(false)
}
}
}
tasks.register("printVersionName") { println(rootProject.version.toString()) }