From 7757b95cfcb4e46b2d3c70094a53ea922dfb59d7 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" Date: Tue, 4 Aug 2020 21:44:42 -0400 Subject: [PATCH] Close #46, Add build number and baseline Add macros for build number and baseline Add macros for version string Use version string macro in version report --- fsw/src/sch_lab_app.c | 3 +-- fsw/src/sch_lab_version.h | 54 ++++++++++++++++++++++++++++----------- 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/fsw/src/sch_lab_app.c b/fsw/src/sch_lab_app.c index 455cc88..360bf62 100644 --- a/fsw/src/sch_lab_app.c +++ b/fsw/src/sch_lab_app.c @@ -234,8 +234,7 @@ int32 SCH_LAB_AppInit(void) OS_printf("SCH Error subscribing to 1hz!\n"); } - OS_printf("SCH Lab Initialized. Version %d.%d.%d.%d\n", SCH_LAB_MAJOR_VERSION, SCH_LAB_MINOR_VERSION, - SCH_LAB_REVISION, SCH_LAB_MISSION_REV); + OS_printf("SCH Lab Initialized.%s\n", SCH_LAB_VERSION_STRING); return (CFE_SUCCESS); diff --git a/fsw/src/sch_lab_version.h b/fsw/src/sch_lab_version.h index 742a170..dd65d40 100644 --- a/fsw/src/sch_lab_version.h +++ b/fsw/src/sch_lab_version.h @@ -18,24 +18,48 @@ ** See the License for the specific language governing permissions and ** limitations under the License. ** -** File: sch_lab_version.h -** -** Purpose: -** The SCH Lab Application header file containing version number -** -** Notes: -** *************************************************************************/ -#ifndef _sch_lab_version_h_ -#define _sch_lab_version_h_ +#ifndef SCH_LAB_VERSION_H +#define SCH_LAB_VERSION_H + +/*! @file SCH_LAB_version.h + * @brief Purpose: + * + * The SCH Lab Application header file containing version information + * + */ + +/* Development Build Macro Definitions */ +#define SCH_LAB_BUILD_NUMBER 34 /*!< Development Build: Number of commits since baseline */ +#define SCH_LAB_BUILD_BASELINE "v2.3.0" /*!< Development Build: git tag that is the base for the current development */ -#define SCH_LAB_MAJOR_VERSION 2 -#define SCH_LAB_MINOR_VERSION 3 -#define SCH_LAB_REVISION 7 -#define SCH_LAB_MISSION_REV 0 +/* Version Macro Definitions */ -#endif /* _sch_lab_version_h_ */ +#define SCH_LAB_MAJOR_VERSION 2 /*!< @brief ONLY APPLY for OFFICIAL releases. Major version number. */ +#define SCH_LAB_MINOR_VERSION 3 /*!< @brief ONLY APPLY for OFFICIAL releases. Minor version number. */ +#define SCH_LAB_REVISION 0 /*!< @brief ONLY APPLY for OFFICIAL releases. Revision version number. */ +#define SCH_LAB_MISSION_REV 0 /*!< @brief ONLY USED by MISSION Implementations. Mission revision */ + +#define SCH_LAB_STR_HELPER(x) #x /*!< @brief Helper function to concatenate strings from integer macros */ +#define SCH_LAB_STR(x) SCH_LAB_STR_HELPER(x) /*!< @brief Helper function to concatenate strings from integer macros */ + +/*! @brief Development Build Version Number. + * @details Baseline git tag + Number of commits since baseline. @n + * See @ref cfsversions for format differences between development and release versions. + */ +#define SCH_LAB_VERSION SCH_LAB_BUILD_BASELINE "+dev" SCH_LAB_STR(SCH_LAB_BUILD_NUMBER) + +/*! @brief Development Build Version String. + * @details Reports the current development build's baseline, number, and name. Also includes a note about the latest official version. @n + * See @ref cfsversions for format differences between development and release versions. +*/ +#define SCH_LAB_VERSION_STRING \ + " SCH Lab Development Build " \ + SCH_LAB_VERSION \ + ", Last Official Release: v2.3.0" /* For full support please use this version */ + +#endif /* SCH_LAB_VERSION_H */ /************************/ /* End of File Comment */ -/************************/ +/************************/ \ No newline at end of file