-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathbuild.gradle.kts
64 lines (53 loc) · 1.79 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
plugins {
id("com.github.sherter.google-java-format") version "0.9" apply false
}
allprojects {
group = "com.newrelic.telemetry"
repositories {
mavenCentral()
}
}
val release: String? by project
val junitVersion: String by project
val mockitoVersion: String by project
val newRelicTelemetry: String by project
subprojects {
version = if("true" == release) "${version}" else "${version}-SNAPSHOT"
apply(plugin = "java")
apply(plugin = "java-library")
apply(plugin = "maven-publish")
apply(plugin = "signing")
apply(plugin = "com.github.sherter.google-java-format")
dependencies {
"testImplementation"("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
"testImplementation"("org.mockito:mockito-inline:${mockitoVersion}")
"testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}
configure<JavaPluginExtension> {
withSourcesJar()
withJavadocJar()
disableAutoTargetJvm()
}
tasks.named<Test>("test") {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
tasks.named<Jar>("sourcesJar") {
archiveClassifier.set("sources")
}
configure<PublishingExtension> {
repositories {
maven {
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
url = if("true" == release) releasesRepoUrl else snapshotsRepoUrl
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
}
}