DESCRIPTION

JCBC-589: Versionning information stored in property file

Motivation
----------
For now, versionning 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.

This is notably the case for the SDKQE team, that builds a fatjar with the sdk and various
dependencies, and that first brought up the issue.

Modifications
-------------
Versionning 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 will then load the properties
file to retrieve the version number.

The file is named couchbase.java.core.properties in order to remain distinguishable even
when put in a flat 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 the sdkd jar
so this is not the case as long as the properties file is present in fatjar).

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

Sdkd QE fat jar now contains the properties file and thus doesn't erase versionning information.
Calling the sdkd_exec.jar with -V (version) parameter displays the complete and correct sdk
version information.

Change-Id: Ib8531d527832ea316920d2df27c673e0424a455f


COMMENTS

author: Estrella Humphrey
date: 2014-10-22 08:59:31.904000000

Uploaded patch set 1.

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