Skip to content

Commit 147a11b

Browse files
Added maven central
Change-Id: I2f2f55275325de01cfb528cbcc414f6815aef382
1 parent ec0c508 commit 147a11b

4 files changed

Lines changed: 159 additions & 56 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ proguard-project.txt
3939
#Gradle
4040
.gradle
4141
build
42+
gradle.properties
4243

4344
#Secrets
4445
credentials.properties

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ Imperative example:
110110
```bash
111111
./gradlew :websockets-example:installDebug
112112
```
113+
114+
## How to add to your project
115+
116+
to your gradle file:
117+
118+
```groovy
119+
compile "com.appunite:websockets-java:2.0.0"
120+
compile "com.appunite:websockets-rxjava:2.0.0"
121+
```
113122
114123
## License
115124

websockets-rxjava/build.gradle

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,100 @@ buildscript {
88
}
99

1010
apply plugin: 'java'
11+
apply plugin: 'maven'
12+
apply plugin: 'signing'
1113

1214
repositories {
1315
mavenCentral()
14-
maven { url 'https://commondatastorage.googleapis.com/maven-repository/' }
1516
}
1617

1718
dependencies {
1819
compile project(":websockets")
1920
compile "io.reactivex:rxjava:1.0.9"
2021
compile "com.google.code.gson:gson:2.3"
21-
//compile "com.appunite:websockets:1.0"
22+
//compile "com.appunite:websockets-java:2.0.0"
2223

2324
testCompile "org.hamcrest:hamcrest-all:1.3"
2425
testCompile 'junit:junit:4.11'
2526
testCompile 'org.mockito:mockito-all:1.9.5'
2627
testCompile 'com.google.truth:truth:0.25'
28+
}
29+
30+
task javadocJar(type: Jar) {
31+
classifier = 'javadoc'
32+
from javadoc
33+
}
34+
35+
task sourcesJar(type: Jar) {
36+
classifier = 'sources'
37+
from sourceSets.main.allSource
38+
}
39+
40+
artifacts {
41+
archives javadocJar, sourcesJar
42+
}
43+
44+
signing {
45+
sign configurations.archives
46+
}
47+
group = "com.appunite"
48+
archivesBaseName = "websockets-rxjava"
49+
version = "2.0.0"
50+
51+
if (!project.hasProperty("ossrhUsername")) {
52+
project.ext.setProperty("ossrhUsername", null)
53+
}
54+
if (!project.hasProperty("ossrhPassword")) {
55+
project.ext.setProperty("ossrhPassword", null)
56+
}
57+
58+
uploadArchives {
59+
repositories {
60+
mavenDeployer {
61+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
62+
63+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
64+
authentication(
65+
userName: project.ext.getProperty("ossrhUsername"),
66+
password: project.ext.getProperty("ossrhPassword")
67+
)
68+
}
69+
70+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
71+
authentication(
72+
userName: project.ext.getProperty("ossrhUsername"),
73+
password: project.ext.getProperty("ossrhPassword")
74+
)
75+
}
76+
77+
pom.project {
78+
name 'RxJavaWebsocketClient'
79+
packaging 'jar'
80+
// optionally artifactId can be defined here
81+
description 'RxJavaWebsocketClient is simple library for Websocket connection for java and Android. It is designed to be fast and fault tolerant.'
82+
url 'https://github.com/jacek-marchwicki/JavaWebsocketClient'
83+
84+
scm {
85+
connection 'scm:git:https://github.com/jacek-marchwicki/JavaWebsocketClient.git'
86+
developerConnection 'scm:git:https://github.com/jacek-marchwicki/JavaWebsocketClient.git'
87+
url 'https://github.com/jacek-marchwicki/JavaWebsocketClient.git'
88+
}
89+
90+
licenses {
91+
license {
92+
name 'The Apache License, Version 2.0'
93+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
94+
}
95+
}
96+
97+
developers {
98+
developer {
99+
id 'jacek'
100+
name 'Jacek Marchwicki'
101+
email 'jacek.marchwicki@gmail.com'
102+
}
103+
}
104+
}
105+
}
106+
}
27107
}

websockets/build.gradle

Lines changed: 67 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ buildscript {
88

99
apply plugin: 'java'
1010
apply plugin: 'maven'
11+
apply plugin: 'signing'
1112

1213
repositories {
1314
mavenCentral()
14-
maven { url 'https://commondatastorage.googleapis.com/maven-repository/' }
1515
}
1616

1717
configurations {
@@ -30,69 +30,82 @@ dependencies {
3030
testCompile 'com.google.truth:truth:0.25'
3131
}
3232

33-
def baseVersionName = "1.1.4"
34-
if (project.hasProperty("versionSuffix")) {
35-
project.ext.versionSuffix = project.versionSuffix
36-
} else {
37-
project.ext.versionSuffix = "snapshot"
33+
task javadocJar(type: Jar) {
34+
classifier = 'javadoc'
35+
from javadoc
3836
}
39-
if (project.ext.versionSuffix) {
40-
version = "${baseVersionName}-${project.versionSuffix}"
41-
} else {
42-
version = "${baseVersionName}"
37+
38+
task sourcesJar(type: Jar) {
39+
classifier = 'sources'
40+
from sourceSets.main.allSource
41+
}
42+
43+
artifacts {
44+
archives javadocJar, sourcesJar
4345
}
44-
archivesBaseName = "websockets"
46+
47+
signing {
48+
sign configurations.archives
49+
}
50+
4551
group = "com.appunite"
52+
archivesBaseName = "websockets-java"
53+
version = "2.0.0"
4654

47-
task createPomFile {
48-
project.ext.pomFile = pom {
49-
version = project.version
50-
artifactId = project.archivesBaseName
51-
groupId = project.group
52-
project {
53-
name 'AUWebSocket'
54-
description 'Android socketio/websocket library.'
55-
url 'https://github.com/jacek-marchwicki/AndroidSocketIO'
56-
inceptionYear '2012'
57-
58-
licenses {
59-
license {
60-
name 'The Apache Software License, Version 2.0'
61-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
62-
distribution 'repo'
63-
}
55+
if (!project.hasProperty("ossrhUsername")) {
56+
project.ext.setProperty("ossrhUsername", null)
57+
}
58+
if (!project.hasProperty("ossrhPassword")) {
59+
project.ext.setProperty("ossrhPassword", null)
60+
}
61+
62+
uploadArchives {
63+
repositories {
64+
mavenDeployer {
65+
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
66+
67+
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
68+
authentication(
69+
userName: project.ext.getProperty("ossrhUsername"),
70+
password: project.ext.getProperty("ossrhPassword")
71+
)
6472
}
6573

66-
scm {
67-
url "https://github.com/jacek-marchwicki/AndroidSocketIO"
68-
connection "https://github.com/jacek-marchwicki/AndroidSocketIO.git"
74+
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
75+
authentication(
76+
userName: project.ext.getProperty("ossrhUsername"),
77+
password: project.ext.getProperty("ossrhPassword")
78+
)
6979
}
70-
developers {
71-
developer {
72-
name 'Jacek Marchwicki <jacek.marchwicki@gmail.com>'
80+
81+
pom.project {
82+
name 'JavaWebsocketClient'
83+
packaging 'jar'
84+
// optionally artifactId can be defined here
85+
description 'JavaWebsocketClient is simple library for Websocket connection for java and Android. It is designed to be fast and fault tolerant.'
86+
url 'https://github.com/jacek-marchwicki/JavaWebsocketClient'
87+
88+
scm {
89+
connection 'scm:git:https://github.com/jacek-marchwicki/JavaWebsocketClient.git'
90+
developerConnection 'scm:git:https://github.com/jacek-marchwicki/JavaWebsocketClient.git'
91+
url 'https://github.com/jacek-marchwicki/JavaWebsocketClient.git'
7392
}
74-
}
75-
}
76-
}
77-
}
7893

79-
Properties props = new Properties()
80-
def credentialsProperties = file("credentials.properties")
81-
if (credentialsProperties.exists()) {
82-
props.load(new FileInputStream(credentialsProperties))
83-
}
94+
licenses {
95+
license {
96+
name 'The Apache License, Version 2.0'
97+
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
98+
}
99+
}
84100

85-
uploadArchives {
86-
description = "Upload archives to maven repository"
87-
dependsOn createPomFile
88-
repositories.mavenDeployer {
89-
configuration = configurations.deployerJars
90-
repository(url: "gs://maven-repository") {
91-
authentication(
92-
userName: "${props.getProperty('mavenUser', null)}" ,
93-
password: "${props.getProperty('mavenPassword', null)}")
101+
developers {
102+
developer {
103+
id 'jacek'
104+
name 'Jacek Marchwicki'
105+
email 'jacek.marchwicki@gmail.com'
106+
}
107+
}
108+
}
94109
}
95-
pom = project.ext.pomFile
96110
}
97111
}
98-

0 commit comments

Comments
 (0)