DESCRIPTION

JCBC-589 : Versioning information stored in property file

Motivation
----------
For now, versioning information is extracted from the Manifest.MF via
Package class. In cases where the sdk is integrated into a fat jar (or
shadow jar), manifest information is lost, and the sdk cannot give a
complete PACKAGE_NAME_AND_VERSION.

Modifications
-------------
Versioning information is now stored into a properties file, of which a
template is added to src/main/resources folder. Gradle will execute git
command to produce version number and replace tokens in the properties
file with correct strings.

DefaultCouchbaseEnvironment loads the properties file to retrieve the
version number. In case this is not possible the previous behavior of
showing "unknown" is maintained.

The file is named com.couchbase.client.java.properties in order to
remain distinguishable even when flattened in a fatjar along with the
java client source for example (a generic name would have caused
potential for the wrong file to be picked up in such a configuration).

Note that if git command cannot be executed by Gradle (eg not in path
under windows), it will put the build date in there (in the format
unknown-yyyyMMdd).

If the sdk cannot get hold of the properties file, then we'll still have
"unknown" for both implementationVersion and specificationVersion (but
this has been tested inside both shadow jars and manually created fatjar
so this isn't the case as long as the properties file is present there).

Result
------
Building the jar includes a com.couchbase.client.java.properties file
containing complete sdk version info.

Repackaging into a fat jar doesn't break the version retrieval feature.

Change-Id: I7f1752fd891ca60a3192c941badd6b16373635b8


COMMENTS

author: Estrella Humphrey
date: 2014-10-22 13:14:46.826000000

Uploaded patch set 1.

-------------------------------------
author: Estrella Humphrey
date: 2014-10-22 13:15:42.471000000

Patch Set 1: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2014-10-22 14:35:49.681000000

Patch Set 1: Code-Review+2

-------------------------------------
