-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
104 lines (96 loc) · 3.33 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
plugins {
id("com.timgroup.jarmangit") version "1.1.117"
}
allprojects {
group = "com.timgroup"
if (System.getenv("BUILD_NUMBER") != null) version = "1.0.${System.getenv("BUILD_NUMBER")}"
}
subprojects {
apply(plugin = "java-library")
apply(plugin = "com.timgroup.jarmangit")
apply(plugin = "maven-publish")
tasks.withType<Jar> {
manifest {
attributes(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
"Implementation-Vendor" to "TIM Group Ltd"
)
}
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.isIncremental = true
options.isDeprecation = true
options.compilerArgs.add("-parameters")
}
repositories {
mavenCentral()
}
the<JavaPluginExtension>().apply {
withJavadocJar()
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
afterEvaluate {
val javaModuleName: String? by project
if (javaModuleName != null) {
tasks.named<Jar>("jar") {
manifest {
attributes(
"Automatic-Module-Name" to javaModuleName
)
}
}
}
}
the<PublishingExtension>().apply {
repositories {
val repoUrl: String? by project
if (repoUrl != null) {
val repoUsername: String by project
val repoPassword: String by project
maven(url = "${repoUrl}/repositories/yd-release-candidates") {
credentials {
username = repoUsername
password = repoPassword
}
}
}
}
afterEvaluate {
publications {
val artifactId: String? by project.ext
register<MavenPublication>("mavenJava") {
this.artifactId = when {
artifactId != null -> artifactId
project == rootProject -> project.name
else -> rootProject.name + project.path.replace(':', '-')
}
from(components["java"])
val pomName: String? by project
pom {
name.set(pomName ?: project.name)
description.set(project.description)
url.set("http://github.com/tim-group/clocks")
licenses {
license {
name.set("The BSD 2-Clause License")
url.set("http://opensource.org/licenses/BSD-2-Clause")
distribution.set("repo")
}
}
developers {
developer {
id.set("steve.haslam@timgroup.com")
name.set("Steve Haslam")
email.set("steve.haslam@timgroup.com")
}
}
}
}
}
}
}
}