Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Build Configuration specific receipe hooks (Read 1801 times)
brownca
Newbies
*
Offline


Posts: 3
Joined: May 18th, 2023
Build Configuration specific receipe hooks
May 22nd, 2023 at 11:10am
Print Post  
Hi,

I have a prebuild script that increments a version number.

I also have a requirement to publish the same code versions to 2 different MCs.  Teensy 4 and Micromod Teensy.

I currently have to run 2 builds and manually hack the version file to prevent incrementing on the 2nd build.

I've thought of a number of ways to improve this, but the simplest would be to have a VS build configuration that does not increment the build number.

Something like: -

# Increment version before build
if (configuration != "Release")
    recipe.hooks.sketch.prebuild.1.pattern=Do Thing()

Is there any way that this is possible?

I'd love to move all this to a build pipeline at some point but it may not be worth the effort.

Thanks, I appreciate any help.
« Last Edit: May 23rd, 2023 at 9:28am by brownca »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Build Configuration specific receipe hooks
Reply #1 - May 23rd, 2023 at 3:27pm
Print Post  
Thanks for the suggestion!

We will add a property in the coming week or two which exposes the Configuration Name in use in VS.  Then your custom script being run by the hook can make its decision based on this.

An alternative to use currently could be to pass e.g. {build.mcu} through to your prebuild script which could then only increment if it is building for a Teensy 4 for example.  If you enable vMicro > Compiler > Show Build properties, you can see all items which can be added to your hook today.
  
Back to top
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: Build Configuration specific receipe hooks
Reply #2 - May 25th, 2023 at 9:43am
Print Post  
If you install the latest forum release (23.0507.2) from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Once installed a new property is available for inclusion in your hooks "vm.solution.configuration_name" which can be passed to the versioning script to see if it is in the right build configuration for the version to be incremented.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint