Set common build variables
333704
def set_build_vars
    warning_flags = ' -W -Wall'
    if 'release' == @config.release
      optimization_flags = " #{@config.optimization_release} -DRELEASE"
    else
      optimization_flags = " #{@config.optimization_dbg} -g"
    end

    # we could make these also arrays of source directories ...
    @settings['APP_SRC_DIR'] = 'src/app'
    @settings['LIB_SRC_DIR'] = 'src/lib'

    # derived settings
    @settings['BUILD_DIR'] = "#{build_dir}"
    @settings['LIB_OUT'] = "#{@settings['BUILD_DIR']}/libs"
    @settings['APP_OUT'] = "#{@settings['BUILD_DIR']}/apps"
    unless @settings['OECORE_TARGET_SYSROOT'].nil? || @settings['OECORE_TARGET_SYSROOT'].empty?
      @settings['SYS_LFLAGS'] = "-L#{@settings['OECORE_TARGET_SYSROOT']}/lib -L#{@settings['OECORE_TARGET_SYSROOT']}/usr/lib"
    end

    # set LD_LIBRARY_PATH
    @settings['LD_LIBRARY_PATH'] = @settings['LIB_OUT']

    # standard settings
    @settings['CXXFLAGS'] += warning_flags + optimization_flags + " #{@config.language_std_cpp}"
    @settings['CFLAGS'] += warning_flags + optimization_flags + " #{@config.language_std_c}"
    if @settings['PRJ_TYPE'] == 'SOLIB'
      @settings['CXXFLAGS'] += ' -fPIC'
      @settings['CFLAGS'] += ' -fPIC'
    end
    # !! don't change order of the following string components without care !!
    @settings['LDFLAGS'] = @settings['LDFLAGS'] + " -L #{@settings['LIB_OUT']} #{@settings['SYS_LFLAGS']} -Wl,--no-as-needed -Wl,--start-group"
  end
683952
def setproject_cmd(argv):
    """"""
    args = dict(enumerate(argv))
    project = os.path.abspath(args.get(1, '.'))
    env = args.get(0, os.environ.get('VIRTUAL_ENV'))
    if not env:
        sys.exit('pew setproject [virtualenv] [project_path]')
    if not (workon_home / env).exists():
        sys.exit("Environment '%s' doesn't exist." % env)
    if not os.path.isdir(project):
        sys.exit('pew setproject: %s does not exist' % project)
    setvirtualenvproject(env, project)
856931
def Build(self):
    """"""
    self.SetupVars()
    self.Clean()

    if not os.path.exists(args.grr_src):
      self.GitCheckoutGRR()
    proto_sdist = self.MakeProtoSdist()
    core_sdist = self.MakeCoreSdist()
    client_sdist = self.MakeClientSdist()
    client_builder_sdist = self.MakeClientBuilderSdist()

    self.InstallGRR(proto_sdist)
    self.InstallGRR(core_sdist)
    self.InstallGRR(client_sdist)
    self.InstallGRR(client_builder_sdist)
    self.BuildTemplates()
    if args.test_repack_install:
      self._RepackTemplates()
      self._InstallInstallers()
1340215
def build(env, ciprcfg, console):
    
    os.putenv('CIPR_PACKAGES', env.package_dir)
    os.putenv('CIPR_PROJECT', env.project_directory)

    build_settings = path.join(env.project_directory, 'build.settings')

    with open(build_settings, 'r') as f:
        data = f.read()

    m = _build_re.search(data)
    if m:
        ver = int(m.group(2))
        data = data.replace(m.group(0), 'CFBundleVersion = "%d"' % (ver + 1))

        with open(build_settings, 'w') as f:
            f.write(data)


    if path.exists(env.build_dir):
        shutil.rmtree(env.build_dir)

    os.makedirs(env.build_dir)

    if path.exists(env.dist_dir):
        shutil.rmtree(env.dist_dir)

    os.makedirs(env.dist_dir)

    console.normal('Building in %s' % env.build_dir)

    console.normal('Copy project files...')
    for src, dst in util.sync_dir_to(env.project_directory, env.build_dir, exclude=['.cipr', '.git', 'build', 'dist', '.*']):
        console.quiet('  %s -> %s' % (src, dst))
        if src.endswith('.lua'):
            _fix_lua_module_name(src, dst)


    console.normal('Copy cipr packages...')
    for package in ciprcfg.packages.keys():
        for src, dst in util.sync_lua_dir_to(path.join(env.package_dir, package), env.build_dir, exclude=['.git'], include=['*.lua']):
            console.quiet('  %s -> %s' % (src, dst))
            if src.endswith('.lua'):
                _fix_lua_module_name(src, dst)

    src = path.join(env.code_dir, 'cipr.lua')
    dst = path.join(env.build_dir, 'cipr.lua')
    shutil.copy(src, dst)

    cmd = AND(clom.cd(env.build_dir), clom[CORONA_SIMULATOR_PATH](env.build_dir))

    console.normal('Be sure to output your app to %s' % env.dist_dir)

    try:
        cmd.shell.execute()
    except KeyboardInterrupt:
        pass
298786
public function setBuild($build, $hash = null)
    {
        $params = [
            'system::core.build' => $build
        ];

        if ($hash) {
            $params['system::core.hash'] = $hash;
        }

        Parameter::set($params);
    }
1045988
def build_config(ctx, target, config_path, c, extra_path, ignore, verbose, silent, debug):
    
    config_builder = LintConfigBuilder()
    try:
        # Config precedence:
        # First, load default config or config from configfile
        if config_path:
            config_builder.set_from_config_file(config_path)
        elif os.path.exists(DEFAULT_CONFIG_FILE):
            config_builder.set_from_config_file(DEFAULT_CONFIG_FILE)

        # Then process any commandline configuration flags
        config_builder.set_config_from_string_list(c)

        # Finally, overwrite with any convenience commandline flags
        if ignore:
            config_builder.set_option('general', 'ignore', ignore)
        if silent:
            config_builder.set_option('general', 'verbosity', 0)
        elif verbose > 0:
            config_builder.set_option('general', 'verbosity', verbose)

        if extra_path:
            config_builder.set_option('general', 'extra-path', extra_path)

        if target:
            config_builder.set_option('general', 'target', target)

        if debug:
            config_builder.set_option('general', 'debug', debug)

        config = config_builder.build()

        return config, config_builder
    except LintConfigError as e:
        click.echo(u"Config Error: {0}".format(ustr(e)))
    ctx.exit(CONFIG_ERROR_CODE)
627242
@Override
    public void makeBuildVariables(AbstractBuild build, Map<String, String> variables) {
        // global var/password pairs
        MaskPasswordsConfig config = MaskPasswordsConfig.getInstance();
        List<VarPasswordPair> globalVarPasswordPairs = config.getGlobalVarPasswordPairs();
        // we can't use variables.putAll() since passwords are ciphered when in varPasswordPairs
        for(VarPasswordPair globalVarPasswordPair: globalVarPasswordPairs) {
            variables.put(globalVarPasswordPair.getVar(), globalVarPasswordPair.getPassword());
        }

        // job's var/password pairs
        if(varPasswordPairs != null) {
            // cf. comment above
            for(VarPasswordPair varPasswordPair: varPasswordPairs) {
                if(StringUtils.isNotBlank(varPasswordPair.getVar())) {
                    variables.put(varPasswordPair.getVar(), varPasswordPair.getPassword());
                }
            }
        }
    }
984607
def SetupVars(self):
    """"""
    # Python paths chosen to match appveyor:
    # http://www.appveyor.com/docs/installed-software#python

    self.python_dir_64 = args.python64_dir
    self.python_dir_32 = args.python32_dir

    self.virtualenv_bin64 = os.path.join(self.python_dir_64,
                                         r"Scripts\virtualenv.exe")
    self.virtualenv_bin32 = os.path.join(self.python_dir_32,
                                         r"Scripts\virtualenv.exe")

    if args.virtualenv_64bit:
      self.virtualenv64 = args.virtualenv_64bit
    else:
      self.virtualenv64 = os.path.join(args.build_dir, "python_64")
    if args.virtualenv_32bit:
      self.virtualenv32 = args.virtualenv_32bit
    else:
      self.virtualenv32 = os.path.join(args.build_dir, "python_32")

    self.grr_client_build64 = os.path.join(self.virtualenv64,
                                           r"Scripts\grr_client_build.exe")
    self.grr_client_build32 = os.path.join(self.virtualenv32,
                                           r"Scripts\grr_client_build.exe")
    self.pip64 = os.path.join(self.virtualenv64, r"Scripts\pip.exe")
    self.pip32 = os.path.join(self.virtualenv32, r"Scripts\pip.exe")

    self.virtualenv_python64 = os.path.join(self.virtualenv64,
                                            r"Scripts\python.exe")
    self.virtualenv_python32 = os.path.join(self.virtualenv32,
                                            r"Scripts\python.exe")

    self.git = r"C:\Program Files\Git\bin\git.exe"

    self.install_path = r"C:\Windows\System32\GRR"
    self.service_name = "GRR Monitor"

    self.expect_service_running = args.expect_service_running
689503
def get_standard_vars(cls, context, variant, build_type, install,
                          build_path, install_path=None):
        
        from rez.config import config

        package = variant.parent
        variant_requires = map(str, variant.variant_requires)

        if variant.index is None:
            variant_subpath = ''
        else:
            variant_subpath = variant._non_shortlinked_subpath

        vars_ = {
            'REZ_BUILD_ENV': 1,
            'REZ_BUILD_PATH': build_path,
            'REZ_BUILD_THREAD_COUNT': package.config.build_thread_count,
            'REZ_BUILD_VARIANT_INDEX': variant.index or 0,
            'REZ_BUILD_VARIANT_REQUIRES': ' '.join(variant_requires),
            'REZ_BUILD_VARIANT_SUBPATH': variant_subpath,
            'REZ_BUILD_PROJECT_VERSION': str(package.version),
            'REZ_BUILD_PROJECT_NAME': package.name,
            'REZ_BUILD_PROJECT_DESCRIPTION': (package.description or '').strip(),
            'REZ_BUILD_PROJECT_FILE': package.filepath,
            'REZ_BUILD_SOURCE_PATH': os.path.dirname(package.filepath),
            'REZ_BUILD_REQUIRES': ' '.join(
                str(x) for x in context.requested_packages(True)
            ),
            'REZ_BUILD_REQUIRES_UNVERSIONED': ' '.join(
                x.name for x in context.requested_packages(True)
            ),
            'REZ_BUILD_TYPE': build_type.name,
            'REZ_BUILD_INSTALL': 1 if install else 0,
        }

        if install_path:
            vars_['REZ_BUILD_INSTALL_PATH'] = install_path

        if config.rez_1_environment_variables and \
                not config.disable_rez_1_compatibility and \
                build_type == BuildType.central:
            vars_['REZ_IN_REZ_RELEASE'] = 1

        return vars_
612384
@Override
    public void buildEnvironment(Run<?,?> build, EnvVars env) {
        env.put(name,value);
        env.put(name.toUpperCase(Locale.ENGLISH),value); // backward compatibility pre 1.345
    }
658590
def _include_environment_variables(self, program, executor_vars):
        """"""
        env_vars = {
            'RESOLWE_HOST_URL': self.settings_actual.get('RESOLWE_HOST_URL', 'localhost'),
        }

        set_env = self.settings_actual.get('FLOW_EXECUTOR', {}).get('SET_ENV', {})
        env_vars.update(executor_vars)
        env_vars.update(set_env)

        export_commands = ['export {}={}'.format(key, shlex.quote(value)) for key, value in env_vars.items()]
        return os.linesep.join(export_commands) + os.linesep + program
199438
def set_env_var(key: str, value: str):
        
        elib_run.run(f'appveyor SetVariable -Name {key} -Value {value}')
        AV.info('Env', f'set "{key}" -> "{value}"')
258352
def prepare_build_dir(self):
        ''''''
        self.build_dir = self.get_build_dir()
        self.common_dir = self.get_common_dir()
        copy_files(join(self.bootstrap_dir, 'build'), self.build_dir)
        copy_files(join(self.common_dir, 'build'), self.build_dir,
                   override=False)
        if self.ctx.symlink_java_src:
            info('Symlinking java src instead of copying')
            shprint(sh.rm, '-r', join(self.build_dir, 'src'))
            shprint(sh.mkdir, join(self.build_dir, 'src'))
            for dirn in listdir(join(self.bootstrap_dir, 'build', 'src')):
                shprint(sh.ln, '-s', join(self.bootstrap_dir, 'build', 'src', dirn),
                        join(self.build_dir, 'src'))
        with current_directory(self.build_dir):
            with open('project.properties', 'w') as fileh:
                fileh.write('target=android-{}'.format(self.ctx.android_api))
1074509
public void collectVariables(EnvVars env, Run build, TaskListener listener) {
        EnvVars buildParameters = Utils.extractBuildParameters(build, listener);
        if (buildParameters != null) {
            env.putAll(buildParameters);
        }
        addAllWithFilter(envVars, env, filter.getPatternFilter());
        Map<String, String> sysEnv = new HashMap<>();
        Properties systemProperties = System.getProperties();
        Enumeration<?> enumeration = systemProperties.propertyNames();
        while (enumeration.hasMoreElements()) {
            String propertyKey = (String) enumeration.nextElement();
            sysEnv.put(propertyKey, systemProperties.getProperty(propertyKey));
        }
        addAllWithFilter(sysVars, sysEnv, filter.getPatternFilter());
    }
16463
def setup_parser_common(parser):
    """"""
    from rez.build_process_ import get_build_process_types
    from rez.build_system import get_valid_build_systems

    process_types = get_build_process_types()
    parser.add_argument(
        "--process", type=str, choices=process_types, default="local",
        help="the build process to use (default: %(default)s).")

    # add build system choices valid for this package
    package = get_current_developer_package()
    clss = get_valid_build_systems(os.getcwd(), package=package)

    if clss:
        if len(clss) == 1:
            cls_ = clss[0]
            title = "%s build system arguments" % cls_.name()
            group = parser.add_argument_group(title)
            cls_.bind_cli(parser, group)

        types = [x.name() for x in clss]
    else:
        types = None

    parser.add_argument(
        "-b", "--build-system", dest="buildsys", choices=types,
        help="the build system to use. If not specified, it is detected. Set "
        "'build_system' or 'build_command' to specify the build system in the "
        "package itself.")

    parser.add_argument(
        "--variants", nargs='+', type=int, metavar="INDEX",
        help="select variants to build (zero-indexed).")
    parser.add_argument(
        "--ba", "--build-args", dest="build_args", metavar="ARGS",
        help="arguments to pass to the build system. Alternatively, list these "
        "after a '--'.")
    parser.add_argument(
        "--cba", "--child-build-args", dest="child_build_args", metavar="ARGS",
        help="arguments to pass to the child build system, if any. "
        "Alternatively, list these after a second '--'.")
1264798
def build(id=None, name=None, revision=None,
          temporary_build=False, timestamp_alignment=False,
          no_build_dependencies=False,
          keep_pod_on_failure=False,
          force_rebuild=False,
          rebuild_mode=common.REBUILD_MODES_DEFAULT):
    
    data = build_raw(id, name, revision, temporary_build, timestamp_alignment, no_build_dependencies,
              keep_pod_on_failure, force_rebuild, rebuild_mode)
    if data:
        return utils.format_json(data)
251608
def change(self, key, value):
        """"""
        self.obj[key] = value
        self.changes.append("Updating build:{}.{}={}"
                            .format(self.obj['name'], key, value))
        return self