nobuild.py 419 B

123456789101112131415161718192021222324
  1. #! /usr/bin/env python
  2. # encoding: utf-8
  3. # Thomas Nagy, 2015 (ita)
  4. """
  5. Override the build commands to write empty files.
  6. This is useful for profiling and evaluating the Python overhead.
  7. To use::
  8. def build(bld):
  9. ...
  10. bld.load('nobuild')
  11. """
  12. from waflib import Task
  13. def build(bld):
  14. def run(self):
  15. for x in self.outputs:
  16. x.write('')
  17. for (name, cls) in Task.classes.items():
  18. cls.run = run