Code Monkey home page Code Monkey logo

buildnumber's Introduction

Version string with individual build number

Description

To uniquely identify a code loaded on a controller, an individual build number can be used, which changes automatically with each successful compilation run. This build number can then be displayed as part of the version number, e.g. V1.01.0453. This tool creates a header file buildnumber.h with a build number or increments it if the file already exists. The tool should be called in the post-compile process. This ensures that each generated binary code receives an individual build number that can be queried and displayed

Generated code

/* Generated by BuildNumber V2.1 */
 
#ifndef BUILD_NUMBER_H
#define BUILD_NUMBER_H
 
#define BUILDNUMBER BBB // Build number as Integer
#define BUILDNUMBER_STR "BBB" // Build number as String
#define VER_MAJOR MAJOR // Major version number as Integer
#define VER_MINOR MINOR // Minor version number as Integer
#define VERSION_STR "MAJOR.MINOR.BBB" // Version number as String
#define BUILDDATE_STR "YYYY-MM-DD hh:mm:ss" // Creation Date as String
 
#endif

The header file defines the build number as a number (BUILDNUMBER) and as a string (BUILDNUMBER_STR)

sprintf(&display[16], "V%.1u.%.2u.%.3u (MAIN)", VERSION_MAJOR, VERSION_MINOR, BUILDNUMBER); // Fill CANopen manufacturerSoftwareVersion object Ex: V1.01.1233

Usage

Increments the version and build number in a c-header file, or creates the c-header file if it does not exist.

Usage: Buildnumber [<path>] <file> [max]. Buildnumber (-h | -? | /h | /? )

Options: -h -? /h /? Display this screen.

path OPTIONAL Path in which to change or create the header. This is required e.g. when using the MPLABX macro $ {ProjectDir} (or $(ProjectDir) for VS/GCC) to determine the project directory.

file The name of the header file to be modified or created. The default filename is "buildnumber.h". Path can be included.

max OPTIONAL: Maximum build number. MINOR and MINOR are incremented if the build number is greater than max. If max = 0, MAJOR, MINOR and BUIL are reset to 0.0.000.

Example:

c:\microchip\buildnumber.exe ${ProjectDir} ".\buildnumber.h" 99 // Modifies or creates buildnumber.h in the MPLABX project directory with a maximum build number of 99. If greater, the MINOR version is incremented.

Return values

Error No.
Maximum build number reached -4
Error while parsing -3
Could not create file -1
Normal exit 0

buildnumber's People

Contributors

trojanobelix avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.