-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
161 lines (141 loc) · 4.63 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
import java.util.Properties
plugins {
id("org.asciidoctor.jvm.convert").version("3.3.2")
id("io.github.gradle-nexus.publish-plugin").version("1.1.0")
}
repositories {
mavenCentral()
}
nexusPublishing {
repositories {
sonatype {
username.set(System.getenv("OSSRH_USER") ?: return@sonatype)
password.set(System.getenv("OSSRH_PASSWORD") ?: return@sonatype)
}
}
}
configure(
subprojects
- project(":dynamo")
- project(":s3")
- project(":kinesis")
- project(":sns")
- project(":sqs")
- project(":ses")
) {
apply<JavaLibraryPlugin>()
apply<JacocoPlugin>()
apply<SigningPlugin>()
apply<MavenPublishPlugin>()
repositories {
mavenCentral()
}
dependencies {
val api by configurations
val testImplementation by configurations
val testRuntimeOnly by configurations
api(platform("org.junit:junit-bom:5.7.1"))
api("org.junit.jupiter:junit-jupiter-api")
testImplementation(platform("org.junit:junit-bom:5.7.1"))
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testRuntimeOnly(platform("org.junit:junit-bom:5.7.1"))
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}
configure<JavaPluginExtension> {
withJavadocJar()
withSourcesJar()
}
configure<SigningExtension> {
val key = System.getenv("SIGNING_KEY") ?: return@configure
val password = System.getenv("SIGNING_PASSWORD") ?: return@configure
val publishing: PublishingExtension by project
useInMemoryPgpKeys(key, password)
sign(publishing.publications)
}
configure<PublishingExtension> {
publications {
val main by creating(MavenPublication::class) {
from(components["java"])
versionMapping {
allVariants {
fromResolutionResult()
}
}
pom {
name.set("aws-junit5 :: ${project.name}")
description.set("aws-junit5 :: ${project.name}")
url.set("https://github.com/madhead/aws-junit5")
licenses {
license {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("madhead")
name.set("Siarhei Krukau")
email.set("siarhei.krukau@gmail.com")
}
}
scm {
connection.set("scm:git:git@github.com:madhead/aws-junit5.git")
url.set("https://github.com/madhead/aws-junit5")
}
}
}
}
}
configure<JacocoPluginExtension> {
toolVersion = "0.8.7"
}
tasks {
withType<Test> {
systemProperties = Properties().apply {
load(File(rootDir, ".github/workflows/test.sys").bufferedReader())
}.mapKeys { entry -> entry.key.toString() }
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}
withType<JacocoReport> {
reports {
xml.isEnabled = true
html.isEnabled = true
}
}
}
}
tasks {
register<Javadoc>("javadocs") {
group = "Documentation"
destinationDir = file("$buildDir/docs/javadoc")
title = project.name
with(options as StandardJavadocDocletOptions) {
links = listOf(
"https://docs.oracle.com/javase/8/docs/api/",
"https://junit.org/junit5/docs/current/api/",
"https://sdk.amazonaws.com/java/api/latest/",
"https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/"
)
}
subprojects.forEach { subproject ->
subproject.tasks.withType<Javadoc>().forEach { task ->
source += task.source
classpath += task.classpath
includes += task.includes
excludes += task.excludes
}
}
}
asciidoctor {
setSourceDir(file("docs"))
sources {
include("index.adoc")
}
setOutputDir(file("$buildDir/docs/asciidoc"))
setBaseDir(file("docs"))
}
}