-
Notifications
You must be signed in to change notification settings - Fork 40
/
build.gradle
127 lines (104 loc) · 3.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
plugins {
id 'java'
id 'maven'
id 'org.unbroken-dome.test-sets' version '1.3.2'
id 'com.diffplug.gradle.spotless' version '3.3.0'
id 'signing'
id 'io.codearte.nexus-staging' version '0.9.0'
id 'net.researchgate.release' version '2.4.0'
}
group = 'com.appnexus.grafana-client'
description = """A simple java client for interacting with Grafana using a fluent interface"""
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
jcenter()
mavenLocal()
mavenCentral()
}
ext {
junitVersion = '4.12'
jacksonVersion = '2.8.8'
lombokVersion = '1.16.14'
retrofitVersion = '2.2.0'
}
def ossrhUsername=project.properties['ossrhUsername'] ?: ''
def ossrhPassword=project.properties['ossrhPassword'] ?: ''
testSets {
integrationTest { dirName = 'integration-test' }
}
dependencies {
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: jacksonVersion
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: jacksonVersion
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion
compile group: 'com.squareup.retrofit2', name: 'retrofit', version: retrofitVersion
compile group: 'com.squareup.retrofit2', name: 'converter-jackson', version: retrofitVersion
compileOnly group: 'org.projectlombok', name: 'lombok', version: lombokVersion
testCompile group: 'junit', name: 'junit', version: junitVersion
}
task sourceJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
if (project.hasProperty('signing.keyId')) {
signing {
sign configurations.archives
}
}
artifacts {
archives javadocJar, sourceJar
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name project.name
packaging 'jar'
description project.description
url 'https://github.com/appnexus/grafana-api-java-client'
scm {
connection 'scm:git:https://github.com/appnexus/grafana-api-java-client.git'
developerConnection 'scm:git:git@github.com:appnexus/grafana-api-java-client.git'
url 'https://github.com/appnexus/grafana-api-java-client.git'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'stevesample'
name 'Steve Sample'
email 'steve.sample22@gmail.com'
}
}
}
}
}
}
nexusStaging {
username = ossrhUsername
password = ossrhPassword
packageGroup = 'com.appnexus'
}
spotless {
java {
googleJavaFormat()
licenseHeader '/* Licensed under Apache-2.0 */'
}
}
closeRepository.dependsOn uploadArchives
afterReleaseBuild.dependsOn closeAndReleaseRepository