forked from pusher/pusher-websocket-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
188 lines (162 loc) · 4.54 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.ajoberstar:gradle-git:1.1.0'
}
}
def getProperty = { property ->
if (!project.hasProperty(property)) {
throw new GradleException("${property} property must be set")
}
return project.property(property)
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'org.ajoberstar.github-pages'
apply plugin: 'signing'
group = "com.pusher"
version = "2.0.0-SNAPSHOT"
sourceCompatibility = "1.6"
targetCompatibility = "1.6"
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 {
compile "com.google.code.gson:gson:2.2.2"
compile "com.pusher:java-websocket:1.4.1"
testCompile "org.mockito:mockito-all:1.8.5"
testCompile "org.powermock:powermock-module-junit4:1.4.11"
testCompile "org.powermock:powermock-api-mockito:1.4.11"
}
processResources {
filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: [
version: project.version
] )
}
javadoc {
/* info for JavaDoc options http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html#overviewcomment */
title "Pusher Java Websocket API"
options.overview = file("src/main/javadoc/overview.html")
// uncomment this to use the custom javadoc styles
//options.stylesheetFile = file("src/main/javadoc/css/styles.css")
exclude "**/com/pusher/client/channel/impl/*"
exclude "**/com/pusher/client/connection/impl/*"
exclude "**/com/pusher/client/connection/websocket/*"
exclude "**/org/java_websocket/*"
exclude "**/com/pusher/client/example/*"
options.linkSource = true
}
jar {
manifest = project.manifest {
from sharedManifest
}
}
task fatJar(type: Jar, dependsOn:configurations.runtime) {
manifest = project.manifest {
from sharedManifest
}
baseName = project.name + '-with-dependencies'
from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
classifier = 'jar-with-dependencies'
}
assemble.dependsOn fatJar
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
classifier = 'javadoc'
}
assemble.dependsOn sourcesJar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
classifier = 'sources'
}
assemble.dependsOn javadocJar
githubPages {
repoUri = 'https://github.com/pusher/pusher-websocket-java.git'
pages {
from javadoc.outputs.files
}
commitMessage = "JavaDoc gh-pages for ${version}"
credentials {
username = { getProperty("github.username") }
password = { getProperty("github.password") }
}
}
signing {
required { gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
artifacts {
archives jar, fatJar, sourcesJar, javadocJar
}
task createPublishTarget << {
uploadArchives { repositories { mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(
userName: getProperty("maven.username"),
password: getProperty("maven.password")
)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(
userName: getProperty("maven.username"),
password: getProperty("maven.password")
)
}
pom.project {
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-java-client'
scm {
connection 'scm:git:[email protected]:pusher/pusher-java-client'
developerConnection 'scm:git:[email protected]:pusher/pusher-java-client'
url 'http://github.com/pusher/pusher-java-client'
}
licenses {
license {
name 'MIT'
url 'https://raw.github.com/pusher/pusher-java-client/master/LICENCE.txt'
distribution 'https://raw.github.com/pusher/pusher-java-client/mvn-repo/'
}
}
organization {
name 'Pusher'
url 'http://pusher.com'
}
issueManagement {
system 'GitHub'
url 'https://github.com/pusher/pusher-java-client/issues'
}
developers {
developer {
id 'mike'
name 'Mike Pye'
email '[email protected]'
}
}
}
}}}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
}