-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
115 lines (96 loc) · 3.09 KB
/
build.gradle.kts
File metadata and controls
115 lines (96 loc) · 3.09 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
import java.time.Duration
import org.gradle.external.javadoc.CoreJavadocOptions
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
}
plugins { // see Dependencies.kt in buildSrc
Libs.javaBuiltInGradlePlugins.forEach { id(it) }
Libs.javaExtGradlePlugins.forEach { (n, v) -> id(n) version v }
}
repositories {
mavenLocal()
// Before LaunchDarkly release artifacts get synced to Maven Central they are here along with snapshots:
maven { url = uri("https://oss.sonatype.org/content/groups/public/") }
mavenCentral()
}
configurations.all {
// check for updates every build for dependencies with: 'changing: true'
resolutionStrategy.cacheChangingModulesFor(0, "seconds")
}
base {
group = ProjectValues.groupId
archivesBaseName = ProjectValues.artifactId
version = version
}
java {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies { // see Dependencies.kt in buildSrc
Libs.implementation.forEach { implementation(it) }
Libs.javaTestImplementation.forEach { testImplementation(it) }
}
checkstyle {
toolVersion = "9.3"
configFile = file("${project.rootDir}/checkstyle.xml")
}
tasks.checkstyleMain {
// Exclude embedded nanohttpd code from checkstyle
exclude("com/launchdarkly/testhelpers/httptest/nanohttpd/**")
}
tasks.jar {
manifest {
attributes(mapOf("Implementation-Version" to project.version))
}
// Include NOTICE file in binary distribution
from(".") {
include("NOTICE")
into("META-INF")
}
// Include nanohttpd license in binary distribution per BSD 3-Clause requirements
from("src/main/java/com/launchdarkly/testhelpers/httptest/nanohttpd") {
include("LICENSE.md")
into("META-INF/licenses/nanohttpd")
}
}
tasks.javadoc {
// Force the Javadoc build to fail if there are any Javadoc warnings.
(options as CoreJavadocOptions).addStringOption("Xwerror")
// Exclude embedded nanohttpd code from Javadoc generation
exclude("com/launchdarkly/testhelpers/httptest/nanohttpd/**")
}
helpers.Test.configureTask(tasks.compileTestJava, tasks.test, configurations["testRuntimeClasspath"])
helpers.Jacoco.configureTasks(
tasks.jacocoTestReport,
tasks.jacocoTestCoverageVerification
)
helpers.Idea.configure(idea)
publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
helpers.Pom.standardPom(pom) // see Pom.kt in buildSrc
}
}
repositories {
mavenLocal()
}
}
nexusPublishing {
clientTimeout.set(Duration.ofMinutes(2)) // we've seen extremely long delays in creating repositories
repositories {
sonatype{
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}
signing {
setRequired({ findProperty("skipSigning") != "true" })
sign(publishing.publications["mavenJava"])
}