forked from BRAINSia/BRAINSTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: First pass at adding version control
Attempt to uniformly provide version information from BRAINSTools. Following conventions from http://semver.org Semantic Versioning 2.0.0 Summary Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes. Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
- Loading branch information
1 parent
d7e73ee
commit ea04d47
Showing
11 changed files
with
522 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/*========================================================================= | ||
* Modified from BRAINSTools reference | ||
* Copyright Insight Software Consortium | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0.txt | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*=========================================================================*/ | ||
#include "BRAINSToolsVersion.h" | ||
#include "BRAINSToolsVersionConfig.h" | ||
|
||
#include <iostream> // std::cout, std::ios | ||
#include <sstream> // std::ostringstream | ||
|
||
namespace | ||
{ | ||
|
||
std::string MakeExtendedVersionString() | ||
{ | ||
std::ostringstream v; | ||
v << "BRAINSTools Version: " << BRAINSTools::Version::VersionString() << std::endl | ||
<< "Compiled: " << BRAINSTools::Version::BuildDate() << std::endl; | ||
return v.str(); | ||
} | ||
|
||
static const std::string extendedVersionString = MakeExtendedVersionString(); | ||
|
||
} | ||
|
||
namespace BRAINSTools | ||
{ | ||
unsigned int Version::MajorVersion() | ||
{ | ||
return BRAINSTools_VERSION_MAJOR; | ||
} | ||
unsigned int Version::MinorVersion() | ||
{ | ||
return BRAINSTools_VERSION_MINOR; | ||
} | ||
unsigned int Version::PatchVersion() | ||
{ | ||
return BRAINSTools_VERSION_PATCH; | ||
} | ||
unsigned int Version::TweakVersion() | ||
{ | ||
return 0; | ||
} | ||
const std::string &Version::VersionString() | ||
{ | ||
static const std::string v( BRAINSTools_VERSION ); | ||
return v; | ||
} | ||
const std::string &Version::BuildDate() | ||
{ | ||
static const std::string v( __DATE__ " " __TIME__ ); | ||
return v; | ||
} | ||
const std::string &Version::ExtendedVersionString() | ||
{ | ||
return extendedVersionString; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/*========================================================================= | ||
* | ||
* Copyright Insight Software Consortium | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0.txt | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*=========================================================================*/ | ||
#ifndef __BRAINSToolsVersion_h | ||
#define __BRAINSToolsVersion_h | ||
|
||
//NOTE: Windows magic needed here | ||
#define BRAINSToolsCommon_EXPORT | ||
|
||
#include <string> | ||
|
||
namespace BRAINSTools | ||
{ | ||
|
||
/** \class Version | ||
* \brief Version info for BRAINSTools | ||
*/ | ||
class BRAINSToolsCommon_EXPORT Version | ||
{ | ||
public: | ||
static unsigned int MajorVersion(); | ||
static unsigned int MinorVersion(); | ||
static unsigned int PatchVersion(); | ||
static unsigned int TweakVersion(); | ||
static const std::string &VersionString(); | ||
static const std::string &BuildDate(); | ||
|
||
static const std::string &ExtendedVersionString(); | ||
std::string ToString() { return Version::ExtendedVersionString(); } | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/*========================================================================= | ||
* | ||
* Copyright Insight Software Consortium | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0.txt | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*=========================================================================*/ | ||
|
||
#define BRAINSTools_VERSION_MAJOR @BRAINSTools_VERSION_MAJOR@ | ||
#define BRAINSTools_VERSION_MINOR @BRAINSTools_VERSION_MINOR@ | ||
#define BRAINSTools_VERSION_PATCH @BRAINSTools_VERSION_PATCH@ | ||
#define BRAINSTools_VERSION_TWEAK @BRAINSTools_VERSION_TWEAK@ | ||
#define BRAINSTools_VERSION "@BRAINSTools_VERSION@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.