Shows the changes we need to make to have the listener be fully friendly
to gradle and work really nicely in Android Studio 0.3.0
build.gradle - Put in right voodoo to allow for updates to local Maven repository (just issue gradlew.bat install) as well as a remote Maven repository. Also put in the arguments for the wrapper task.

CBLAcceptor.java - This is an extension of the TJWS acceptor class (used to handle transports like SSL) that exposes a 'getPort()' method. we need this to discover the port when we submit a port of 0 (meaning - get whatever port is available).

CBLHTTPServer.java - Changed the constructor to include server and listener as well as to take TJWS config properties and a CBLRequestAuthorization. Also put in a method to query the port the server is listening on.

CBLHTTPServlet.java - Put in logic to pass through a CBLRequestAuthorization and also to check if a connection is over SSL and if so to call setSSLSession on the connection object.

CBLListener.java - Got rid of discoverEmptyPort (we don't need it anymore now that we support port 0) and got rid of serverStatus.

CBLSSLAcceptor.java - Extends TJWS SSLAcceptor to expose getPort and also to hook it into ARG_PORT, it internally uses a differen value for ARG_PORT, see comments for details.

CBLSimpleAcceptor.java - Unfortunately the code I needed in the non-HTTPS acceptor isn't properly exposed by TJWS so I had to copy over the source for the acceptor and edit it. Bummer.
Marque Changes:
Instead of returning the port the server is running at we now return a CBLSocketStatus object which is a wrapper for the underlying server socket but only exposes 'safe' methods. This is needed to determine the server's state as well as its port.

build.gradle - Generates source jar
CBLAcceptor, CBLHTTPServer, CBLListener, CBLSSLAcceptor, CBLSimpleAcceptor  - Updated to return socket status instead of just port
CBLSocketStatus - Wraps a socket and exposes 'safe' methods to query its status
CBLHTTPServlet - Updated to accept CBLRequestAuthorization object
Removed the is.available() call that broke SSL because it's stream always
(legally) returns 0
Merge remote-tracking branch 'upstream/master'

Conflicts:
	src/main/java/com/couchbase/cblite/listener/CBLHTTPServlet.java
	src/main/java/com/couchbase/cblite/listener/CBLListener.java

All import statement conflicts, nothing interesting.
Merge remote-tracking branch 'upstream/master'

Conflicts:
	src/main/java/com/couchbase/cblite/listener/CBLHTTPServer.java
	src/main/java/com/couchbase/lite/listener/LiteListener.java
	src/main/java/com/couchbase/lite/listener/LiteServlet.java
Squashing together all of my changes to make it easier to rebase.
Merge branch 'master' of https://github.com/yaronyg/couchbase-lite-android-listener
I think I'm actually doing the same thing twice :( Sorry, trying to figure
out how to rebase without ending up with a billion conflicts.
Merge branch 'master' of https://github.com/yaronyg/couchbase-lite-android-listener
Merge remote-tracking branch 'upstream/master'

Conflicts:
	.gitignore
	build.gradle
Preparing for rebase
Merge branch 'master' of https://github.com/yaronyg/couchbase-lite-android-listener
Android Studio 0.4 compatibility changes:

Changed to Gradle 1.9 (minimum Android 0.4 supports) because 1.10 is broken for Android Libraries
Re-ran wrapper to upgrade to Gradle 1.9
Gradle 1.9 broken mavenLocal() so replaced with a work around
Set principal from SSL Session (if any)
Fixes to make Gradle work with Thali's Maven Server
Merge remote-tracking branch 'upstream/master' into thaliauth

Conflicts:
	src/main/java/com/couchbase/lite/listener/LiteListener.java
Merge remote-tracking branch 'upstream/master' into thaliauth

Conflicts:
	.gitignore
	build.gradle
	dependencies-archive.gradle
	gradle/wrapper/gradle-wrapper.jar
	gradle/wrapper/gradle-wrapper.properties
	gradlew
	gradlew.bat
Merge remote-tracking branch 'upstream/master' into thaliauth

Conflicts:
	build.gradle
	dependencies-archive.gradle
Merge remote-tracking branch 'upstream/master' into thaliauth

Conflicts:
	build.gradle