-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
89 lines (80 loc) · 2.29 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
plugins {
`java-library`
`maven-publish`
signing
id("org.cadixdev.licenser") version "0.6.1"
}
repositories {
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.1")
}
java {
withJavadocJar()
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
license {
header.set(resources.text.fromFile("header.txt"))
include("**/*.java")
newLine.set(false)
}
tasks {
test {
useJUnitPlatform()
}
jar {
manifest {
attributes("Automatic-Module-Name" to "team.unnamed.inject")
}
}
}
val repositoryName: String by project
val snapshotRepository: String by project
val releaseRepository: String by project
publishing {
repositories {
maven {
val snapshot = project.version.toString().endsWith("-SNAPSHOT")
name = repositoryName
url = if (snapshot) { uri(snapshotRepository) } else { uri(releaseRepository) }
credentials(PasswordCredentials::class)
}
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set("Inject")
description.set("Lightweight and fast runtime dependency injection library for Java 8+")
url.set("https://github.com/unnamed/inject")
packaging = "jar"
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("yusshu")
name.set("Andre Roldan")
email.set("andre@unnamed.team")
}
}
scm {
connection.set("scm:git:git://github.com/unnamed/inject.git")
developerConnection.set("scm:git:ssh://github.com:unnamed/inject.git")
url.set("https://github.com/unnamed/inject")
}
}
}
}
}
signing {
sign(publishing.publications["maven"])
}