-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
131 lines (112 loc) Β· 2.66 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
}
plugins {
id 'java'
id "maven-publish"
id "com.jfrog.bintray" version "1.8.5"
id 'com.diffplug.gradle.spotless' version '4.3.0'
}
apply plugin: 'com.diffplug.gradle.spotless'
group 'uk.co.probablyfine'
version '0.2.0'
sourceCompatibility = 1.9
ext {
gitUrl = "https://github.com/mrwilson/java-working-days"
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
spotless {
java {
googleJavaFormat('1.7').aosp()
}
}
tasks.withType(Javadoc).all { enabled = false }
dependencies {
testImplementation group: 'junit', name: 'junit', version: '4.13'
}
artifacts {
archives sourcesJar
archives javadocJar
}
def pomConfig = {
developers {
developer {
id "probablyfine"
name 'Alex Wilson'
email "alex+java@probablyfine.co.uk"
}
}
licenses {
license {
name 'MIT'
url gitUrl + '/blob/master/LICENSE'
distribution 'repo'
}
}
scm {
url gitUrl
}
}
publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
groupId project.group
artifactId project.name
version project.version
pom.withXml {
def root = asNode()
root.appendNode('description', 'A small library to calculate working days between dates for multiple countries')
root.appendNode('name', project.name)
root.appendNode('url', gitUrl)
root.children().last() + pomConfig
}
}
}
}
bintray {
user = System.getProperty('bintray.user')
key = System.getProperty('bintray.key')
publications = ['mavenPublication']
pkg {
repo = project.group
name = project.name
licenses = ['MIT']
vcsUrl = gitUrl
version {
name = project.version
desc = project.version
released = new Date()
gpg {
sign = true
}
}
}
publish = true
}