DESCRIPTION

JVMCBC-50 : 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.

DefaultCoreEnvironment 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.core.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.core.properties file
containing complete sdk version info.

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

Change-Id: Ib8531d527832ea316920d2df27c673e0424a455f
Reviewed-on: http://review.couchbase.org/42338
Tested-by: Estrella Humphrey xxx@xxx.xxx
Reviewed-by: Natasha Sullivan xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2014-10-22 10:59:38.114000000

Change has been successfully cherry-picked as 410cf304987f82d67e03dc8f1d4b369c0fa5ec21

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