From a1b6d702ed837ad2dc84a1bff8cf5ee2b6553d46 Mon Sep 17 00:00:00 2001 From: Alex Fabre Date: Fri, 15 Nov 2024 11:02:13 +0100 Subject: [PATCH] script: rename script to project-version This commit also remove mentions to Zephyr project and instead provide three outputs format: - h for C header - hpp for cpp header - cmake for cmake file (zephyr porject for exemple) --- .github/workflows/code-quality.yml | 2 +- .github/workflows/tag-version.yml | 6 +- .gitignore | 5 +- README.md | 63 ++++--- rever.sh => project-version.sh | 161 +++++++++--------- ...ersion.sh => check_script_self_version.sh} | 10 +- 6 files changed, 125 insertions(+), 122 deletions(-) rename rever.sh => project-version.sh (61%) rename test/{check_rever_version.sh => check_script_self_version.sh} (82%) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index ba53085..da3e572 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -30,5 +30,5 @@ jobs: - name: Codespell action uses: codespell-project/actions-codespell@v2 with: - ignore_words_list: rever + ignore_words_list: project-version diff --git a/.github/workflows/tag-version.yml b/.github/workflows/tag-version.yml index f15eb2b..cdeb736 100644 --- a/.github/workflows/tag-version.yml +++ b/.github/workflows/tag-version.yml @@ -18,8 +18,8 @@ jobs: with: fetch-depth: 0 # Fetch all history for all branches and tags - - name: Run rever on itself - run: ./rever.sh -l -o base_version.h -f base -t v + - name: Run project-version on itself + run: ./project-version.sh -l -o version.h -f h -t v - name: Checking version - run: ci-script/check_rever_version.sh rever.sh base_version.h + run: ci-script/check_script_self_version.sh project-version.sh version.h diff --git a/.gitignore b/.gitignore index 484beb4..79450ec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -# Generated file (base format) +# Generated file version.h - -# Generated file (Zephyr format) +version.hpp VERSION diff --git a/README.md b/README.md index 5f49648..3bfadd9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# rever +# project-version A little POSIX shell script that generates a C header containing the version information (Major Minor etc...) of a Git based repository. @@ -11,7 +11,7 @@ The script simply parses the `git describe` command to extract the firmware info The script will generate a C header file. ```sh -./rever.sh -o project/include/version.h +./project-version.sh -o project/include/version.h ``` ### Zephyr project @@ -19,7 +19,7 @@ The script will generate a C header file. The script will generate the cmake version file. ```sh -./rever.sh -f zephyr -o cmake-project/VERSION +./project-version.sh -f zephyr -o cmake-project/VERSION ``` ## Requirements @@ -29,23 +29,24 @@ The script will generate the cmake version file. ## Usage -Clone the repo or simply copy the `rever.sh` script into your repository and let the magic happen. +Clone the repo or simply copy the `project-version.sh` script into your repository and let the magic happen. All available options can be listed with option `-h` ~~~sh -$ ./rever.sh -h -==> rever.sh 0.5.0 +$ ./project-version.sh -h +==> project-version.sh 0.6.0 A little POSIX shell script to generate version information for your C project. -ref: https://github.com/AlexFabre/rever +ref: https://github.com/AlexFabre/project-version Usage: -rever.sh - -f - -f zephyr: Generate a 'VERSION' file, specific to zephyr projects - -f base: (default) Generate the basic rever format file - -o - -t (default 'v') +project-version.sh + -f + -f h : (default) Generate a C header file (.h). + -f hpp : Generate a C++ header file (.hpp). + -f cmake : Generate a cmake variable file. + -o + -t (default 'v') (ex. 'v' will match tags 'v0.3.1' and 'v0.2.1-beta' but not tags '1.3.4' nor 'version3.2.3') -h -v