This repository has been archived by the owner on May 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle.kts
104 lines (84 loc) · 2.71 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
import java.time.Duration
// These values come from gradle.properties
val ossrhUsername: String by project
val ossrhPassword: String by project
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_7
targetCompatibility = JavaVersion.VERSION_1_7
}
// See Dependencies.kt in buildSrc for the purpose of "privateImplementation"
val privateImplementation by configurations.creating
dependencies { // see Dependencies.kt in buildSrc
Libs.privateImplementation.forEach { privateImplementation(it)}
Libs.javaTestImplementation.forEach { testImplementation(it) }
}
checkstyle {
toolVersion = "9.3"
configFile = file("${project.rootDir}/checkstyle.xml")
}
tasks.compileJava {
// See note in Dependencies.kt in buildSrc on "privateImplementation"
classpath = configurations["privateImplementation"]
}
helpers.Javadoc.configureTask(tasks.javadoc, configurations["privateImplementation"]) // see Javadoc.kt in buildSrc
helpers.Test.configureTask(tasks.compileTestJava, tasks.test,
configurations["privateImplementation"]) // see Test.kt in buildSrc
helpers.Jacoco.configureTasks( // see Jacoco.kt in buildSrc
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()
}
}
nexusStaging {
packageGroup = ProjectValues.groupId
numberOfRetries = 40 // we've seen extremely long delays in closing repositories
}
nexusPublishing {
clientTimeout.set(Duration.ofMinutes(2)) // we've seen extremely long delays in creating repositories
repositories {
sonatype {
username.set(ossrhUsername)
password.set(ossrhPassword)
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}