From be01c8d8ab4dc13b52dbf60fb70b6365647ae83d Mon Sep 17 00:00:00 2001 From: Narine Cholakyan Date: Mon, 20 Mar 2017 11:28:57 -0500 Subject: [PATCH 1/7] code for publishing to maven --- build.gradle | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 3604882..d33deb2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,13 @@ +plugins { + id "com.jfrog.bintray" version "1.7.3" +} + group 'com.ibm' version '1.0-SNAPSHOT' apply plugin: 'java' apply plugin: 'application' +apply plugin: 'maven-publish' mainClassName = "Main" @@ -10,8 +15,10 @@ sourceCompatibility = 1.8 repositories { mavenCentral() + jcenter() } + compileJava { options.compilerArgs << "-Xlint:all" << "-Werror" } @@ -23,12 +30,40 @@ dependencies { compile group: 'com.squareup.okhttp3', name: 'okhttp-ws', version: '3.4.2' compile group: 'com.google.guava', name: 'guava', version: '20.0' compile group: 'com.h2database', name: 'h2', version: '1.4.193' - //compile group: 'com.github.davidmoten', name: 'rxjava-jdbc', version: '0.7.3' - //compile group: 'com.appunite', name : 'websockets-rxjava', version : '4.0.1' compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0' testCompile group: 'junit', name: 'junit', version: '4.11' } +publishing { + repositories { + maven{ + url "github.com/csync/csync-java" + } + } + publications { + mavenJava(MavenPublication) { + from components.java + groupId 'com.ibm.csync' + artifactId 'csync-java' + version '1.2' + } + } +} + +bintray { + user = System.getenv('BINTRAY_USER') + key = System.getenv('BINTRAY_KEY') + pkg { + version { + name = '1.2' + } + repo = 'maven' + name = 'csync-java' + licenses = ['Apache-2.0'] + vcsUrl = 'https://github.com/csync/csync-java.git' + } +} + jar { from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } From 968ff3da1e6c924115701032bcb0ba4f3b20e38b Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Wed, 12 Apr 2017 10:03:21 -0500 Subject: [PATCH 2/7] Update README.md Resolves #13 --- README.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b42b663..ec69e28 100644 --- a/README.md +++ b/README.md @@ -72,18 +72,19 @@ The ACL for a key is set when the key is created by the first write performed to # Getting Started Adding the java SDK to your java project: - -1. Build the csync-java SDK either in an IDE or from the command line using the command `gradle build`. This will generate the CSync .jar file in your `build/libs` directory. -2. From your java project, navigate to `File -> Project Structure` as shown in the screenshot below: - - - -3. Click on `Libraries` -4. Click the `+` sign and select `Java` -5. Navigate to the directory that contains the jar file for CSync. - -Note: if you are using a gradle project, add the CSync SDK as a dependency in your `build.gradle` file like this: -`compile files('/Users/narinecholakyan/Documents/csync-java/build/libs/csync-1.0-SNAPSHOT.jar')` + +Maven: +``` + + com.ibm.csync + csync-java + 1.3 + +``` +Gradle: +``` +compile 'com.ibm.csync:csync-java:1.3' +``` #Usage From 5efd52c1e5d2a53a272afd2e47378c3976222dce Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Wed, 12 Apr 2017 16:15:18 -0500 Subject: [PATCH 3/7] Updated build.gradle to support upload to jcenter --- build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index d33deb2..0ae2db5 100644 --- a/build.gradle +++ b/build.gradle @@ -53,6 +53,7 @@ publishing { bintray { user = System.getenv('BINTRAY_USER') key = System.getenv('BINTRAY_KEY') + publications = ['mavenJava'] pkg { version { name = '1.2' @@ -68,4 +69,4 @@ jar { from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } -} \ No newline at end of file +} From d8407144635520d86730a599f91bc15991873b3c Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Wed, 26 Apr 2017 14:34:20 -0500 Subject: [PATCH 4/7] Update version to 1.4.0 --- build.gradle | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 0ae2db5..b60abba 100644 --- a/build.gradle +++ b/build.gradle @@ -2,8 +2,9 @@ plugins { id "com.jfrog.bintray" version "1.7.3" } +def mavenVersion='1.4.0' group 'com.ibm' -version '1.0-SNAPSHOT' +version "${mavenVersion}" apply plugin: 'java' apply plugin: 'application' @@ -43,6 +44,7 @@ publishing { publications { mavenJava(MavenPublication) { from components.java + artifact sourcesJar groupId 'com.ibm.csync' artifactId 'csync-java' version '1.2' @@ -56,7 +58,7 @@ bintray { publications = ['mavenJava'] pkg { version { - name = '1.2' + name = "${mavenVersion}" } repo = 'maven' name = 'csync-java' @@ -70,3 +72,8 @@ jar { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } } + +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +} From 3a7375a4753bbaae50f6deb8b3150bdacd32758e Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Wed, 26 Apr 2017 14:36:38 -0500 Subject: [PATCH 5/7] build.gradle update --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b60abba..952f93d 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ publishing { artifact sourcesJar groupId 'com.ibm.csync' artifactId 'csync-java' - version '1.2' + version "${mavenVersion}" } } } From 6b5677f9e8c9cdad919b30d907f987b3c5afc219 Mon Sep 17 00:00:00 2001 From: Kevin Lai Date: Thu, 27 Apr 2017 10:40:17 -0500 Subject: [PATCH 6/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ec69e28..240e32c 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Maven: com.ibm.csync csync-java - 1.3 + 1.4.0 ``` Gradle: From 2476a9a2500acff4ecf19d8ad7ec0646fc215117 Mon Sep 17 00:00:00 2001 From: Narine Cholakyan Date: Fri, 28 Apr 2017 12:31:53 -0500 Subject: [PATCH 7/7] version update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 240e32c..cb5cb11 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Maven: ``` Gradle: ``` -compile 'com.ibm.csync:csync-java:1.3' +compile 'com.ibm.csync:csync-java:1.4.0' ``` #Usage