-
Notifications
You must be signed in to change notification settings - Fork 139
Expand file tree
/
Copy pathbuild.gradle
More file actions
165 lines (147 loc) · 4.79 KB
/
Copy pathbuild.gradle
File metadata and controls
165 lines (147 loc) · 4.79 KB
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
plugins {
id "eclipse"
id "jacoco"
id "java-library"
id "maven-publish"
}
group = "com.pusher"
version = "2.4.5"
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
ext.sharedManifest = manifest {
attributes(
'Created-By': 'Pusher',
'Implementation-Vendor': 'Pusher',
'Implementation-Title': 'Pusher Java Websocket API Example',
'Implementation-Version': version,
'Package': 'com.pusher.client.example',
'Main-Class': 'com.pusher.client.example.ExampleApp'
)
}
repositories {
mavenCentral()
}
dependencies {
implementation "com.google.code.gson:gson:2.9.1"
implementation "org.java-websocket:Java-WebSocket:1.5.3"
testImplementation "org.mockito:mockito-all:1.8.5"
testImplementation "org.powermock:powermock-module-junit4:1.4.11"
testImplementation "org.powermock:powermock-api-mockito:1.4.11"
testImplementation "com.google.truth:truth:1.0.1"
}
import org.apache.tools.ant.filters.ReplaceTokens
processResources {
filter(ReplaceTokens, tokens: [
version: project.version
])
}
javadoc {
title "Pusher Java Websocket API"
options.overview = file("src/main/javadoc/overview.html")
exclude "com/pusher/client/channel/impl/*"
exclude "com/pusher/client/connection/impl/*"
exclude "com/pusher/client/connection/websocket/*"
exclude "com/pusher/client/crypto/nacl/*"
exclude "com/pusher/client/util/internal/*"
exclude "org/java_websocket/*"
exclude "com/pusher/client/example/*"
options.linkSource = true
}
jar {
manifest = project.manifest {
from sharedManifest
}
}
task fatJar(type: Jar, dependsOn: configurations.runtimeClasspath) {
manifest = project.manifest {
from sharedManifest
}
archiveBaseName.set(project.name + '-with-dependencies')
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
archiveClassifier.set('jar-with-dependencies')
}
assemble.dependsOn fatJar
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, fatJar, sourcesJar, javadocJar
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'pusher-java-client'
from components.java
pom {
name = 'Pusher Java Client Library'
packaging = 'jar'
artifactId = 'pusher-java-client'
description = 'This is a Java client library for Pusher, targeted at core Java and Android.'
url = 'http://github.com/pusher/pusher-websocket-java'
scm {
connection = 'scm:git:git@github.com:pusher/pusher-websocket-java'
developerConnection = 'scm:git:git@github.com:pusher/pusher-websocket-java'
url = 'http://github.com/pusher/pusher-websocket-java'
}
licenses {
license {
name = 'MIT'
url = 'https://raw.github.com/pusher/pusher-websocket-java/master/LICENCE.txt'
distribution = 'https://raw.github.com/pusher/pusher-websocket-java/mvn-repo/'
}
}
organization {
name = 'Pusher'
url = 'http://pusher.com'
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/pusher/pusher-websocket-java/issues'
}
developers {
developer {
id = 'mike'
name = 'Mike Pye'
email = 'mike@pusher.com'
}
}
}
}
}
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") ?: ""
}
}
}
}
jacoco {
toolVersion = "0.8.8"
}
jacocoTestReport {
reports.xml.required = true
reports.html.required = false
reports.csv.required = false
}
test {
testLogging {
showStandardStreams = true
}
}