Skip to content

Modified version.h for 5.2.1-preview #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions source/shared/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,18 @@
#define STRINGIFY(a) TOSTRING(a)
#define TOSTRING(a) #a


// Increase Major number with backward incompatible breaking changes.
// Increase Minor with backward compatible new functionalities and API changes.
// Increase Patch for backward compatible fixes.
#define SQLVERSION_MAJOR 5
#define SQLVERSION_MINOR 2
#define SQLVERSION_PATCH 0
#define SQLVERSION_PATCH 1
#define SQLVERSION_BUILD 0

// Semantic versioning pre-release
// for stable releases should be empty
// "-RC" for release candidates
// "-preview" for ETP
// For previews, set this constant to 1. Otherwise, set it to 0
#define PREVIEW 1
#define SEMVER_PRERELEASE

// Semantic versioning build metadata, build meta data is not counted in precedence order.
#define SEMVER_BUILDMETA

Expand All @@ -47,13 +45,22 @@
// Main version, dot separated 3 digits, Major.Minor.Patch
#define VER_APIVERSION_STR STRINGIFY( SQLVERSION_MAJOR ) "." STRINGIFY( SQLVERSION_MINOR ) "." STRINGIFY( SQLVERSION_PATCH )

// For preview release, we want the following:
// #define VER_FILEVERSION_STR VER_APIVERSION_STR "-" SEMVER_PRERELEASE SEMVER_BUILDMETA
// because pecl doesn't like dashes. However, if SEMVER_PRERELEASE is empty, the "-" must be removed
// Semantic versioning:
// For stable releases leave SEMVER_PRERELEASE empty
// Otherwise, for pre-releases, add '-' and change it to:
// "RC" for release candidates
// "preview" for ETP
#if PREVIEW > 0
#undef SEMVER_PRERELEASE
#define SEMVER_PRERELEASE "preview"
#define VER_FILEVERSION_STR VER_APIVERSION_STR "-" SEMVER_PRERELEASE SEMVER_BUILDMETA
#else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SEMVER_BUILDMETA is empty unless SQLVERSION_BUILD is not 0, but when is SQLVERSION_BUILD not zero?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build scripts take care of setting the SQLVERSION_BUILD, see this line

https://github.com/Microsoft/msphpsql/blob/master/buildscripts/buildtools.py?utf8=%E2%9C%93#L269

#define VER_FILEVERSION_STR VER_APIVERSION_STR SEMVER_PRERELEASE SEMVER_BUILDMETA
#endif

#define _FILEVERSION SQLVERSION_MAJOR,SQLVERSION_MINOR,SQLVERSION_PATCH,SQLVERSION_BUILD

// PECL package version macros (can't have '-' or '+')
// PECL package version macros ('-' or '+' is not allowed)
#define PHP_SQLSRV_VERSION VER_APIVERSION_STR SEMVER_PRERELEASE
#define PHP_PDO_SQLSRV_VERSION PHP_SQLSRV_VERSION

Expand Down