ctdb-scripts: Support storing statd-callout state in cluster filesystem
[samba4-gss.git] / third_party / waf / waflib / extras / resx.py
blobcaf4d318bb074e0b9cc835515368572a79d3e78d
1 #! /usr/bin/env python
2 # encoding: utf-8
4 import os
5 from waflib import Task
6 from waflib.TaskGen import extension
8 def configure(conf):
9 conf.find_program(['resgen'], var='RESGEN')
10 conf.env.RESGENFLAGS = '/useSourcePath'
12 @extension('.resx')
13 def resx_file(self, node):
14 """
15 Bind the .resx extension to a resgen task
16 """
17 if not getattr(self, 'cs_task', None):
18 self.bld.fatal('resx_file has no link task for use %r' % self)
20 # Given assembly 'Foo' and file 'Sub/Dir/File.resx', create 'Foo.Sub.Dir.File.resources'
21 assembly = getattr(self, 'namespace', os.path.splitext(self.gen)[0])
22 res = os.path.splitext(node.path_from(self.path))[0].replace('/', '.').replace('\\', '.')
23 out = self.path.find_or_declare(assembly + '.' + res + '.resources')
25 tsk = self.create_task('resgen', node, out)
27 self.cs_task.dep_nodes.extend(tsk.outputs) # dependency
28 self.env.append_value('RESOURCES', tsk.outputs[0].bldpath())
30 class resgen(Task.Task):
31 """
32 Compile C# resource files
33 """
34 color = 'YELLOW'
35 run_str = '${RESGEN} ${RESGENFLAGS} ${SRC} ${TGT}'