-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
110 lines (94 loc) · 3.2 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
110 lines (94 loc) · 3.2 KB
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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.4.10"
`maven-publish`
signing
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}
defaultTasks("clean", "build")
allprojects {
group = "com.github.mvysny.karibudsl"
version = "2.6.1-SNAPSHOT"
repositories {
mavenCentral()
maven(url = "https://maven.vaadin.com/vaadin-prereleases/")
}
}
subprojects {
apply {
plugin("maven-publish")
plugin("kotlin")
plugin("org.gradle.signing")
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
// to see the stacktraces of failed tests in CI console.
exceptionFormat = TestExceptionFormat.FULL
showCauses = true
}
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType<KotlinCompile> {
compilerOptions.jvmTarget = JvmTarget.JVM_21
}
// creates a reusable function which configures proper deployment to Maven Central
ext["configureMavenCentral"] = { artifactId: String ->
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType<Javadoc> {
isFailOnError = false
}
publishing {
publications {
create("mavenJava", MavenPublication::class.java).apply {
groupId = project.group.toString()
this.artifactId = artifactId
version = project.version.toString()
pom {
description = "Karibu-DSL, Kotlin extensions/DSL for Vaadin"
name = artifactId
url = "https://github.com/mvysny/karibu-dsl"
licenses {
license {
name = "The MIT License (MIT)"
url = "https://opensource.org/licenses/MIT"
distribution = "repo"
}
}
developers {
developer {
id = "mavi"
name = "Martin Vysny"
email = "martin@vysny.me"
}
}
scm {
url = "https://github.com/mvysny/karibu-dsl"
}
}
from(components["java"])
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
}
}
nexusPublishing {
repositories {
// see https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#configuration
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}