3 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
9 from waflib import Task
10 from waflib.TaskGen import extension
13 conf.find_program(['resgen'], var='RESGEN')
14 conf.env.RESGENFLAGS = '/useSourcePath'
17 def resx_file(self, node):
19 Bind the .resx extension to a resgen task
21 if not getattr(self, 'cs_task', None):
22 self.bld.fatal('resx_file has no link task for use %r' % self)
24 # Given assembly 'Foo' and file 'Sub/Dir/File.resx', create 'Foo.Sub.Dir.File.resources'
25 assembly = getattr(self, 'namespace', os.path.splitext(self.gen)[0])
26 res = os.path.splitext(node.path_from(self.path))[0].replace('/', '.').replace('\\', '.')
27 out = self.path.find_or_declare(assembly + '.' + res + '.resources')
29 tsk = self.create_task('resgen', node, out)
31 self.cs_task.dep_nodes.extend(tsk.outputs) # dependency
32 self.env.append_value('RESOURCES', tsk.outputs[0].bldpath())
34 class resgen(Task.Task):
36 Compile C# resource files
39 run_str = '${RESGEN} ${RESGENFLAGS} ${SRC} ${TGT}'