def generate(env): gcr = env.Detect('glib-compile-resources') env.SetDefault(GLIB_COMPILE_RESOURCES=gcr) if env['GLIB_COMPILE_RESOURCES'] is None: print("Could not find glib-compile-resources") env.Exit(1) env.AddMethod(gresource_bundle_builder_wrapper, 'GResourceBundle') env.AddMethod(gresource_method, 'GResource') env['BUILDERS']['_GResourceXMLInternal'] = Builder( action=Action( gresource_xml_build, cmdstr="Generating $TARGET", ), target_factory=env.File, source_factory=GResourceEntry, source_scanner=Scanner( function=gresource_entry_scan, skeys=[GResourceEntry.SCANNER_KEY], ), ) env['BUILDERS']['_GResourceFileInternal'] = Builder( action=Action( '$GLIB_COMPILE_RESOURCES --target=$TARGET $SOURCE', cmdstr="Bundling $TARGET", ), source_scanner=Scanner(function=gresource_xml_scan, ), )
def generate(env): env.AddMethod(wheel_package_builder_wrapper, 'WheelPackage') env.AddMethod(wheel_method, 'Wheel') env['BUILDERS']['_WheelFileInternal'] = Builder( action=Action( wheel_package_build, varlist=[ 'AUTHOR', 'NAME', 'VERSION', 'AUTHOR', 'AUTHOR_EMAIL', 'LICENSE', 'ARCHITECTURE', 'PACKAGE_METADATA', 'SOURCE_URL', 'BUILD', '_WHEEL_ROOT_IS_PURELIB', '_WHEEL_TAG', ], cmdstr="Packaging $TARGET", ), target_factory=env.File, source_factory=lambda s: WheelEntry(s, env.Entry(s)), source_scanner=Scanner( function=wheel_entry_scan, skeys=[WheelEntry.SCANNER_KEY], ), )
def setup(environment): """Sets the .NET build system up for the specified environment @param environment Environment in which the .NET build system will be set up""" msbuild_scanner = Scanner( function = _scan_msbuild_project, skeys = [ '.csproj', '.vcxproj', 'proj' ] ) environment.Append(SCANNERS = msbuild_scanner) environment.AddMethod(_call_msbuild, "MSBuild") environment.AddMethod(_get_build_directory_name, "get_build_directory_name")
def __edp_target_scanner(node, env, path): dependencies = [env['EDP'], env['ERROR_CODES']] dependencies += env.ValgrindTargetScanner(node, path) return dependencies def __edp_emitter(target, source, env): return env.ValgrindEmitter(target, source) __edp_builder = Builder( action=__edp_action, src_suffix='.wpds', src_builder='CilWpds', suffix='.out', target_scanner=Scanner(__edp_target_scanner), single_source=True, emitter=__edp_emitter, ) ######################################################################## def generate(env): if 'EDP' in env['BUILDERS']: return here = File(__file__).dir env.AppendUnique( EDP=here.File('../main/main'), BUILDERS={'EDP': __edp_builder},
def __init__(self, tools_path, **params): self.project_path = os.getcwd().replace('\\', '/') self.Decider('MD5-timestamp') self.deps_analyzer = dependency_analyzer.DependencyAnalyzer() project_db = projectdb.ProjectDB("--obj/project.pickle") project_db['paths'] = { 'graphviz': '', 'python': '', 'inkscape': '', 'tex': '', 'gs': '' } if platform.system() != 'Linux': project_db['paths']['graphviz'] = os.path.join( tools_path, "graphviz", "bin") project_db['paths']['python'] = os.path.join( tools_path, "python27") project_db['paths']['inkscape'] = os.path.join( tools_path, "inkscape") project_db['paths']['tex'] = os.path.join(tools_path, r"xetex\bin\win32") project_db['paths']['gs'] = os.path.join(tools_path, r"xetex\tlpkg\tlgs\bin") os.environ['PATH'] = ';'.join([ project_db['paths']['python'], project_db['paths']['tex'], project_db['paths']['gs'], os.environ['PATH'] ]) self.project_db = project_db Environment.__init__(self, **params) self['ENV']['PATH'] = os.environ['PATH'] self.project_db["include_commands"] = [{ 'regexp': r'\n[^%]*?\\(include|input|localInclude){(?P<relfile>[^#}]+)}', 'file': '%(relfile)s', 'ext': '.tex' }, { 'regexp': r'\n[^%]*?\\(verbatiminput){(?P<relfile>[^#}]+)}', 'file': '%(relfile)s', 'ext': '' }, { 'regexp': r'\n[^%]*?\\(includeOnce){(?P<relfile>[^#}]+)}', 'file': r'\projectpath/%(relfile)s', 'ext': '.tex' }, { 'regexp': r'(?s)\n[^%]*?\\(localPDF)(\[[^\[]*\])?{(?P<relfile>[^#}]+)}', 'file': r'', 'ext': '.pdf' }, { 'regexp': r'\n[^%]*?\\(localSVG)(\[.*\])?{(?P<dir>[^#}]+)}{(?P<relfile>[^#}]+)}', 'file': r'%(dir)s/--obj/%(relfile)s.svg.obj/obj.pdf', 'ext': '' }, { 'regexp': r'\n[^%]*?\\(projectSVG)(\[.*\])?{(?P<dir>[^#}]+)}{(?P<relfile>[^#}]+)}', 'file': r'\projectpath/%(dir)s/--obj/%(relfile)s.svg.obj/obj.pdf', 'ext': '' }] for item in self.project_db["include_commands"]: if "re" not in item: item["re"] = re.compile(item['regexp']) self.executors = {} self.meta_analyzer = mydepends.MetaAnalyzer(self) metascan = Scanner(function=self.meta_analyzer.meta_scan, skeys=['.meta'], recursive=0) self.Append(SCANNERS=metascan) depsscan = Scanner(function=self.meta_analyzer.deps_scan, skeys=['.deps'], recursive=0) self.Append(SCANNERS=depsscan) #texscan = Scanner(function = ds.tex_scan, skeys = ['.tex'], recursive = 0) #self.Append(SCANNERS = texscan ) #svgscan = Scanner(function = ds.svg_scan, skeys = ['.svg'], recursive = 1) #self.Append(SCANNERS = svgscan ) self.warnings = []
def soelim(target, source, env): """ Interpolate files included in [gnt]roff source files using the .so directive. This behaves somewhat like the soelim(1) wrapper around groff, but makes us independent of whether the actual underlying implementation includes an soelim() command or the corresponding command-line option to groff(1). The key behavioral difference is that this doesn't recursively include .so files from the include file. Not yet, anyway. """ t = str(target[0]) s = str(source[0]) dir, f = os.path.split(s) with open(t, 'w') as tfp, open(s, 'r') as sfp: for line in sfp.readlines(): if line[:4] in ['.so ', "'so "]: sofile = os.path.join(dir, line[4:-1]) with open(sofile, 'r') as f: tfp.write(f.read()) else: tfp.write(line) def soscan(node, env, path): c = node.get_text_contents() return re.compile(r"^[\.']so\s+(\S+)", re.M).findall(c) soelimbuilder = Builder(action=Action(soelim), source_scanner=Scanner(soscan))
def generate_actions(source, target, env, for_signature): if "CONFIG_FILE" in env: cmd = '%s -c %s -b %s -p %s > %s' % (TRACEGEN_BIN, env["CONFIG_FILE"], source[1], env['PREDS_PATH'], target[0]) else: cmd = '%s -e negative-error-codes.txt -b %s -p %s > %s' % ( TRACEGEN_BIN, source[1], env['PREDS_PATH'], target[0]) return cmd # We need to add the tracegen executable as a dependency # to ensure that it is built before any tests use this tool def tracegen_scanner(node, env, path): return ['../../tracegen'] __tracegen_builder = Builder(generator=generate_actions, target_scanner=Scanner(tracegen_scanner)) def generate(env): if 'TRACEGEN' in env['BUILDERS']: return env.AppendUnique(BUILDERS={'TRACEGEN': __tracegen_builder}, ) def exists(): return True