1
votes

Is it possible to get SCons to remind me to perform a manual step using it's dependancy tracking?

My build uses the .swc output from a .fla, which you can't do using a command-line.

I tried something like:

env.Command(target, sources + SHARED_SOURCES,
            Action(lambda target, source, env: 1, "Out of date: $TARGET"))

But with that method, I have to use Decider('make') or I get:

$ scons --debug=explain
scons: rebuilding `view_bin\RoleplaySkin.swc' because `view_src\RoleplaySkin.fla' changed
Out of date: view_bin\RoleplaySkin.swc
scons: *** [view_bin\RoleplaySkin.swc] Error 1

And, more importantly, SCons never realizes it's cache is out of date, so any change in the Environment or sources since it wrote the signature in .sconsign.dblite means it will allways try to rebuild (and therefore, always fail).

2

2 Answers

0
votes

What about using the Precious method to protect the *.swc output before converting it into a *.fla?

0
votes

How about creating your own RemindMe builder which reminds you and fails to build the target?

It would look something like this:

def remind_me(target, source, env):
  os.remove(target.abspath) #we do not build, we destroy
  print ("This is a friendly reminder, your $SOURCE is out of date, run manual build step")
  return None

reminder = Builder(action = remind_me,
                   suffix = '.swc',
                   src_suffix = '.fla')
env = Environment(BUILDERS = {'RemindMe' : reminder})

#Run builder like this   
swc_file = env.RemindMe('some_fla_file')
final_target = env.BuildWithSWC(some_other_target,swc_file)

This is however only a theory, I have never tried actually deleting the target instead of creating it. It might be worth a try at least.