-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
85 lines (74 loc) · 2.49 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
fun property(key: String) = project.findProperty(key).toString()
fun depVersion(name: String) = property("dependency.$name.version")
plugins {
id("java")
id("maven-publish")
}
val projectName = property("name")
group = property("group")
version = property("version")
repositories {
mavenCentral()
}
dependencies {
implementation(group = "org.jetbrains", name = "annotations", version = depVersion("annotations"))
testImplementation(group = "org.junit.jupiter", name = "junit-jupiter-api", version = depVersion("junit"))
testRuntimeOnly(group = "org.junit.jupiter", name = "junit-jupiter-engine")
}
tasks.test {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(16))
}
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = projectName
from(components["java"])
pom {
name.set(projectName)
url.set("https://github.com/Harleyoc1/${projectName}")
licenses {
license {
name.set("MIT")
url.set("https://mit-license.org")
}
}
developers {
developer {
id.set("Harleyoc1")
name.set("Harley O'Connor")
email.set("[email protected]")
}
developer {
id.set("ArchieAdams")
name.set("Archie Adams")
}
}
scm {
connection.set("scm:git:git://github.com/Harleyoc1/${projectName}.git")
developerConnection.set("scm:git:ssh://github.com/Harleyoc1/${projectName}.git")
url.set("https://github.com/Harleyoc1/${projectName}")
}
}
}
}
if (hasProperty("harleyOConnorMavenUsername") && hasProperty("harleyOConnorMavenPassword")) {
repositories {
maven {
url = uri("https://harleyoconnor.com/maven")
credentials {
username = property("harleyOConnorMavenUsername")
password = property("harleyOConnorMavenPassword")
}
}
}
} else {
logger.log(LogLevel.WARN, "Credentials for maven not detected; it will be disabled.")
}
}