returns the list of all targets of the Install and InstallAs Builder.
968997
def FindInstalledFiles(self):
        
        from SCons.Tool import install
        if install._UNIQUE_INSTALLED_FILES is None:
            install._UNIQUE_INSTALLED_FILES = SCons.Util.uniquer_hashables(install._INSTALLED_FILES)
        return install._UNIQUE_INSTALLED_FILES
998221
def get_product_target_mappings_for_targets(self, targets):
    
    product_target_mappings = []
    for target in targets:
      for product in self._products_by_target[target]:
        product_target_mappings.append((product, target))

    return product_target_mappings
590207
protected function getBuilds() {
        if (!$this->_builds) {
            $this->_builds = new BuildList($this->version, $this->solution['sid']);
        }

        return $this->_builds;
    }
73271
def _roots_to_targets(self, build_graph, target_roots):
    """"""
    with self._run_tracker.new_workunit(name='parse', labels=[WorkUnitLabel.SETUP]):
      return [
        build_graph.get_target(address)
        for address
        in build_graph.inject_roots_closure(target_roots, self._fail_fast)
      ]
22926
def build_task(current_target):
    

    target = current_target.config
    try:
        builder = _make_builder(target, current_target)
        build_path = _get_build_path(target, builder)
        if not os.path.exists(build_path):
            os.makedirs(build_path)
        builder.configure(src_dir=target.get("dp.src_dir"), build_dir=build_path)
        builder.build(build_dir=build_path)
        no_install = devpipeline_core.toolsupport.choose_tool_key(
            current_target, _NO_INSTALL_KEYS
        )
        if no_install not in target:
            install_path = target.get(
                devpipeline_core.toolsupport.choose_tool_key(
                    current_target, _INSTALL_PATH_KEYS
                ),
                fallback="install",
            )
            builder.install(build_dir=build_path, install_dir=install_path)
            _find_file_paths(target, os.path.join(build_path, install_path))
    except devpipeline_core.toolsupport.MissingToolKey as mtk:
        current_target.executor.warning(mtk)
1235099
def _find_install_targets(name=None,
                          version=None,
                          pkgs=None,
                          sources=None,
                          skip_suggestions=False,
                          pkg_verify=False,
                          normalize=True,
                          ignore_epoch=False,
                          reinstall=False,
                          refresh=False,
                          **kwargs):
    '''
    
    '''
    was_refreshed = False

    if all((pkgs, sources)):
        return {'name': name,
                'changes': {},
                'result': False,
                'comment': 'Only one of "pkgs" and "sources" is permitted.'}

    # dict for packages that fail pkg.verify and their altered files
    altered_files = {}
    # Get the ignore_types list if any from the pkg_verify argument
    if isinstance(pkg_verify, list) \
            and any(x.get('ignore_types') is not None
                    for x in pkg_verify
                    if isinstance(x, _OrderedDict)
                    and 'ignore_types' in x):
        ignore_types = next(x.get('ignore_types')
                            for x in pkg_verify
                            if 'ignore_types' in x)
    else:
        ignore_types = []

    # Get the verify_options list if any from the pkg_verify argument
    if isinstance(pkg_verify, list) \
            and any(x.get('verify_options') is not None
                    for x in pkg_verify
                    if isinstance(x, _OrderedDict)
                    and 'verify_options' in x):
        verify_options = next(x.get('verify_options')
                            for x in pkg_verify
                            if 'verify_options' in x)
    else:
        verify_options = []

    if __grains__['os'] == 'FreeBSD':
        kwargs['with_origin'] = True

    if salt.utils.platform.is_windows():
        # Windows requires a refresh to establish a pkg db if refresh=True, so
        # add it to the kwargs.
        kwargs['refresh'] = refresh

    resolve_capabilities = kwargs.get('resolve_capabilities', False) and 'pkg.list_provides' in __salt__
    try:
        cur_pkgs = __salt__['pkg.list_pkgs'](versions_as_list=True, **kwargs)
        cur_prov = resolve_capabilities and __salt__['pkg.list_provides'](**kwargs) or dict()
    except CommandExecutionError as exc:
        return {'name': name,
                'changes': {},
                'result': False,
                'comment': exc.strerror}

    if salt.utils.platform.is_windows() and kwargs.pop('refresh', False):
        # We already refreshed when we called pkg.list_pkgs
        was_refreshed = True
        refresh = False

    if any((pkgs, sources)):
        if pkgs:
            desired = _repack_pkgs(pkgs, normalize=normalize)
        elif sources:
            desired = __salt__['pkg_resource.pack_sources'](
                sources,
                normalize=normalize,
            )

        if not desired:
            # Badly-formatted SLS
            return {'name': name,
                    'changes': {},
                    'result': False,
                    'comment': 'Invalidly formatted \'{0}\' parameter. See '
                               'minion log.'.format('pkgs' if pkgs
                                                    else 'sources')}

        to_unpurge = _find_unpurge_targets(desired, **kwargs)
    else:
        if salt.utils.platform.is_windows():
            pkginfo = _get_package_info(name, saltenv=kwargs['saltenv'])
            if not pkginfo:
                return {'name': name,
                        'changes': {},
                        'result': False,
                        'comment': 'Package {0} not found in the '
                                   'repository.'.format(name)}
            if version is None:
                version = _get_latest_pkg_version(pkginfo)

        if normalize:
            _normalize_name = \
                __salt__.get('pkg.normalize_name', lambda pkgname: pkgname)
            desired = {_normalize_name(name): version}
        else:
            desired = {name: version}

        to_unpurge = _find_unpurge_targets(desired, **kwargs)

        # FreeBSD pkg supports `openjdk` and `java/openjdk7` package names
        origin = bool(re.search('/', name))

        if __grains__['os'] == 'FreeBSD' and origin:
            cver = [k for k, v in six.iteritems(cur_pkgs)
                    if v['origin'] == name]
        else:
            cver = cur_pkgs.get(name, [])

        if name not in to_unpurge:
            if version and version in cver \
                    and not reinstall \
                    and not pkg_verify:
                # The package is installed and is the correct version
                return {'name': name,
                        'changes': {},
                        'result': True,
                        'comment': 'Version {0} of package \'{1}\' is already '
                                   'installed'.format(version, name)}

            # if cver is not an empty string, the package is already installed
            elif cver and version is None \
                    and not reinstall \
                    and not pkg_verify:
                # The package is installed
                return {'name': name,
                        'changes': {},
                        'result': True,
                        'comment': 'Package {0} is already '
                                   'installed'.format(name)}

    version_spec = False
    if not sources:
        # Check for alternate package names if strict processing is not
        # enforced. Takes extra time. Disable for improved performance
        if not skip_suggestions:
            # Perform platform-specific pre-flight checks
            not_installed = dict([
                (name, version)
                for name, version in desired.items()
                if not (name in cur_pkgs and (version is None or _fulfills_version_string(cur_pkgs[name], version)))
            ])
            if not_installed:
                try:
                    problems = _preflight_check(not_installed, **kwargs)
                except CommandExecutionError:
                    pass
                else:
                    comments = []
                    if problems.get('no_suggest'):
                        comments.append(
                            'The following package(s) were not found, and no '
                            'possible matches were found in the package db: '
                            '{0}'.format(
                                ', '.join(sorted(problems['no_suggest']))
                            )
                        )
                    if problems.get('suggest'):
                        for pkgname, suggestions in \
                                six.iteritems(problems['suggest']):
                            comments.append(
                                'Package \'{0}\' not found (possible matches: '
                                '{1})'.format(pkgname, ', '.join(suggestions))
                            )
                    if comments:
                        if len(comments) > 1:
                            comments.append('')
                        return {'name': name,
                                'changes': {},
                                'result': False,
                                'comment': '. '.join(comments).rstrip()}

    # Resolve the latest package version for any packages with "latest" in the
    # package version
    wants_latest = [] \
        if sources \
        else [x for x, y in six.iteritems(desired) if y == 'latest']
    if wants_latest:
        resolved_latest = __salt__['pkg.latest_version'](*wants_latest,
                                                         refresh=refresh,
                                                         **kwargs)
        if len(wants_latest) == 1:
            resolved_latest = {wants_latest[0]: resolved_latest}
        if refresh:
            was_refreshed = True
            refresh = False

        # pkg.latest_version returns an empty string when the package is
        # up-to-date. So check the currently-installed packages. If found, the
        # resolved latest version will be the currently installed one from
        # cur_pkgs. If not found, then the package doesn't exist and the
        # resolved latest version will be None.
        for key in resolved_latest:
            if not resolved_latest[key]:
                if key in cur_pkgs:
                    resolved_latest[key] = cur_pkgs[key][-1]
                else:
                    resolved_latest[key] = None
        # Update the desired versions with the ones we resolved
        desired.update(resolved_latest)

    # Find out which packages will be targeted in the call to pkg.install
    targets = {}
    to_reinstall = {}
    problems = []
    warnings = []
    failed_verify = False
    for package_name, version_string in six.iteritems(desired):
        cver = cur_pkgs.get(package_name, [])
        if resolve_capabilities and not cver and package_name in cur_prov:
            cver = cur_pkgs.get(cur_prov.get(package_name)[0], [])

        # Package not yet installed, so add to targets
        if not cver:
            targets[package_name] = version_string
            continue
        if sources:
            if reinstall:
                to_reinstall[package_name] = version_string
                continue
            elif 'lowpkg.bin_pkg_info' not in __salt__:
                continue
            # Metadata parser is available, cache the file and derive the
            # package's name and version
            err = 'Unable to cache {0}: {1}'
            try:
                cached_path = __salt__['cp.cache_file'](version_string, saltenv=kwargs['saltenv'])
            except CommandExecutionError as exc:
                problems.append(err.format(version_string, exc))
                continue
            if not cached_path:
                problems.append(err.format(version_string, 'file not found'))
                continue
            elif not os.path.exists(cached_path):
                problems.append('{0} does not exist on minion'.format(version_string))
                continue
            source_info = __salt__['lowpkg.bin_pkg_info'](cached_path)
            if source_info is None:
                warnings.append('Failed to parse metadata for {0}'.format(version_string))
                continue
            else:
                verstr = source_info['version']
        else:
            verstr = version_string
            if reinstall:
                to_reinstall[package_name] = version_string
                continue
            if not __salt__['pkg_resource.check_extra_requirements'](package_name, version_string):
                targets[package_name] = version_string
                continue
            # No version specified and pkg is installed
            elif __salt__['pkg_resource.version_clean'](version_string) is None:
                if (not reinstall) and pkg_verify:
                    try:
                        verify_result = __salt__['pkg.verify'](
                            package_name,
                            ignore_types=ignore_types,
                            verify_options=verify_options,
                            **kwargs
                        )
                    except (CommandExecutionError, SaltInvocationError) as exc:
                        failed_verify = exc.strerror
                        continue
                    if verify_result:
                        to_reinstall[package_name] = version_string
                        altered_files[package_name] = verify_result
                continue
        version_fulfilled = False
        allow_updates = bool(not sources and kwargs.get('allow_updates'))
        try:
            version_fulfilled = _fulfills_version_string(cver, verstr, ignore_epoch=ignore_epoch, allow_updates=allow_updates)
        except CommandExecutionError as exc:
            problems.append(exc.strerror)
            continue

        # Compare desired version against installed version.
        version_spec = True
        if not version_fulfilled:
            if reinstall:
                to_reinstall[package_name] = version_string
            else:
                version_conditions = _parse_version_string(version_string)
                if pkg_verify and any(oper == '==' for oper, version in version_conditions):
                    try:
                        verify_result = __salt__['pkg.verify'](
                            package_name,
                            ignore_types=ignore_types,
                            verify_options=verify_options,
                            **kwargs
                        )
                    except (CommandExecutionError, SaltInvocationError) as exc:
                        failed_verify = exc.strerror
                        continue
                    if verify_result:
                        to_reinstall[package_name] = version_string
                        altered_files[package_name] = verify_result
                else:
                    log.debug(
                        'Current version (%s) did not match desired version '
                        'specification (%s), adding to installation targets',
                        cver, version_string
                    )
                    targets[package_name] = version_string

    if failed_verify:
        problems.append(failed_verify)

    if problems:
        return {'name': name,
                'changes': {},
                'result': False,
                'comment': ' '.join(problems)}

    if not any((targets, to_unpurge, to_reinstall)):
        # All specified packages are installed
        msg = 'All specified packages are already installed{0}'
        msg = msg.format(
            ' and are at the desired version' if version_spec and not sources
            else ''
        )
        ret = {'name': name,
               'changes': {},
               'result': True,
               'comment': msg}
        if warnings:
            ret.setdefault('warnings', []).extend(warnings)
        return ret

    return (desired, targets, to_unpurge, to_reinstall, altered_files,
            warnings, was_refreshed)
1297157
def target_types_from_build_file_aliases(aliases):
  """"""
  target_types = dict(aliases.target_types)
  for alias, factory in aliases.target_macro_factories.items():
    target_type, = factory.target_types
    target_types[alias] = target_type
  return target_types
1279854
def find_packages_parents_requirements_dists(pkg_names, working_set=None):
    

    dists = []
    # opting for a naive implementation
    targets = set(pkg_names)
    for dist in find_packages_requirements_dists(pkg_names, working_set):
        if dist.project_name in targets:
            continue
        dists.append(dist)
    return dists
1166581
def list_targets():
        
        targets = []
        obj = {
            'pyocd_version' : __version__,
            'version' : { 'major' : 1, 'minor' : 2 },
            'status' : 0,
            'targets' : targets
            }

        for name in TARGET.keys():
            s = Session(None) # Create empty session
            t = TARGET[name](s)
            d = {
                'name' : name,
                'vendor' : t.vendor,
                'part_families' : t.part_families,
                'part_number' : t.part_number,
                'source': 'pack' if hasattr(t, '_pack_device') else 'builtin',
                }
            if t._svd_location is not None:
                svdPath = t._svd_location.filename
                if isinstance(svdPath, six.string_types) and os.path.exists(svdPath):
                    d['svd_path'] = svdPath
            targets.append(d)
        
        # Add targets from cmsis-pack-manager cache.
        for dev in pack_target.ManagedPacks.get_installed_targets():
            try:
                targets.append({
                    'name' : dev.part_number.lower(),
                    'part_families' : dev.families,
                    'part_number' : dev.part_number,
                    'vendor' : dev.vendor,
                    'source' : 'pack',
                    })
            except KeyError:
                pass

        return obj
844892
def all_packages():
    
    establish_cache()
    result = []
    pkgs = javabridge.get_collection_wrapper(
        javabridge.static_call(
            "weka/core/WekaPackageManager", "getAllPackages", "()Ljava/util/List;"))
    for pkge in pkgs:
        result.append(Package(pkge))
    return result
790035
@SuppressWarnings("unchecked")
    private List<Class<? extends FeatureInstaller>> findInstallers() {
        if (scanner != null) {
            final List<Class<? extends FeatureInstaller>> installers = Lists.newArrayList();
            scanner.scan(new ClassVisitor() {
                @Override
                public void visit(final Class<?> type) {
                    if (FeatureUtils.is(type, FeatureInstaller.class)) {
                        installers.add((Class<? extends FeatureInstaller>) type);
                    }
                }
            });
            // sort to unify registration order on different systems
            installers.sort(Comparator.comparing(Class::getName));
            context.registerInstallersFromScan(installers);
        }
        final List<Class<? extends FeatureInstaller>> installers = context.getEnabledInstallers();
        installers.sort(COMPARATOR);
        logger.debug("Found {} installers", installers.size());
        return installers;
    }
934270
function getBuildTargets (isWinSwitch, isPhoneSwitch, projOverride, buildConfig) {
    buildConfig = typeof buildConfig !== 'undefined' ? buildConfig : null;

    var configXML = new ConfigParser(path.join(ROOT, 'config.xml'));
    var targets = [];
    var noSwitches = !(isPhoneSwitch || isWinSwitch);

    // Windows
    if (isWinSwitch || noSwitches) { // if --win or no arg
        var windowsTargetVersion = configXML.getWindowsTargetVersion();
        switch (windowsTargetVersion.toLowerCase()) {
        case '8':
        case '8.0':
            throw new CordovaError('windows8 platform is deprecated. To use windows-target-version=8.0 you must downgrade to cordova-windows@4.');
        case '8.1':
            targets.push(projFiles.win);
            break;
        case '10.0':
        case 'uap':
        case 'uwp':
            targets.push(projFiles.win10);
            break;
        default:
            throw new CordovaError('Unsupported windows-target-version value: ' + windowsTargetVersion);
        }
    }

    // Windows Phone
    if (isPhoneSwitch || noSwitches) { // if --phone or no arg
        var windowsPhoneTargetVersion = configXML.getWindowsPhoneTargetVersion();
        switch (windowsPhoneTargetVersion.toLowerCase()) {
        case '8.1':
            targets.push(projFiles.phone);
            break;
        case '10.0':
        case 'uap':
        case 'uwp':
            if (targets.indexOf(projFiles.win10) < 0) {
                // Already built due to --win or no switches
                // and since the same thing can be run on Phone as Windows,
                // we can skip this one.
                targets.push(projFiles.win10);
            }
            break;
        default:
            throw new CordovaError('Unsupported windows-phone-target-version value: ' + windowsPhoneTargetVersion);
        }
    }

    // apply build target override if one was specified
    if (projOverride) {
        switch (projOverride.toLowerCase()) {
        case '8.1':
            targets = [projFiles.win, projFiles.phone];
            break;
        case '8.1-phone':
            targets = [projFiles.phone];
            break;
        case '8.1-win':
            targets = [projFiles.win];
            break;
        case 'uap':
        case 'uwp':
            targets = [projFiles.win10];
            break;
        default:
            events.emit('warn', 'Ignoring unrecognized --appx parameter passed to build: "' + projOverride + '"');
            break;
        }
    }

    if (buildConfig !== null) {
        // As part of reworking how build and package determine the winning project, set the 'target type' project
        // as part of build configuration.  This will be used for determining the binary to 'run' after build is done.
        if (targets.length > 0) {
            switch (targets[0]) {
            case projFiles.phone:
                buildConfig.targetProject = 'phone';
                break;
            case projFiles.win10:
                buildConfig.targetProject = 'windows10';
                break;
            case projFiles.win:
                /* falls through */
            default:
                buildConfig.targetProject = 'windows';
                break;
            }
        }
    }

    return targets;
}
893903
def all_dependencies(self, target):
    """"""
    for dep in target.closure(bfs=True, **self.target_closure_kwargs):
      yield dep
872305
def build(self, targets: Iterable[str]) -> Iterable[str]:
        
        return generate_source_directories(
            targets, build=self._build, prompt=self._prompt
        )
1284818
def build_all(self) -> BuildProcessStats:
        
        stats = BuildProcessStats()
        for builder in self.builders:
            self.build_by_builder(
                builder=builder,
                stats=stats,
            )
        return stats
682698
def all_pkgs(self):
        
        if not self.packages:
            self.packages = self.get_pkg_list()
        return self.packages
665162
def all_build_jobs(self):
        
        from db.models.build_jobs import BuildJob

        return BuildJob.all.filter(project=self)