-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
136 lines (118 loc) · 3.47 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
132
133
134
135
136
plugins {
id "com.jfrog.bintray" version "1.5"
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'jacoco'
sourceCompatibility = 1.8
def baseVersion = "2.0"
def travisBuildNumber = System.getenv('TRAVIS_BUILD_NUMBER')
version = travisBuildNumber != null ? baseVersion + "." + travisBuildNumber : baseVersion
println 'Version: ' + version
group = 'com.jnericks'
repositories {
mavenCentral()
}
apply plugin: 'groovy'
jar {
from "LICENSE.md"
}
dependencies {
compile "com.google.guava:guava:22.0"
compile "junit:junit:4.12"
compile "org.assertj:assertj-core:3.8.0"
compile "org.mockito:mockito-core:2.8.47"
testCompile "junit:junit:4.12"
testCompile "org.assertj:assertj-core:3.8.0"
testCompile "org.mockito:mockito-core:2.8.47"
}
task sourcesJar(type: Jar) {
dependsOn classes
classifier 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
publishTestLibJava(MavenPublication) {
version version
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name 'TestLib-Java'
description 'Base Test Library for Java 8 Projects'
url "https://github.com/jnericks/testlib-java"
scm {
url "https://github.com/jnericks/testlib-java"
connection "https://github.com/jnericks/testlib-java"
developerConnection "https://github.com/jnericks/testlib-java"
}
licenses {
license {
name 'MIT'
url 'https://github.com/jnericks/testlib-java/blob/master/LICENSE.md'
distribution 'repo'
}
}
developers {
developer {
id 'jnericks'
name 'Jon Erickson'
}
}
}
}
}
}
}
bintray {
user = System.env.BINTRAY_USER ?: project["bintray.user"]
key = System.env.BINTRAY_API_KEY ?: project["bintray.key"]
publications = ['publishTestLibJava']
publish = true
pkg {
repo = 'testlib-java'
name = 'testlib-java'
desc = 'Base Test Library for Java 8 Projects'
userOrg = user
licenses = ['MIT']
vcsUrl = 'https://github.com/jnericks/testlib-java'
labels = ['test']
publicDownloadNumbers = true
version {
gpg {
sign = true
}
}
}
}
jacocoTestReport {
group = "reporting"
description = "Generate Jacoco coverage reports after running tests."
additionalSourceDirs = files(sourceSets.main.allSource)
reports {
xml.enabled true
html.enabled true
csv.enabled false
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.0.1'
}
test.finalizedBy jacocoTestReport