-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle.kts
85 lines (73 loc) · 2.41 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
buildscript {
dependencies {
classpath(kotlin("gradle-plugin", version = Versions.kotlin))
}
}
plugins {
kotlin("jvm") version Versions.kotlin apply false
id("com.google.devtools.ksp") version Versions.ksp apply false
id("org.jlleitschuh.gradle.ktlint") version Versions.ktlintPlugin apply false
id("io.github.gradle-nexus.publish-plugin") version Versions.nexus
}
val versionNumber = System.getenv("VERSION")?.substringAfter("R-") ?: "0.0.15"
println("building current version: $versionNumber")
allprojects {
group = "com.izivia"
version = versionNumber
repositories {
mavenLocal()
mavenCentral()
}
}
subprojects {
tasks.withType<KotlinCompile>().all {
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs = listOf("-Xjsr305=strict", "-Xopt-in=kotlin.RequiresOptIn")
languageVersion = "1.8"
apiVersion = "1.8"
}
}
tasks.withType<Test> {
useJUnitPlatform()
}
apply {
plugin("java")
plugin("org.jetbrains.kotlin.jvm")
plugin("org.jlleitschuh.gradle.ktlint")
}
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
version.set(Versions.ktlint)
verbose.set(true)
outputToConsole.set(true)
reporters {
reporter(ReporterType.JSON)
}
filter {
exclude { element -> element.file.path.contains("generated") }
}
}
plugins.withType<JavaLibraryPlugin> {
val internal by configurations.creating {
isVisible = false
isCanBeConsumed = false
isCanBeResolved = false
}
configurations["compileClasspath"].extendsFrom(internal)
configurations["runtimeClasspath"].extendsFrom(internal)
configurations["testCompileClasspath"].extendsFrom(internal)
configurations["testRuntimeClasspath"].extendsFrom(internal)
}
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username.set(System.getenv("SONATYPE_USERNAME"))
password.set(System.getenv("SONATYPE_PASSWORD"))
}
}
}