-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
147 lines (121 loc) · 4.3 KB
/
build.gradle.kts
File metadata and controls
147 lines (121 loc) · 4.3 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.sonarqube.gradle.SonarQubePlugin
plugins {
id("org.jetbrains.kotlin.jvm") version "2.3.10" apply (false)
//id("org.jetbrains.dokka") version "2.0.0" apply (false)
`maven-publish`
`java-library`
id("com.diffplug.spotless") version "8.2.1" apply false
id("org.sonarqube") version "7.2.2.6593"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
id("com.github.ben-manes.versions") version "0.53.0"
}
repositories {
mavenCentral()
}
sonar {
properties {
property("sonar.projectKey", "wadoon_key-tools")
property("sonar.organization", "wadoon")
property("sonar.host.url", "https://sonarcloud.io")
}
}
subprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
//apply(plugin = "org.jetbrains.dokka")
apply(plugin = "maven-publish")
apply(plugin = "java-library")
//apply(plugin = "com.diffplug.spotless")
val plugin by configurations.creating
configurations {
implementation.get().extendsFrom(plugin)
}
repositories {
mavenCentral()
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven") }
}
dependencies {
val implementation by configurations
val plugin by configurations
plugin(platform("org.jetbrains.kotlin:kotlin-bom"))
plugin("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
plugin("com.github.ajalt:clikt:2.8.0")
plugin("org.jetbrains:annotations:26.1.0")
plugin("org.slf4j:slf4j-api:2.0.17")
val testImplementation by configurations
testImplementation("org.junit.jupiter:junit-jupiter-api:6.0.3")
testImplementation("org.junit.jupiter:junit-jupiter-params:6.0.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:6.0.3")
testImplementation("com.google.truth:truth:1.4.5")
testImplementation("org.slf4j:slf4j-simple:2.0.17")
}
val javaVersion = 21
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersion))
}
}
tasks.withType<Test> {
useJUnitPlatform()
reports.html.required.set(false)
reports.junitXml.required.set(true)
testLogging {
events("passed", "skipped", "failed")
showExceptions = true
}
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType<Javadoc>() {
isFailOnError = false
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
repositories{
maven {
name = "folder"
url = uri("$rootDir/release")
}
}
pom {
url.set("http://github.com/wadoon/key-tools")
licenses {
license {
name.set("GPLv2+")
url.set("https://www.gnu.org/licenses/old-licenses/gpl-2.0.html")
}
}
developers {
developer {
id.set("weigl")
name.set("Alexander Weigl ")
email.set("weigl@kit.edu")
}
}
scm {
connection.set("scm:git:https://github.com/wadoon/key-tools.git")
developerConnection.set("scm:git:git@github.com:wadoon/key-tools.git")
url.set("http://github.com/wadoon/key-tools")
}
}
}
}
}
}
nexusPublishing {
repositories {
create("central") {
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
stagingProfileId.set("org.key-project")
val user: String = project.properties.getOrDefault("ossrhUsername", "").toString()
val pwd: String = project.properties.getOrDefault("ossrhPassword", "").toString()
username.set(user)
password.set(pwd)
}
}
}