-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
140 lines (110 loc) · 3.64 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
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
import com.diffplug.gradle.spotless.SpotlessExtension
val mvnGroupId = "io.github.wcarmon"
val mvnArtifactId = "lock-utils-jvm" // see settings.gradle.kts
val mvnVersion = "1.0.0"
val ossrhPassword: String = providers.gradleProperty("ossrhPassword").getOrElse("")
val ossrhUsername: String = providers.gradleProperty("ossrhUsername").getOrElse("")
repositories {
mavenCentral()
}
plugins {
java
id("com.diffplug.spotless") version "6.23.3"
`java-library`
`maven-publish`
signing
}
group = mvnGroupId
version = mvnVersion
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
dependencies {
implementation("org.jetbrains:annotations:24.1.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.10.1")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.1")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.10.1")
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
groupId = mvnGroupId
artifactId = mvnArtifactId
version = mvnVersion
from(components["java"])
suppressPomMetadataWarningsFor("runtimeElements")
versionMapping {
}
pom {
name = mvnArtifactId
description = "Utilities for using Locks"
url = "https://github.com/wcarmon/lock-utils-jvm"
licenses {
license {
name = "MIT License"
url =
"https://raw.githubusercontent.com/wcarmon/lock-utils-jvm/main/LICENSE"
}
}
developers {
developer {
email = "github@wcarmon.com"
id = "wcarmon"
name = "Wil Carmon"
organization = ""
}
}
scm {
connection =
"scm:git:git@github.com:wcarmon/lock-utils-jvm.git"
developerConnection =
"scm:git:ssh://github.com:wcarmon/lock-utils-jvm.git"
url = "https://github.com/wcarmon/lock-utils-jvm/tree/main"
}
}
}
}
repositories {
maven {
// -- See ~/.gradle/gradle.properties
credentials {
username = ossrhUsername
password = ossrhPassword
}
val releasesRepoUrl =
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri(layout.buildDirectory.dir("repos/snapshots")) // TODO: fix
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl
else releasesRepoUrl // TODO: fix
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
configure<SpotlessExtension> {
java {
googleJavaFormat("1.18.1").aosp().reflowLongStrings()
importOrder()
removeUnusedImports()
target(
"src/*/java/**/*.java"
)
targetExclude(
"src/gen/**",
"src/genTest/**"
)
}
}