diff --git a/CHANGELOG.md b/CHANGELOG.md index a431fda9..44b1376a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ # pusher-websocket-java changelog -## Version 1.3.0 +## Version 1.4.0 +* Update the dependency to use pusher/java-websocket fork and remove dependency on clojars.org repository. +## Version 1.3.0 * Add retry logic when the connection is lost * Accept 201 status code from auth endpoints diff --git a/build.gradle b/build.gradle index 4a583799..a78c39de 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,7 @@ buildscript { classpath 'org.ajoberstar:gradle-git:1.1.0' } } + def getProperty = { property -> if (!project.hasProperty(property)) { throw new GradleException("${property} property must be set") @@ -13,7 +14,6 @@ def getProperty = { property -> return project.property(property) } - apply plugin: 'java' apply plugin: 'maven' apply plugin: 'eclipse' @@ -21,7 +21,7 @@ apply plugin: 'org.ajoberstar.github-pages' apply plugin: 'signing' group = "com.pusher" -version = "1.3.0" +version = "1.4.0" sourceCompatibility = "1.6" targetCompatibility = "1.6" @@ -39,13 +39,12 @@ ext.sharedManifest = manifest { repositories { mavenCentral() - maven { url "http://clojars.org/repo" } } dependencies { compile "com.google.code.gson:gson:2.2.2" compile "org.slf4j:slf4j-api:1.7.5" - compile "org.java-websocket:java-websocket:1.3.1" + 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" @@ -186,5 +185,5 @@ task createPublishTarget << { } task wrapper(type: Wrapper) { - gradleVersion = '2.0' + gradleVersion = '2.14.1' } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 085a1cdc..3baa851b 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c40be52e..d6df5cc5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Mar 04 21:36:52 GMT 2015 +#Tue Nov 15 11:59:30 GMT 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip diff --git a/gradlew b/gradlew index 91a7e269..27309d92 100755 --- a/gradlew +++ b/gradlew @@ -6,12 +6,30 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -30,6 +48,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,31 +59,11 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -90,7 +89,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -114,6 +113,7 @@ fi if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` diff --git a/gradlew.bat b/gradlew.bat index 8a0b282a..f6d5974e 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/pom.xml b/pom.xml deleted file mode 100644 index b7700880..00000000 --- a/pom.xml +++ /dev/null @@ -1,335 +0,0 @@ - - - - org.sonatype.oss - oss-parent - 7 - - - 4.0.0 - com.pusher - pusher-java-client - Pusher Java Client Library - 1.3.0 - http://github.com/pusher/pusher-java-client - - - This is a Java client library for Pusher, targeted at core - Java and Android. - - - - UTF-8 - - github - - - - scm:git:git@github.com:pusher/pusher-java-client - scm:git:git@github.com:pusher/pusher-java-client - scm:git:git@github.com:pusher/pusher-java-client - - - - - MIT - https://raw.github.com/pusher/pusher-java-client/master/LICENCE.txt - https://raw.github.com/pusher/pusher-java-client/mvn-repo/ - - - - - Pusher - http://pusher.com - - - - Github - https://github.com/pusher/pusher-java-client/issues - - - - - mike - Mike Pye - mike@pusher.com - Pusher - http://pusher.com - - maintainer - developer - - Europe/London - - - - - - clojars.org - http://clojars.org/repo - - - - jar - - - - signed-jar - - - gpg.passphrase - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.4 - - - sign-artifacts - verify - - sign - - - - - - - - - - - ${project.artifactId}-${project.version} - target/classes - target/test-classes - target - - - src/main/resources - true - - - - - src/test/resources - - - - - - maven-javadoc-plugin - 2.9 - - - attach-javadocs - package - - jar - - - ${basedir}/src/main/javadoc/overview.html - ${basedir}/src/main/javadoc/css/styles.css - com.pusher.client.channel.impl:com.pusher.client.connection.impl:com.pusher.client.connection.websocket:org.java_websocket:com.pusher.client.example - - - ${project.groupId} ${project.artifactId} - ${project.groupId}.${project.artifactId} - - - true - - http://download.oracle.com/javase/6/docs/api - - -Xdoclint:none - - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar - - - - - - - com.github.github - site-maven-plugin - 0.9 - - github - pusher-java-client - pusher - true - - - - - javadoc - - JavaDoc gh-pages for ${project.version} - ${project.build.directory}/apidocs - refs/heads/gh-pages - - **/* - - - - site - - deploy - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.1 - - - add-source - generate-sources - - add-source - - - - Java-WebSocket/src/main/java - - - - - - - maven-jar-plugin - 2.4 - - ${env.snapshotname} - - - true - com.pusher.client.example - com.pusher.client.example.ExampleApp - true - true - - - - - - org.apache.maven.plugins - maven-assembly-plugin - 2.1 - - - jar-with-dependencies - - - - com.pusher.client.example - com.pusher.client.example.ExampleApp - - - - - - package - - single - - - - - - - maven-compiler-plugin - 3.0 - - 1.6 - 1.6 - - - - - - - - com.google.code.gson - gson - 2.3.1 - - - org.slf4j - slf4j-api - 1.7.12 - - - org.java-websocket - java-websocket - 1.3.1 - - - - org.mockito - mockito-all - 1.8.5 - test - - - org.powermock - powermock-module-junit4 - 1.4.11 - test - - - org.powermock - powermock-api-mockito - 1.4.11 - test - - - - - target/site - - - org.apache.maven.plugins - maven-changes-plugin - 2.0-beta-3 - - - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.6 - - false - - - - org.apache.maven.plugins - maven-surefire-report-plugin - 2.4 - - - - diff --git a/src/main/java/com/pusher/client/connection/websocket/WebSocketClientWrapper.java b/src/main/java/com/pusher/client/connection/websocket/WebSocketClientWrapper.java index cce5857a..07e5f256 100644 --- a/src/main/java/com/pusher/client/connection/websocket/WebSocketClientWrapper.java +++ b/src/main/java/com/pusher/client/connection/websocket/WebSocketClientWrapper.java @@ -10,8 +10,8 @@ import javax.net.ssl.SSLException; import javax.net.ssl.SSLSocketFactory; -import org.java_websocket.client.WebSocketClient; -import org.java_websocket.handshake.ServerHandshake; +import com.pusher.java_websocket.client.WebSocketClient; +import com.pusher.java_websocket.handshake.ServerHandshake; /** * A thin wrapper around the WebSocketClient class from the Java-WebSocket diff --git a/src/main/java/com/pusher/client/connection/websocket/WebSocketConnection.java b/src/main/java/com/pusher/client/connection/websocket/WebSocketConnection.java index 63e9f612..8bddcef6 100644 --- a/src/main/java/com/pusher/client/connection/websocket/WebSocketConnection.java +++ b/src/main/java/com/pusher/client/connection/websocket/WebSocketConnection.java @@ -13,7 +13,7 @@ import javax.net.ssl.SSLException; -import org.java_websocket.handshake.ServerHandshake; +import com.pusher.java_websocket.handshake.ServerHandshake; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/pusher/client/connection/websocket/WebSocketListener.java b/src/main/java/com/pusher/client/connection/websocket/WebSocketListener.java index ba12613e..4ac4a665 100644 --- a/src/main/java/com/pusher/client/connection/websocket/WebSocketListener.java +++ b/src/main/java/com/pusher/client/connection/websocket/WebSocketListener.java @@ -1,6 +1,6 @@ package com.pusher.client.connection.websocket; -import org.java_websocket.handshake.ServerHandshake; +import com.pusher.java_websocket.handshake.ServerHandshake; public interface WebSocketListener { diff --git a/src/main/java/com/pusher/client/example/SimpleWebSocket.java b/src/main/java/com/pusher/client/example/SimpleWebSocket.java index 16fe2ebc..1662c6e6 100644 --- a/src/main/java/com/pusher/client/example/SimpleWebSocket.java +++ b/src/main/java/com/pusher/client/example/SimpleWebSocket.java @@ -3,8 +3,8 @@ import java.net.URI; import java.net.URISyntaxException; -import org.java_websocket.client.WebSocketClient; -import org.java_websocket.handshake.ServerHandshake; +import com.pusher.java_websocket.client.WebSocketClient; +import com.pusher.java_websocket.handshake.ServerHandshake; public class SimpleWebSocket extends WebSocketClient { public static void main(final String[] args) throws URISyntaxException { diff --git a/src/main/java/com/pusher/client/util/Factory.java b/src/main/java/com/pusher/client/util/Factory.java index 621cca37..ed93424b 100644 --- a/src/main/java/com/pusher/client/util/Factory.java +++ b/src/main/java/com/pusher/client/util/Factory.java @@ -10,8 +10,6 @@ import javax.net.ssl.SSLException; -import org.java_websocket.client.WebSocketClient; - import com.pusher.client.Authorizer; import com.pusher.client.PusherOptions; import com.pusher.client.channel.impl.ChannelImpl; diff --git a/src/test/java/com/pusher/client/EndToEndTest.java b/src/test/java/com/pusher/client/EndToEndTest.java index 2f280a76..cb1be7f1 100644 --- a/src/test/java/com/pusher/client/EndToEndTest.java +++ b/src/test/java/com/pusher/client/EndToEndTest.java @@ -6,7 +6,7 @@ import java.net.Proxy; import java.net.URI; -import org.java_websocket.handshake.ServerHandshake; +import com.pusher.java_websocket.handshake.ServerHandshake; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/com/pusher/client/connection/websocket/WebSocketClientWrapperTest.java b/src/test/java/com/pusher/client/connection/websocket/WebSocketClientWrapperTest.java index 3e1af525..abae90e6 100644 --- a/src/test/java/com/pusher/client/connection/websocket/WebSocketClientWrapperTest.java +++ b/src/test/java/com/pusher/client/connection/websocket/WebSocketClientWrapperTest.java @@ -8,7 +8,7 @@ import javax.net.ssl.SSLException; -import org.java_websocket.handshake.ServerHandshake; +import com.pusher.java_websocket.handshake.ServerHandshake; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith;