Skip to content

Commit

Permalink
Close nasa#46, Add build number and baseline
Browse files Browse the repository at this point in the history
Add macros for build number and baseline
Add macros for version string
Use version string macro in version report
  • Loading branch information
Gerardo E. Cruz-Ortiz committed Aug 5, 2020
1 parent fdc1ed1 commit 7757b95
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 17 deletions.
3 changes: 1 addition & 2 deletions fsw/src/sch_lab_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
54 changes: 39 additions & 15 deletions fsw/src/sch_lab_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
/************************/
/************************/

0 comments on commit 7757b95

Please sign in to comment.