Open-CMSIS-Pack / cbuild2cmake

A command line tool that generates CMakeLists.txt file from *.cbuild.yml files generated by csolution
Apache License 2.0
3 stars 2 forks source link

Show "execute:" description when running executes commands #125

Closed EaselinkBachmann closed 1 month ago

EaselinkBachmann commented 1 month ago

Currently, the command description when running the execute command during the build is just the command itself. This PR changes the CMake COMMENT for the custom target/command so that while the execute command is run the user-given description is shown instead of the raw command.

This makes the build output look a bit cleaner. The output isn't perfect since the description is present in the cbuild-idx.yml in a mangled form to be suitable for a CMake target name. For perfect user experience that should probably be a human-readable name including spaces.

Example

  executes:
    - execute: Generating foobar source
      run: python $input(0)$ $input(1)$ -o $output(0)$
      input:
        - scripts/generate.py
        - src/foobar.in
      output:
        - src/foobar.c

Current Output

[2/11] cd /path/to/project/tmp && python /path/to/project/scripts/generate.py /path/to/project/src/foobar.in -o /path/to/project/src/foobar.c

New Output

[2/11] project+context-Generating_foobar_source

Optimal Output

[2/11] project+context: Generating foobar source
jkrech commented 1 month ago

@EaselinkBachmann, thanks a lot for your proposal and PR. You feedback about the execute identifier vs. description is valid and is something to clarify in the specification. Probably having an ID with a restricted character set suitable for Makefile targets versus a separate description is something to think about.

codeclimate[bot] commented 1 month ago

Code Climate has analyzed commit 02c1462b and detected 0 issues on this pull request.

View more on Code Climate.

EaselinkBachmann commented 1 month ago

Thanks! I didn't notice the unit tests. I updated the tests in the latest push to contain the new executes CMake COMMENT.

jkrech commented 1 month ago

Thanks! I didn't notice the unit tests. I updated the tests in the latest push to contain the new executes CMake COMMENT.

That's not your fault. You could not notice it as I had to allow the run manually as this is a PR from "outside" user.