[Scons-users] Custom Builders / Command / Execute

Bill Deegan bill at baddogconsulting.com
Tue Nov 1 10:44:33 EDT 2016


Please respond to me earlier email..
See comments below.

On Tue, Nov 1, 2016 at 2:25 PM, Pierre-Luc Boily <pierreluc.boily at gmail.com>
wrote:

> Thx William
>
> I have to admit that your "/No/" answer to my question number two raises
> another question: "Then, how should I trigger the batchfile created in my
> custom builder!?"
>
> See my custom builder  here <http://pastebin.com/8KbcztVg>   and
> SConscript
> here <http://pastebin.com/Jc0S6sAj>  .  My custom builder does 3 things :
> 1 - Create a batch file.  I do this because I really need to have to cd to
> another folder.
>

Not (always) necessary, you can cd to the other folder in your command
string.


> 2 - Launch the batch file.  (This generate binaries to LINK folder)
> 3 - Copy source files to LINK folder.  (using /shutil.copy/ and /copytree/)
>
Don't do this with shutil... SCons will not know about the files being
copied.  Use Copy, or Install().


>
> So, if my sources change, I need to repeat number 1, 2, and 3 above, but
> number 3 is not really needed by 1 and 2.
>
> Question
> a - Do you think custom builder is the best approach or should I use scons
> Command instead to launch my batch?.  I still need number 3 to be done only
> when needed (when source files change).  I am looking to ToolsForFool and I
> suspect that custom builder might be too much for step 1 and 2, but might
> be
> needed because of step 3.
>

Not likely necessary at all.
I'm guessing a combination of normal Command() and Install() calls will do
what you want.

Is "sideLibrary.jar" also built by SCons and then used?
You should pretty much always use env.Glob(), instead of glob.glob inside
of SCons.

Fundamentally it looks like most of your problems are as follows:
1. You see that SCons is a python based build system
2. You use python "actions" as a first choice, instead of SCons actions
3. Things don't work correctly and you end up confused.

You're not alone, this is a common mistake.

Here's what I see from your "builder" (It's really more of a PseudoBuilder)
1.  you run sideLibrary.jar which "compiles" GSL Grammer -> SRGS Grammer ->
a binary
2. you copy a bunch of source files around

Note you pretty much never tell SCons what you are doing.



>
> (Thx a lot for your patience since 2 weeks....)
>
>
>
> --
> View this message in context: http://scons.1086193.n5.
> nabble.com/Custom-Builders-Command-Execute-tp40687p40690.html
> Sent from the Users mailing list archive at Nabble.com.
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20161101/d3738e0e/attachment.html>


More information about the Scons-users mailing list