-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
108 lines (97 loc) · 3.07 KB
/
build.gradle
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
105
106
107
108
plugins {
id "java"
id "maven-publish"
id "com.timgroup.jarmangit" version "1.1.113"
}
ext {
description = 'Fittings for Logback to make it submit to external log rotation'
githubPath = 'tim-group/RotatableAppender'
url = "https://github.com/${githubPath}"
buildNumber = System.getenv('BUILD_NUMBER')
}
group = 'com.timgroup'
if (buildNumber) version = "1.0.${buildNumber}"
tasks.withType(Jar).configureEach {
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Implementation-Vendor": "TIM Group Ltd"
)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation "ch.qos.logback:logback-core:1.0.13"
testImplementation "junit:junit:4.12"
testImplementation "org.mockito:mockito-core:2.24.0"
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
options.encoding = "UTF-8"
options.incremental = true
options.deprecation = true
options.compilerArgs << "-parameters"
}
tasks.register("sourcesJar", Jar) {
dependsOn("classes")
classifier = 'sources'
from sourceSets.main.allSource
}
tasks.register("javadocJar", Jar) {
dependsOn("javadoc")
classifier = 'javadoc'
from javadoc.destinationDir
}
tasks.named("assemble").configure {
dependsOn("sourcesJar")
dependsOn("javadocJar")
}
publishing {
repositories {
if (project.hasProperty("repoUrl")) {
maven {
url "${project.repoUrl}/repositories/yd-release-candidates"
credentials {
username = project.repoUsername
password = project.repoPassword
}
}
}
}
publications {
mavenJava(MavenPublication) {
artifactId project.ext.has('artifactId') ? project.ext.artifactId
: project == rootProject ? project.name
: rootProject.name + project.path.replace(':', '-')
from components.java
artifact(tasks.sourcesJar)
artifact(tasks.javadocJar)
pom.withXml {
asNode().children().last() + {
resolveStrategy = DELEGATE_FIRST
name project.ext.has('pomName') ? project.ext.pomName : project.name
description project.description
url project.ext.url
licenses {
license {
name 'The BSD 2-Clause License'
url 'http://opensource.org/licenses/BSD-2-Clause'
distribution 'repo'
}
}
developers {
developer {
id 'steve.haslam@timgroup.com'
name 'Steve Haslam'
email 'steve.haslam@timgroup.com'
}
}
}
}
}
}
}