def reconfigure(ctx): '''rerun configure if necessary''' if not os.path.exists(os.environ.get('WAFLOCK', '.lock-wscript')): raise Errors.WafError('configure has not been run') import samba_wildcard bld = samba_wildcard.fake_build_environment() Configure.autoconfig = True Scripting.check_configured(bld)
def fake_build_environment(info=True, flush=False): """create all the tasks for the project, but do not run the build return the build context in use""" bld = getattr(Context.g_module, 'build_context', Utils.Context)() bld = Scripting.check_configured(bld) Options.commands['install'] = False Options.commands['uninstall'] = False bld.is_install = 0 # False try: proj = ConfigSet.ConfigSet(Options.lockfile) except IOError: raise Errors.WafError( "Project not configured (run 'waf configure' first)") bld.load_envs() if info: Logs.info("Waf: Entering directory `%s'" % bld.bldnode.abspath()) bld.add_subdirs([os.path.split(Context.g_module.root_path)[0]]) bld.pre_build() if flush: bld.flush() return bld