@@ -8,10 +8,10 @@ buildscript {
88
99apply plugin : ' java'
1010apply plugin : ' maven'
11+ apply plugin : ' signing'
1112
1213repositories {
1314 mavenCentral()
14- maven { url ' https://commondatastorage.googleapis.com/maven-repository/' }
1515}
1616
1717configurations {
@@ -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+
4551group = " 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