Google.JarResolver.PlayServicesSupport.FindCandidate C# (CSharp) Méthode

FindCandidate() private méthode

Finds an acceptable candidate for the given dependency.
private FindCandidate ( string repoPath, Dependency dep ) : Dependency
repoPath string The path to the artifact repository.
dep Dependency The dependency to find a specific version for.
Résultat Dependency
        internal Dependency FindCandidate(string repoPath, Dependency dep)
        {
            string basePath = Path.Combine(dep.Group, dep.Artifact);
            basePath = basePath.Replace(".", Path.DirectorySeparatorChar.ToString());

            string metadataFile = Path.Combine(Path.Combine(repoPath, basePath), "maven-metadata.xml");
            if (File.Exists(metadataFile))
            {
                ProcessMetadata(dep, metadataFile);
                dep.RepoPath = repoPath;
            }
            else
            {
                return null;
            }

            while (dep.HasPossibleVersions)
            {

                // TODO(wilkinsonclay): get the packaging from the pom.
                // Check for the actual file existing, otherwise skip this version.
                foreach (string ext in Packaging)
                {
                    string basename = dep.Artifact + "-" + dep.BestVersion + ext;
                    string fname = Path.Combine(dep.BestVersionPath, basename);

                    if (File.Exists(fname))
                    {
                        return dep;
                    }
                }

                Log(dep.Key + " version " + dep.BestVersion + " not available, ignoring.",
                    verbose: true);
                dep.RemovePossibleVersion(dep.BestVersion);
            }

            return null;
        }

Same methods

PlayServicesSupport::FindCandidate ( Dependency dep ) : Dependency