-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
147 lines (124 loc) · 3.38 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
137
138
139
140
141
142
143
144
145
146
147
plugins {
id 'java'
id 'findbugs'
id 'pmd'
id 'jacoco'
id 'signing'
id 'maven'
}
/*** Project Properties ***/
/*
* Notes
* ===================================================
* 1) Project.name is already reserved for the name of
* the project directory. Thus adding an extra
* property, ext.name, for project name.
* 2) By default, version number has the "-SNAPSHOT"
* suffix. The "-SNAPSHOT" suffix is required for
* for publishing to the snapshot repo. To publish
* to the staging repo, set the staging property
* to "true".
*/
group = 'org.computelab'
ext.name = 'config'
version = '0.2.1'
version = staging ? version : version + '-SNAPSHOT'
/*** Java ***/
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.code.gson:gson:' + gson
compile 'com.google.guava:guava:' + guava
// Logging
compile 'org.slf4j:slf4j-api:' + slf4j
// Testing
testCompile 'junit:junit:' + junit
testCompile 'org.mockito:mockito-core:' + mockito
testCompile 'org.apache.commons:commons-lang3:' + commons
testRuntime 'ch.qos.logback:logback-core:' + logback
testRuntime 'ch.qos.logback:logback-classic:' + logback
}
jar {
group = project.group
baseName = project.ext.name
version = project.version
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
/*** Code Quality Tools ***/
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
tasks.withType(Pmd) {
reports {
xml.enabled = false
html.enabled = true
}
}
jacocoTestReport {
reports {
xml.enabled = true
}
}
/*** Signing ***/
signing {
sign configurations.archives
}
/*** Maven Publishing ***/
ext.stagingRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
ext.snapshotRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
repository(url: project.ext.stagingRepoUrl) {
authentication(
userName: "${System.env.OSSRH_USR}",
password: "${System.env.OSSRH_PWD}"
)
}
snapshotRepository(url: project.ext.snapshotRepoUrl) {
authentication(
userName: "${System.env.OSSRH_USR}",
password: "${System.env.OSSRH_PWD}"
)
}
pom.project {
name 'config'
description 'Configuration in plain Java'
url 'https://github.com/computelab/config'
scm {
url 'https://github.com/computelab/config.git'
}
licenses {
license {
name 'The MIT License'
url 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'neurite'
}
}
}
}
}
}