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

SconsDynamicallyAddTargetToExecutor — различия между версиями

Материал из CustisWiki

Перейти к: навигация, поиск
м (Новая: <graph> digraph G{ rankdir=LR ResultFile [fontsize=8 shape=box3d] MainFile->ResultFile; edge [style=dashed label="included in" fontsize=8] Generated1->MainFile Generated2->MainFile...)
 
м
Строка 8: Строка 8:
 
  Generated2->MainFile
 
  Generated2->MainFile
 
  Generated3->MainFile
 
  Generated3->MainFile
  Generated4->MainFile
+
   
 
+
 
  edge [color=blue style=solid label=generated]
 
  edge [color=blue style=solid label=generated]
 
  Generator->Generated1
 
  Generator->Generated1
Строка 15: Строка 14:
 
  Generator->Generated3
 
  Generator->Generated3
 
  Generator->Generated4
 
  Generator->Generated4
 +
Generator->Generated5
 
}
 
}
 
</graph>
 
</graph>
Строка 22: Строка 22:
  
 
* <tt>MainFile</tt> includes some <tt>GeneratedNN</tt> files (count of these files is unknown)
 
* <tt>MainFile</tt> includes some <tt>GeneratedNN</tt> files (count of these files is unknown)
* All these <tt>GeneratedNN</tt> files generated by one <tt>Generator</tt> file (for example, python script).
+
* All these <tt>GeneratedNN</tt> files (+some other files) generated by one <tt>Generator</tt> file (for example, python script).
* All these <tt>GeneratedNN</tt> files needed to be rescanned after generation (they can include other files).
+
* All included <tt>GeneratedNN</tt> files needed to be rescanned after generation (they can include other files).
  
 
I scan <tt>MainFile</tt>, and then I see inclusion of <tt>Generated1</tt> file,
 
I scan <tt>MainFile</tt>, and then I see inclusion of <tt>Generated1</tt> file,

Версия 02:05, 9 октября 2009

[svg]


Consider the following situation.

  • MainFile includes some GeneratedNN files (count of these files is unknown)
  • All these GeneratedNN files (+some other files) generated by one Generator file (for example, python script).
  • All included 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…