-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
117 lines (106 loc) · 3.61 KB
/
build.gradle.kts
File metadata and controls
117 lines (106 loc) · 3.61 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
111
112
113
114
115
116
117
plugins {
kotlin("jvm") version "2.0.0"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
`java-library`
`maven-publish`
signing
}
kotlin {
jvmToolchain(21)
}
java {
withJavadocJar()
withSourcesJar()
}
val libraryVersion: String by project
group = "io.github.lancomsystems.openapi.parser"
version = libraryVersion
dependencies {
implementation("tools.jackson.core:jackson-databind:3.0.4")
implementation("tools.jackson.dataformat:jackson-dataformat-yaml:3.0.4")
implementation("tools.jackson.module:jackson-module-kotlin:3.0.4")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.3")
}
sourceSets {
main {
kotlin {
srcDirs("src/generated/kotlin")
}
}
test {
kotlin {
srcDirs("src/generatedtest/kotlin")
}
}
}
tasks.named<Test>("test") {
useJUnitPlatform()
}
val sonatypeUsername = System.getenv("SONATYPE_USERNAME") ?: System.getenv("MAVEN_USERNAME")
val sonatypePassword = System.getenv("SONATYPE_PASSWORD") ?: System.getenv("MAVEN_PASSWORD")
if (sonatypeUsername != null && sonatypePassword != null) {
nexusPublishing {
repositories {
sonatype {
// Route through Central Portal's OSSRH Staging API compatibility service.
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
username = sonatypeUsername
password = sonatypePassword
}
}
}
} else if (sonatypeUsername != null || sonatypePassword != null) {
throw GradleException(
"missing SONATYPE_USERNAME or SONATYPE_PASSWORD (legacy MAVEN_USERNAME/MAVEN_PASSWORD is still supported)!",
)
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "openapi-parser"
from(components["java"])
pom {
name = "openapi-parser"
description =
"This open-source project provides an OpenAPI 3.0 Parser implemented in Kotlin, utilizing immutable data classes"
url = "https://github.com/lancomsystems/openapi-parser"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "drieks"
name = "Dennis Rieks"
email = "dennis.rieks@lancom.de"
}
}
scm {
connection = "scm:git:git://git@github.com:lancomsystems/openapi-parser.git"
url = "https://github.com/lancomsystems/openapi-parser"
}
}
}
}
}
signing {
Triple(
System.getenv("GPG_SIGNING_KEY_ID"),
System.getenv("GPG_SIGNING_KEY"),
System.getenv("GPG_SIGNING_PASSWORD"),
).let { (id, key, passwd) ->
if (id != null && key != null && passwd != null) {
useInMemoryPgpKeys(id, key, passwd)
sign(publishing.publications)
} else if (id != null || key != null || passwd != null) {
throw GradleException("missing sign id, key or passwd!")
}
}
}
tasks.javadoc {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}