This repository has been archived by the owner on Apr 26, 2022. It is now read-only.
forked from GlenKPeterson/TestUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
164 lines (145 loc) · 5.22 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Deploying to OSSRH with Gradle
// https://central.sonatype.org/pages/gradle.html
// https://github.com/gradle-nexus/publish-plugin
// Did you update version number here AND in the README?
// This is different from other projects because it is TEST SCOPED.
// To find out if any dependencies need upgrades:
// gradle --refresh-dependencies dependencyUpdates
// To publish to maven local:
// gradle --warning-mode all clean assemble dokkaJar publishToMavenLocal
// To publish to Sonatype (do the maven local above first):
// gradle --warning-mode all clean assemble dokkaJar publishToSonatype closeAndReleaseSonatypeStagingRepository
// If half-deployed, sign in here:
// https://oss.sonatype.org
// Click on "Staging Repositories"
// Open the "Content" for the latest one you uploaded.
// If it looks good, "Close" it and wait.
// When it's really "closed" with no errors, "Release" (and automatically drop) it.
//
// Alternatively, if you can see it here, then it's ready to be "Closed" and deployed manually:
// https://oss.sonatype.org/content/groups/staging/org/organicdesign/TestUtils/
// Here once released:
// https://repo1.maven.org/maven2/org/organicdesign/TestUtils/
// https://docs.gradle.org/current/userguide/build_environment.html
// You must have the following set in ~/.gradle/gradle.properties
// sonatypeUsername=
// sonatypePassword=
//
// At least while dokka crashes the gradle daemon you also want:
// org.gradle.daemon=false
// Or run with --no-daemon
plugins {
`maven-publish`
signing
id("com.github.ben-manes.versions") version "0.42.0"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.jetbrains.dokka") version "1.6.10"
kotlin("jvm") version "1.6.10"
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.organicdesign:Indented:0.1.1")
implementation("jakarta.servlet:jakarta.servlet-api:5.0.0")
// This was so tied together there was no reasonable way to unpick it.
// Copied 2 classes from jetty-server.
// Next step down is to copy maybe 5 classes from jetty-http and include only jetty-util?
// Jetty-util has some nice UTF8 StringBuilder stuff.
implementation("org.eclipse.jetty:jetty-http:11.0.8")
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
// testImplementation("org.slf4j:slf4j-simple:2.0.0-alpha5")
}
group = "org.organicdesign"
version = "2.0.3"
description = "Utilities for testing common Java contracts: equals(), hashCode(), and compareTo()"
java {
// withJavadocJar()
withSourcesJar()
}
tasks.test {
useJUnitPlatform()
}
tasks.register<Jar>("dokkaJar") {
archiveClassifier.set("javadoc")
dependsOn("dokkaJavadoc")
from("$buildDir/dokka/javadoc")
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
afterEvaluate {
artifactId = tasks.jar.get().archiveBaseName.get()
}
artifact(tasks["dokkaJar"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
// artifact(tasks["dokkaJar"])
pom {
name.set(rootProject.name)
packaging = "jar"
description.set(project.description)
url.set("https://github.com/GlenKPeterson/TestUtils")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("https://apache.org/licenses/LICENSE-2.0.txt")
}
license {
name.set("The Eclipse Public License v. 2.0")
url.set("https://eclipse.org/legal/epl-2.0")
}
}
developers {
developer {
id.set("GlenKPeterson")
name.set("Glen K. Peterson")
email.set("[email protected]")
organization.set("PlanBase Inc.")
}
}
scm {
connection.set("scm:git:https://github.com/GlenKPeterson/TestUtils.git")
developerConnection.set("scm:git:https://github.com/GlenKPeterson/TestUtils.git")
url.set("https://github.com/GlenKPeterson/TestUtils.git")
}
}
}
}
}
nexusPublishing {
repositories {
sonatype()
}
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
signing {
useGpgCmd()
sign(publishing.publications["mavenJava"])
}
tasks.compileJava {
options.encoding = "UTF-8"
}
repositories {
mavenLocal()
mavenCentral()
maven(url="https://jitpack.io")
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "11"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "11"
}