diff --git a/README.md b/README.md index 871e7b6..6ee0f9d 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.4.0 + +``` +Gradle: +``` +compile 'com.ibm.csync:csync-java:1.4.0' +``` #Usage diff --git a/build.gradle b/build.gradle index 3604882..952f93d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,14 @@ +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' +apply plugin: 'maven-publish' mainClassName = "Main" @@ -10,8 +16,10 @@ sourceCompatibility = 1.8 repositories { mavenCentral() + jcenter() } + compileJava { options.compilerArgs << "-Xlint:all" << "-Werror" } @@ -23,14 +31,49 @@ 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 + artifact sourcesJar + groupId 'com.ibm.csync' + artifactId 'csync-java' + version "${mavenVersion}" + } + } +} + +bintray { + user = System.getenv('BINTRAY_USER') + key = System.getenv('BINTRAY_KEY') + publications = ['mavenJava'] + pkg { + version { + name = "${mavenVersion}" + } + 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) } } -} \ No newline at end of file +} + +task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource +}