-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
104 lines (94 loc) · 3.11 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
plugins {
idea
`java-library`
`maven-publish`
signing
}
group = "org.komamitsu"
version = "1.0.0-SNAPSHOT"
base {
archivesBaseName = "phi-accrual-failure-detector"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
testImplementation("junit:junit:4.12")
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "phi-accrual-failure-detector"
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("phi-accrual-failure-detector")
description.set("A port of Akka's Phi Accrual Failure Detector")
url.set("https://github.com/komamitsu/phi-accrual-failure-detector")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("komamitsu")
name.set("Mitsunori Komatsu")
email.set("komamitsu@gmail.com")
}
}
scm {
connection.set("scm:git:git://github.com/komamitsu/phi-accrual-failure-detector.git")
developerConnection.set("scm:git:git@github.com:komamitsu/phi-accrual-failure-detector.git")
url.set("https://github.com/komamitsu/phi-accrual-failure-detector")
}
}
}
}
repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
val releasesRepoUrl = uri(layout.buildDirectory.dir("repos/releases"))
val snapshotsRepoUrl = uri(layout.buildDirectory.dir("repos/snapshots"))
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = if (project.hasProperty("ossrhUsername")) {
project.property("ossrhUsername").toString()
}
else {
""
}
password = if (project.hasProperty("ossrhPassword")) {
project.property("ossrhPassword").toString()
}
else {
""
}
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
setRequired(project.hasProperty("signing.gnupg.keyName"))
sign(configurations.archives.get())
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}