Skip to content

Commit aaa1917

Browse files
authored
Merge pull request #29 from astrogeco/25-add-build-number-and-baseline
Close #25, Add build number and baseline to version file
2 parents e445622 + be15671 commit aaa1917

File tree

2 files changed

+41
-16
lines changed

2 files changed

+41
-16
lines changed

fsw/src/sample_lib.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ int32 SAMPLE_LibInit(void)
6565
/* ensure termination */
6666
SAMPLE_Buffer[sizeof(SAMPLE_Buffer) - 1] = 0;
6767

68-
OS_printf("SAMPLE Lib Initialized. Version %d.%d.%d.%d\n", SAMPLE_LIB_MAJOR_VERSION, SAMPLE_LIB_MINOR_VERSION,
69-
SAMPLE_LIB_REVISION, SAMPLE_LIB_MISSION_REV);
68+
OS_printf("SAMPLE Lib Initialized.%s\n", SAMPLE_LIB_VERSION_STRING);
7069

7170
return CFE_SUCCESS;
7271

fsw/src/sample_lib_version.h

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,49 @@
1818
** See the License for the specific language governing permissions and
1919
** limitations under the License.
2020
**
21-
** File: sample_lib_version.h
22-
**
23-
** Purpose:
24-
** The SAMPLE Lib header file containing version number
25-
**
26-
** Notes:
27-
**
2821
*************************************************************************/
29-
#ifndef _sample_lib_version_h_
30-
#define _sample_lib_version_h_
3122

32-
#define SAMPLE_LIB_MAJOR_VERSION 1
33-
#define SAMPLE_LIB_MINOR_VERSION 1
34-
#define SAMPLE_LIB_REVISION 4
35-
#define SAMPLE_LIB_MISSION_REV 0
23+
/*! @file sample_lib_version.h
24+
* @brief Purpose:
25+
*
26+
* The Sample Lib header file containing version information
27+
*
28+
*/
29+
30+
#ifndef SAMPLE_LIB_VERSION_H
31+
#define SAMPLE_LIB_VERSION_H
32+
33+
/* Development Build Macro Definitions */
34+
35+
#define SAMPLE_LIB_BUILD_NUMBER 26 /*!< Development Build: Number of commits since baseline */
36+
#define SAMPLE_LIB_BUILD_BASELINE "v1.1.0" /*!< Development Build: git tag that is the base for the current development */
37+
38+
/* Version Macro Definitions */
39+
40+
#define SAMPLE_LIB_MAJOR_VERSION 1 /*!< @brief ONLY APPLY for OFFICIAL releases. Major version number. */
41+
#define SAMPLE_LIB_MINOR_VERSION 1 /*!< @brief ONLY APPLY for OFFICIAL releases. Minor version number. */
42+
#define SAMPLE_LIB_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision version number. */
43+
#define SAMPLE_LIB_MISSION_REV 0 /*!< @brief ONLY USED by MISSION Implementations. Mission revision */
44+
45+
#define SAMPLE_LIB_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer macros */
46+
#define SAMPLE_LIB_STR(x) SAMPLE_LIB_STR_HELPER(x) /*!< @brief Helper function to concatenate strings from integer macros */
47+
48+
/*! @brief Development Build Version Number.
49+
* @details Baseline git tag + Number of commits since baseline. @n
50+
* See @ref cfsversions for format differences between development and release versions.
51+
*/
52+
#define SAMPLE_LIB_VERSION SAMPLE_LIB_BUILD_BASELINE "+dev" SAMPLE_LIB_STR(SAMPLE_LIB_BUILD_NUMBER)
53+
54+
/*! @brief Development Build Version String.
55+
* @details Reports the current development build's baseline, number, and name. Also includes a note about the latest official version. @n
56+
* See @ref cfsversions for format differences between development and release versions.
57+
*/
58+
#define SAMPLE_LIB_VERSION_STRING \
59+
" Sample Lib Development Build " \
60+
SAMPLE_LIB_VERSION \
61+
", Last Official Release: v1.1.0" /* For full support please use this version */
3662

37-
#endif /* _sample_lib_version_h_ */
63+
#endif /* SAMPLE_LIB_VERSION_H */
3864

3965
/************************/
4066
/* End of File Comment */

0 commit comments

Comments
 (0)