-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
156 lines (130 loc) · 4.14 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
148
149
150
151
152
153
154
155
156
buildscript {
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
google()
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath 'ch.raffael.pegdown-doclet:pegdown-doclet:1.2.1'
}
}
plugins {
id "java"
id "signing"
id "maven-publish"
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id "com.diffplug.spotless" version "5.12.5"
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.gocardless'
version = '6.0.0'
apply plugin: 'ch.raffael.pegdown-doclet'
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
google()
maven {
url 'https://maven.google.com'
}
}
dependencies {
implementation("com.squareup.okhttp3:okhttp:4.9.1")
implementation 'com.google.code.gson:gson:2.8.7'
implementation("com.google.guava:guava:30.1.1-jre")
implementation 'org.slf4j:slf4j-api:1.7.32'
implementation 'commons-codec:commons-codec:1.15'
implementation('com.github.rholder:guava-retrying:2.0.0') {
exclude group: 'com.google.guava', module: 'guava'
}
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.assertj:assertj-core:3.19.0'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.1'
}
javadoc {
options.memberLevel = JavadocMemberLevel.PUBLIC
options.noTimestamp = true
options.links = [
'http://docs.oracle.com/javase/8/docs/api/'
]
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from tasks.javadoc.destinationDir
classifier = 'javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId 'com.gocardless'
artifactId 'gocardless-pro'
from components.java
artifacts = [jar, javadocJar, sourcesJar]
pom {
name.set('GoCardless Client')
packaging 'jar'
description.set('Client library for accessing the GoCardless API')
url.set('http://developer.gocardless.com/')
scm {
url.set('scm:[email protected]:gocardless/gocardless-pro-java.git')
connection.set('scm:[email protected]:gocardless/gocardless-pro-java.git')
developerConnection.set('scm:[email protected]:gocardless/gocardless-pro-java.git')
}
licenses {
license {
name.set('MIT')
url.set('http://www.opensource.org/licenses/mit-license.php')
distribution.set('repo')
}
}
developers {
developer {
name.set('GoCardless Ltd')
email.set('[email protected]')
}
}
}
}
}
repositories {
maven {
name = "OSSRH"
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
nexusPublishing {
repositories {
sonatype {
//only for users registered in Sonatype after 24 Feb 2021
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
spotless {
java {
importOrder()
removeUnusedImports()
eclipse().configFile("format.xml")
}
}