Resolves the specified confs for the configured targets and returns an iterator over
    tuples of (conf, jar path).
330030
def execute(self):
    
    if JvmResolveSubsystem.global_instance().get_options().resolver != 'ivy':
      return

    compile_classpath = self.context.products.get_data('compile_classpath',
        init_func=ClasspathProducts.init_func(self.get_options().pants_workdir))

    targets = self.context.targets()
    if all(not isinstance(target, JarLibrary) for target in targets):
      if self._report:
        self.context.log.info("Not generating a report. No resolution performed.")
      return

    executor = self.create_java_executor()
    results = self.resolve(executor=executor,
                                      targets=targets,
                                      classpath_products=compile_classpath,
                                      confs=self.get_options().confs,
                                      extra_args=self._args)
    if self._report:
      results_with_resolved_artifacts = [r for r in results if r.has_resolved_artifacts]

      if not results_with_resolved_artifacts:
        self.context.log.info("Not generating a report. No resolution performed.")
      else:
        for result in results_with_resolved_artifacts:
          self._generate_ivy_report(result)
1018207
def files_for_target(self, target):
    
    def gen():
      # Compute src -> target.
      if isinstance(target, JvmTarget):
        for src in target.sources_relative_to_buildroot():
          yield os.path.join(self.buildroot, src)
      # TODO(Tejal Desai): pantsbuild/pants/65: Remove java_sources attribute for ScalaLibrary
      if isinstance(target, ScalaLibrary):
        for java_source in target.java_sources:
          for src in java_source.sources_relative_to_buildroot():
            yield os.path.join(self.buildroot, src)

      # Compute classfile -> target and jar -> target.
      files = ClasspathUtil.classpath_contents((target,), self.runtime_classpath)
      # And jars; for binary deps, zinc doesn't emit precise deps (yet).
      cp_entries = ClasspathUtil.classpath((target,), self.runtime_classpath)
      jars = [cpe for cpe in cp_entries if ClasspathUtil.is_jar(cpe)]
      for coll in [files, jars]:
        for f in coll:
          yield f
    return set(gen())
284282
def iterifs(self):
        '''  '''
        if_path = os.path.join(SYSFS_NET_PATH, self.name, b"brif")
        net_files = os.listdir(if_path)
        for iface in net_files:
            yield iface
546898
function resolve(opts, done) {
  debug('resolving paths for globs:\n', JSON.stringify(opts.globs));
  var tasks = opts.globs.map(function(pattern) {
    return function(cb) {
      debug('resolving `%s`...', pattern);
      glob(pattern, {}, function(err, files) {
        if (err) {
          return cb(err);
        }
        debug('resolved %d file(s) for `%s`', files.length, pattern);
        if (files.length > 0) {
          opts.files.push.apply(opts.files, files);
        }
        cb();
      });
    };
  });
  async.parallel(tasks, function(err) {
    if (err) {
      return done(err);
    }
    debug('checking and removing duplicate paths...');
    opts.files = unique(opts.files);
    debug('final result has `%d` files', opts.files.length);
    done(null, opts.files);
  });
}
1035046
function resolveConfigFilePath(project_dir, platform, file) {
    var filepath = path.join(project_dir, file);
    var matches;


    if (file.indexOf('*') > -1 && file.indexOf('plist') > -1) {
        project_dir = path.join(project_dir);
        // handle wildcards in targets using glob.
        matches = modules.glob.sync(path.join(project_dir, '**', file));
        if (matches.length) filepath = matches[0];
        else {
            project_dir = path.join(project_dir, '..');
            // handle wildcards in targets using glob.
            matches = modules.glob.sync(path.join(project_dir, '**', file));
            if (matches.length) filepath = matches[0];
        }

        // [CB-5989] multiple Info.plist files may exist. default to $PROJECT_NAME-Info.plist
        if(matches.length > 1 && file.indexOf('-Info.plist')>-1){
            var plistName =  getIOSProjectname(project_dir)+'-Info.plist';
            for (var i=0; i < matches.length; i++) {
                if(matches[i].indexOf(plistName) > -1){
                    filepath = matches[i];
                    break;
                }
            }
        }
        return filepath;
    }else if (platform === 'ios' && (file != 'config.xml' || file != 'JudpluginConfig.xml')){
        return filepath = path.join(project_dir, getIOSProjectname(project_dir), file);
    }

    // special-case config.xml target that is just "config.xml". This should be resolved to the real location of the file.
    // TODO: move the logic that contains the locations of config.xml from cordova CLI into plugman.
    if (file == 'config.xml') {
        if (platform == 'ubuntu') {
            filepath = path.join(project_dir, 'config.xml');
        } else if (platform == 'ios') {
            var iospath = getIOSProjectname(project_dir);
            filepath = path.join(project_dir,iospath, 'config.xml');
        } else if (platform == 'android') {
            filepath = path.join(project_dir, 'res', 'xml', 'config.xml');
        } else {
            matches = modules.glob.sync(path.join(project_dir, '**', 'config.xml'));
            if (matches.length) filepath = matches[0];
        }
        return filepath;
    }

    // XXX this checks for android studio projects
    // only if none of the options above are satisfied does this get called
    if(platform === 'android' && !fs.existsSync(filepath)) {
      // JUD_HOOK_START
      if (file === 'AndroidManifest.xml') {
          filepath = path.join(project_dir, 'judplugin', 'src', 'main', 'AndroidManifest.xml');
      } else {
          filepath = path.join(project_dir, 'judplugin', 'src', 'main', 'res', 'xml', 'config.xml');
      }
      // JUD_HOOK_END
    }

    // None of the special cases matched, returning project_dir/file.
    return filepath;
}
1052907
protected T resolve(String sKey, T value) {
        LOG.error("Fail to find environment [{}] in {}", sKey, this.keySet());
        throw new MultiEnvSupportException(String.format(
                "Fail to find configuration for environment %s", sKey));
    }
571268
def raise_unresolved_targets(build_context, conf, unknown_seeds, seed_refs):
    """"""

    def format_target(target_name):
        # TODO: suggest similar known target names
        build_module = split_build_module(target_name)
        return '{} (in {})'.format(target_name,
                                   conf.get_build_file_path(build_module))

    def format_unresolved(seed):
        if seed not in seed_refs:
            return seed
        seed_ref = seed_refs[seed]
        reasons = []
        if seed_ref.on_cli:
            reasons.append('seen on command line')
        if seed_ref.from_default:
            reasons.append('specified as default target in {}'
                           .format(conf.get_project_build_file))
        if seed_ref.dep_of:
            reasons.append(
                'dependency of ' +
                ', '.join(format_target(target_name)
                          for target_name in sorted(seed_ref.dep_of)))
        if seed_ref.buildenv_of:
            reasons.append(
                'buildenv of ' +
                ', '.join(format_target(target_name)
                          for target_name in sorted(seed_ref.buildenv_of)))

        return '{} - {}'.format(seed, ', '.join(reasons))

    unresolved_str = '\n'.join(format_unresolved(target_name)
                               for target_name in sorted(unknown_seeds))
    num_target_str = '{} target'.format(len(unknown_seeds))
    if len(unknown_seeds) > 1:
        num_target_str += 's'
    raise ValueError('Could not resolve {}:\n{}'
                     .format(num_target_str, unresolved_str))
1078997
private ClassLoader doResolve(Set<? extends File> classPath) {
        List<URL> urls = new ArrayList<URL>(classPath.size());
        for (File file : classPath) {
            try {
                urls.add(file.toURI().toURL());
            } catch (MalformedURLException exception) {
                throw new GradleException("Cannot resolve " + file + " as URL", exception);
            }
        }
        return new URLClassLoader(urls.toArray(new URL[0]), ByteBuddy.class.getClassLoader());
    }
172936
@SuppressWarnings("IndexOfReplaceableByContains")
    public static List<File> resolvePath(File incPath, File cwd) {
        if(cwd == null)
            cwd = new File(Config.getHomeDir());

        //if incPath start with eg: ./, remove it
        if(incPath.toString().startsWith(CURRENT_WITH_SEPARATOR)) {
            incPath = new File(incPath.toString().substring(CURRENT_WITH_SEPARATOR.length()));
        }

        if(incPath.toString().startsWith(TILDE_WITH_SEPARATOR)) {
            if(Config.getHomeDir().endsWith(Config.getPathSeparator()))
                incPath = new File(Config.getHomeDir()+incPath.toString().substring(2));
            else
                incPath = new File(Config.getHomeDir()+incPath.toString().substring(1));
        }

        if(incPath.toString().indexOf(TILDE) == 0) {
            if(incPath.toString().length() > 1) {
                // directories which name starts with tilde
                incPath = new File(cwd.toString() + Config.getPathSeparator() + incPath.toString());
            } else {
                incPath = new File(Config.getHomeDir());
            }
        }

        //  foo1/./foo2 is changed to foo1/foo2
        if(incPath.toString().indexOf(SEPARATOR_CURRENT_SEPARATOR) > -1) {
            int index = incPath.toString().indexOf(SEPARATOR_CURRENT_SEPARATOR);
            if(index == 0) {
                incPath = new File(incPath.toString().substring(SEPARATOR_CURRENT_SEPARATOR.length()-1));
            }
            else {
                incPath = new File(incPath.toString().substring(0, index) +
                        incPath.toString().substring(index+2, incPath.toString().length()));
            }
        }

        //parentPath do not start with / or by a windows driver letter and cwd is not / either
        if( incPath.toString().indexOf(ROOT) != 0 && incPath.toString().indexOf(DRIVER_SEPARATOR) == -1 && !cwd.toString().equals(ROOT)) {
            if(cwd.toString().endsWith(Config.getPathSeparator()))
                incPath = new File(cwd.toString() + incPath.toString());
            else
                incPath = new File(cwd.toString() + Config.getPathSeparator() + incPath.toString());
        }

        if(incPath.toString().indexOf(PARENT_WITH_SEPARATOR) > -1) {
            String tmp = incPath.toString();
            while(tmp.indexOf(PARENT_WITH_SEPARATOR) > -1) {
                int index = tmp.indexOf(PARENT_WITH_SEPARATOR);
                if(index == 0) {
                    tmp = tmp.substring(PARENT_WITH_SEPARATOR.length());
                }
                else {
                    File tmpFile = new File(tmp.substring(0, index));
                    tmpFile = tmpFile.getParentFile();
                    if(tmpFile == null)
                        tmpFile = new File(Config.getPathSeparator());
                    tmpFile = new File(tmpFile.toString() + tmp.substring(index+ PARENT_WITH_SEPARATOR.length()-1));
                    //tmp = tmp.substring(0, index) + tmp.substring(index+PARENT_WITH_SEPARATOR.length());
                    tmp = tmpFile.toString();
                }
            }
            incPath = new File(tmp);
        }

        if(incPath.toString().endsWith(PARENT)) {
            incPath = new File(incPath.toString().substring(0, incPath.toString().length()-PARENT.length()));
            incPath = incPath.getParentFile();
            if(incPath == null)
                incPath = new File(Config.getPathSeparator());
        }

        if( incPath.toString().indexOf(STAR) > -1 || incPath.toString().indexOf(WILDCARD) > -1) {
            PathCriteria pathCriteria = parsePath(incPath);
            if(incPath.toString().indexOf(SEPARATOR) > -1) {
                List<File> foundFiles  = null;
                if(pathCriteria.getCriteria().equals(String.valueOf(STAR))) {
                    foundFiles = new ArrayList<>();
                    foundFiles.add(new File(pathCriteria.getParentPath()));
                }
                else
                    foundFiles = findFiles(new File(pathCriteria.parentPath), pathCriteria.getCriteria(), false);
                if(pathCriteria.childPath.length() == 0)
                    return foundFiles;
                else {
                    List<File> outFiles = new ArrayList<>();
                    for(File f : foundFiles)
                        if(new File(f+Config.getPathSeparator()+pathCriteria.childPath).exists())
                            outFiles.add(new File(f+Config.getPathSeparator()+pathCriteria.childPath));

                    return outFiles;
                }
            }
            //just wildcard without separators
            else {
                if(incPath.toString().length() == 1) {
                    List<File> foundFiles = findFiles(new File(pathCriteria.parentPath), pathCriteria.getCriteria(), false);
                    if(pathCriteria.childPath.length() == 0)
                        return foundFiles;
                }

                return new ArrayList<File>();
            }
        }
        else {
            //no wildcards
            ArrayList<File> fileList = new ArrayList<>(1);
            fileList.add(incPath);
            return fileList;
        }
    }
440236
def compute_targets_to_build(self, targets: Iterable[str]) -> Iterable[BuildTarget]:
        
        normalized_targets = set()
        for target in targets:
            normalized_targets.update(self._normalize_target(target))

        targets_to_parse = deque(normalized_targets)
        targets_seen = set(normalized_targets)
        targets_not_found = []
        build_targets = set()

        while targets_to_parse:
            next_target_string = targets_to_parse.popleft()
            next_target = self._parse_target(next_target_string)
            build_file = self.parser.parse_file(next_target.build_file_directory)
            if next_target.name not in build_file.targets:
                targets_not_found.append(next_target_string)
                continue
            target_to_build = build_file.targets[next_target.name]
            build_targets.add(target_to_build)

            new_targets = [
                dependency
                for dependency in target_to_build.dependencies
                if dependency not in targets_seen
            ]
            targets_to_parse.extend(new_targets)
            targets_seen.update(new_targets)

        if targets_not_found and self.fail_on_unbuilt_target:
            raise BuilderException(
                "Target(s) could not be built: {}".format(", ".join(targets_not_found)),
                targets=targets_not_found,
            )
        return build_targets
979062
private void symLinkAndConfigureFiles(JobConf job) throws IOException {
    if (!(job.getBoolean("mapred.used.genericoptionsparser", false))) {
      LOG.warn("Use GenericOptionsParser for parsing the arguments. " +
               "Applications should implement Tool for the same.");
    }

    // get all the command line arguments into the
    // jobconf passed in by the user conf
    String files = job.get("tmpfiles");
    String archives = job.get("tmparchives");
    // "tmpjars" are not needed because its in the classpath

    List<String> filesToSymLink = new ArrayList<String>();
    splitAndAdd(files, filesToSymLink);
    splitAndAdd(archives, filesToSymLink);

    for (String file : filesToSymLink) {
      String target = new Path(file).toUri().getPath();
      String basename = new File(target).getName();
      String linkName = new File(".").getAbsolutePath() + File.separator + basename;
      File toLink = new File(linkName);
      if (toLink.exists()) {
        LOG.info("Symlink " + linkName + " already exists. Delete it.");
        toLink.delete();
      }
      int ret = FileUtil.symLink(target, linkName);
      LOG.info("Creating symlink " + linkName + " -> " + target +
          " returns " + ret + ".");
    }
    // Configure job name
    String originalJar = job.getJar();
    if (originalJar != null) {
      // use jar name if job is not named.
      if ("".equals(job.getJobName())) {
        job.setJobName(new Path(originalJar).getName());
      }
    }
    // Configure username
    configureUserName(job);
  }
139109
def jarSources(target, source, env, for_signature):
    """"""
    try:
        env['JARCHDIR']
    except KeyError:
        jarchdir_set = False
    else:
        jarchdir_set = True
        jarchdir = env.subst('$JARCHDIR', target=target, source=source)
        if jarchdir:
            jarchdir = env.fs.Dir(jarchdir)
    result = []
    for src in source:
        contents = src.get_text_contents()
        if contents[:16] != "Manifest-Version":
            if jarchdir_set:
                _chdir = jarchdir
            else:
                try:
                    _chdir = src.attributes.java_classdir
                except AttributeError:
                    _chdir = None
            if _chdir:
                # If we are changing the dir with -C, then sources should
                # be relative to that directory.
                src = SCons.Subst.Literal(src.get_path(_chdir))
                result.append('-C')
                result.append(_chdir)
            result.append(src)
    return result
962089
def resolve_deps(
    deps,
    which,
    project,
    sources=None,
    python=False,
    clear=False,
    pre=False,
    allow_global=False,
    req_dir=None
):
    
    index_lookup = {}
    markers_lookup = {}
    python_path = which("python", allow_global=allow_global)
    if not os.environ.get("PIP_SRC"):
        os.environ["PIP_SRC"] = project.virtualenv_src_location
    backup_python_path = sys.executable
    results = []
    resolver = None
    if not deps:
        return results, resolver
    # First (proper) attempt:
    req_dir = req_dir if req_dir else os.environ.get("req_dir", None)
    if not req_dir:
        from .vendor.vistir.path import create_tracked_tempdir
        req_dir = create_tracked_tempdir(prefix="pipenv-", suffix="-requirements")
    with HackedPythonVersion(python_version=python, python_path=python_path):
        try:
            results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
                deps,
                index_lookup,
                markers_lookup,
                project,
                sources,
                clear,
                pre,
                req_dir=req_dir,
            )
        except RuntimeError:
            # Don't exit here, like usual.
            results = None
    # Second (last-resort) attempt:
    if results is None:
        with HackedPythonVersion(
            python_version=".".join([str(s) for s in sys.version_info[:3]]),
            python_path=backup_python_path,
        ):
            try:
                # Attempt to resolve again, with different Python version information,
                # particularly for particularly particular packages.
                results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
                    deps,
                    index_lookup,
                    markers_lookup,
                    project,
                    sources,
                    clear,
                    pre,
                    req_dir=req_dir,
                )
            except RuntimeError:
                sys.exit(1)
    return results, resolver
958116
static Path resolvePath(final Path base, final String... paths) {
        return Paths.get(base.toString(), paths);
    }
1049610
public static void setCacheFiles(URI[] files, Configuration conf) {
    String sfiles = StringUtils.uriToString(files);
    conf.set("mapred.cache.files", sfiles);
  }
1218852
public Map<String, String> resolve(Map<String, String> config) {
        config = resolveSystemEnvironmentVariables(config);
        config = resolveSystemDefaultSetup(config);
        config = resolveDockerInsideDocker(config);
        config = resolveDownloadDockerMachine(config);
        config = resolveAutoStartDockerMachine(config);
        config = resolveDefaultDockerMachine(config);
        config = resolveServerUriByOperativeSystem(config);
        config = resolveServerIp(config);
        config = resolveTlsVerification(config);
        return config;
    }
21026
function resolveConfig(cmdArgs, configFile) {
	var config = {};
	if (configFile) {
		var configPath = path.dirname(configFile);
		config = require(configFile);
		Object.keys(config).forEach(function(key) {
			if (["input", "output", "features", "run"].indexOf(key) > -1) {
				config[key] = path.resolve(configPath, config[key]);
			}
		});
	}
	
	var finalConfig = {
		command : cmdArgs._[0] ? cmdArgs._[0].toLowerCase() : config.command,
		input : cmdArgs.input ? path.resolve(process.cwd(), cmdArgs.input) : config.input,
		output : cmdArgs.output ? path.resolve(process.cwd(), cmdArgs.output) : config.output,
		features : cmdArgs.features ? path.resolve(process.cwd(), cmdArgs.features) : config.features,
		variant : cmdArgs.variant ? cmdArgs.variant : config.variant,
		bin : cmdArgs.bin ? cmdArgs.bin : config.bin,
		launch : cmdArgs.launch ? cmdArgs.launch : config.launch,
		run : cmdArgs.run !== undefined 
			? cmdArgs.run != true ? cmdArgs.run : null
			: config.run,
		ext : [
			{ module : require("../extensions/report_core/extension.js") }
		]
	};
	
	if (cmdArgs.ext) {
		cmdArgs.ext.split(",").forEach(function(ext) {
			var extPath = ext;
			if (extPath.replace("\\","/").indexOf("/") > -1) { extPath = path.resolve(process.cwd(), ext); }
			finalConfig.ext.push({
				path : extPath
			});
		});
	} else if (config.ext) {
		config.ext.forEach(function(ext) {
			if (typeof(ext) == "string") {
				var extPath = ext;
				if (extPath.slice(0,1) == ".") { extPath = path.resolve(configPath, extPath); }
				finalConfig.ext.push({
					path : extPath
				});
			} else if (ext instanceof Function) {
				finalConfig.ext.push({
					module : ext
				});
			} else {
				var extPath = ext.path;
				if (extPath && extPath.slice(0,1) == ".") { extPath = path.resolve(configPath, extPath); }
				finalConfig.ext.push({
					options : ext.options,
					path : extPath ? extPath : null,
					module : ext.module ? ext.module : null
				});
			}
		});
	}
	
	return finalConfig;
}