Description
From some tools, it would usually be useful to get a version from the CouchbaseClient class. Ideally this would be derived from something like 'git describe' such that we could see if the code being used is not yet released and what it's lineage is.
Attachments
For Gerrit Dashboard: NCBC-334 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
31597,7 | NCBC-334: Add a method of getting the version of the library programatically | master | couchbase-net-client | Status: MERGED | +2 | +1 |
31598,2 | NCBC-334: Add a method of getting the version of the library programatically | master | couchbase-net-client | Status: ABANDONED | 0 | 0 |
31599,2 | NCBC-334: Add a method of getting the version of the library programatically | master | couchbase-net-client | Status: ABANDONED | 0 | 0 |
31600,2 | NCBC-334: Add a method of getting the version of the library programatically | master | couchbase-net-client | Status: ABANDONED | 0 | 0 |
31698,2 | NCBC-334: (amendment) Add a method of getting the version of the library programatically | master | couchbase-net-client | Status: MERGED | +2 | +1 |
After some discussion, the solution needs the following steps:
1-Git hook: writes the sha1, git-describe or other info describing the snapshot of source being built to a file (Version.txt) in the local directory - this hook is run on every pull, fetch, etc
2-Version.txt: a file in the local directory that is:
a) a Build Action of "Embedded resource"*,
b) is added to git-ignore
c) contains the version info from git described in #1
3-Build event: will copy the text from the file into the appropriate assembly attributes:
a) for version into the AssemblyVersionAttribute,
b) for other info (git describe or sha1 into the AssemblyInformationalAttribute. I think we could do this via variable substitution.
*May not have to be an embedded resource, maybe just a file on disk.