Персональные инструменты
 

SconsDynamicallyAddTargetToExecutor

Материал из CustisWiki

Версия от 21:55, 8 октября 2009; StasFomin (обсуждение | вклад) (Новая: <graph> digraph G{ rankdir=LR ResultFile [fontsize=8 shape=box3d] MainFile->ResultFile; edge [style=dashed label="included in" fontsize=8] Generated1->MainFile Generated2->MainFile...)

(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

[svg]


Consider the following situation.

  • MainFile includes some GeneratedNN files (count of these files is unknown)
  • All these GeneratedNN files generated by one Generator file (for example, python script).
  • All these GeneratedNN files needed to be rescanned after generation (they can include other files).

I scan MainFile, and then I see inclusion of Generated1 file, I add something like this:

    cmd=env.Command(Generated1, Generator, RunMePlease)

But actually I need

    cmd=env.Command([Generated1,Generated2,…,GeneratedN], Generator, RunMePlease) 

but I must add targets incrementally during MainFile scan…

Question.svg So the question is: How to dynamically add targets to Command? I try something like

Generator.executor.targets.append(env.fs.Entry(GeneratedN))

but it seems not working…