Note that there are some explanatory texts on larger screens.

plurals
  1. POGet scons to generate a new build number
    primarykey
    data
    text
    <p>I'd like to get scons to read a previous version number from a file, update a source file with a new version number and current date and then write the number back to the original file ready for the next build.</p> <p>This needs to happen <em>only</em> when the target is out of date. IOW the version number doesn't change if no build takes place. The original file is source controlled and <em>isn't</em> a source file else it could trigger another build on check-in (due to CI). <strong>CLARIFICATION</strong> From scons' point of view the code will always be out of date due to the auto-generated source file but scons will only be run from a Continuous Integration job (Jenkins) when a SCM change is detected.</p> <p>I've looked into <code>AddPostMethod</code>, but this seems to fire for all files within the list of source files.<br> <code>Command</code> and <code>Builder</code> methods use the <code>VARIANT_DIR</code> so I can't edit these files and then check them back in as they no longer map to the repo.</p> <p>I'm hoping I'm just misunderstanding some of the finer details of scons else I'm running out of ideas!</p> <p><strong>Update</strong> Thinking this through some more, Tom's comment is correct. Although I have two files, one version controlled text file (non-source code) and one non-source controlled source file there is no way to check one file in and prevent a continuous build/check-in cycle. Jenkins will see the new text file and spin off a build, and scons will see the new generated file. So unless I delete the generated file at some point, although this seems to go against the workflow of both tools.</p> <p>Does anyone have any method for achieving this? It seems pretty straightforward. Ultimately I just want to generate build numbers each time a build is started.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload