-
Notifications
You must be signed in to change notification settings - Fork 219
/
build.gradle.kts
103 lines (91 loc) · 3.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
import org.jreleaser.gradle.plugin.JReleaserExtension
import org.jreleaser.model.Active
/*
* Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
plugins {
java
alias(libs.plugins.jreleaser) apply false
}
// Load the Smithy version from VERSION.
val libraryVersion = project.file("VERSION").readText().trim()
println("Smithy version: '$libraryVersion'")
allprojects {
group = "software.amazon.smithy"
version = libraryVersion
}
// Consolidated Javadoc creation
afterEvaluate {
tasks {
javadoc {
title = "Smithy API ${version}"
setDestinationDir(layout.buildDirectory.dir("docs/javadoc/latest").get().asFile)
source(subprojects.map { project(it.path).sourceSets.main.get().allJava })
classpath = files(subprojects.map { project(it.path).sourceSets.main.get().compileClasspath })
(options as StandardJavadocDocletOptions).apply {
addStringOption("Xdoclint:-html", "-quiet")
// Fixed in JDK 12: https://bugs.openjdk.java.net/browse/JDK-8215291
// --no-module-directories does not exist in JDK 8 and is removed in 13
if (JavaVersion.current().run { isJava9 || isJava10 || isJava11 }) {
addBooleanOption("-no-module-directories", true)
}
}
}
}
}
// We're using JReleaser in the smithy-cli subproject, so we want to have a flag to control
// which JReleaser configuration to use to prevent conflicts
if (project.hasProperty("release.main")) {
apply(plugin = "org.jreleaser")
// Workaround for https://github.com/jreleaser/jreleaser/issues/1492
tasks.register("clean")
configure<JReleaserExtension> {
dryrun = false
// Used for creating and pushing the version tag, but this configuration ensures that
// an actual GitHub release isn't created (since the CLI release does that)
release {
github {
skipRelease = true
tagName = "{{projectVersion}}"
}
}
// Used to announce a release to configured announcers.
// https://jreleaser.org/guide/latest/reference/announce/index.html
announce {
active = Active.NEVER
}
// Signing configuration.
// https://jreleaser.org/guide/latest/reference/signing.html
signing {
active = Active.ALWAYS
armored = true
}
// Configuration for deploying to Maven Central.
// https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_gradle
deploy {
maven {
nexus2 {
create("maven-central") {
active = Active.ALWAYS
url = "https://aws.oss.sonatype.org/service/local"
snapshotUrl = "https://aws.oss.sonatype.org/content/repositories/snapshots"
closeRepository = true
releaseRepository = true
stagingRepository(stagingDir().get().asFile.path)
}
}
}
}
}
}