-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.gradle
166 lines (145 loc) · 4.41 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
157
158
159
160
161
162
163
164
165
166
import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.ajoberstar:gradle-git:1.1.0'
}
}
plugins {
id 'java-library'
id 'maven-publish'
id "signing"
id "org.ajoberstar.github-pages" version "1.7.2"
}
def getProperty = { property ->
if (!project.hasProperty(property)) {
throw new GradleException("${property} property must be set")
}
return project.property(property)
}
repositories {
mavenCentral()
}
group = "com.pusher"
version = "1.3.3"
description = "Pusher HTTP Client"
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
ext.sharedManifest = manifest {
attributes(
'Created-By': 'Pusher',
'Implementation-Vendor': 'Pusher',
'Implementation-Title': 'Pusher HTTP Java',
'Implementation-Version': version
)
}
dependencies {
implementation 'org.apache.httpcomponents:httpclient:4.5.13'
implementation 'org.asynchttpclient:async-http-client:2.12.3'
implementation 'com.google.code.gson:gson:2.8.9'
testImplementation 'org.apache.httpcomponents:httpclient:4.5.13'
testImplementation 'org.hamcrest:hamcrest-all:1.3'
testImplementation 'org.jmock:jmock-junit5:2.12.0'
testImplementation 'org.jmock:jmock-imposters:2.12.0'
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
}
processResources {
filter(ReplaceTokens, tokens: [
version: project.version
])
}
javadoc {
title "Pusher HTTP Java"
options.linkSource = true
}
jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest = project.manifest {
from sharedManifest
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
assemble.dependsOn sourcesJar
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
assemble.dependsOn javadocJar
artifacts {
archives jar, sourcesJar, javadocJar
}
java {
withSourcesJar()
withJavadocJar()
}
githubPages {
repoUri = 'https://github.com/pusher/pusher-http-java.git'
pages {
from javadoc.outputs.files
}
commitMessage = "JavaDoc gh-pages for ${version}"
credentials {
username = { getProperty("github.username") }
password = { getProperty("github.password") }
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'pusher-http-java'
from components.java
pom {
name = 'Pusher HTTP Client'
packaging = 'jar'
artifactId = 'pusher-java-client'
description = "This is a Java library for interacting with Pusher.com's HTTP API."
url = 'http://github.com/pusher/pusher-http-java'
scm {
connection = 'scm:git:git@github.com:pusher/pusher-http-java'
developerConnection = 'scm:git:git@github.com:pusher/pusher-http-java'
url = 'http://github.com/pusher/pusher-http-java'
}
licenses {
license {
name = 'MIT'
url = 'https://raw.github.com/pusher/pusher-http-java/master/LICENCE.txt'
distribution = 'https://raw.github.com/pusher/pusher-http-java/mvn-repo/'
}
}
organization {
name = 'Pusher'
url = 'http://pusher.com'
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/pusher/pusher-http-java/issues'
}
}
}
}
repositories {
maven {
def releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith("SNAPSHOT") ? snapshotRepositoryUrl : releaseRepositoryUrl
credentials {
username = findProperty("maven.username") ?: ""
password = findProperty("maven.password") ?: ""
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
}