Esempio n. 1
0
        public override string BuildDownloadUrl(PackageReference pkg, PomComponentKind kind)
        {
            string basePath = BaseUrl + $"{pkg.GroupId.Replace ('.', '/')}/{pkg.ArtifactId}";

            if (kind == PomComponentKind.PomXml)
            {
                return($"{basePath}/maven-metadata.xml");
            }
            else
            {
                return($"{basePath}/{pkg.Version}/{pkg.ArtifactId}-{pkg.Version}{kind.ToFileSuffix (pkg)}");
            }
        }
Esempio n. 2
0
 public static string BuildDownloadUrl(string baseUrl, PackageReference pkg, PomComponentKind kind)
 {
     if (kind == PomComponentKind.MavenMetadataXml)
     {
         return(string.Concat($"{baseUrl}{pkg.GroupId?.Replace ('.', '/')}/{pkg.ArtifactId}/maven-metadata.xml"));
     }
     return(string.Concat($"{baseUrl}{pkg.GroupId?.Replace ('.', '/')}/{pkg.ArtifactId}/{pkg.Version}/{pkg.ArtifactId}-{pkg.Version}{kind.ToFileSuffix (pkg)}"));
 }
Esempio n. 3
0
        public override Task <Stream> GetStreamAsync(PackageReference pkg, PomComponentKind kind, MavenDownloader.Options options, Func <PackageReference, string> getPomsavedPath)
        {
            string basePath = $"{android_sdk}/extras/android/m2repository/{pkg.GroupId.Replace ('.', '/')}/{pkg.ArtifactId}";
            string file     = kind == PomComponentKind.PomXml ?
                              Path.Combine(basePath, "maven-metadata.xml") :
                              Path.Combine(basePath, pkg.Version, $"{pkg.ArtifactId}-{pkg.Version}{kind.ToFileSuffix (pkg)}");

            options.LogMessage($"Retrieving file from {file} ...");
            return(Task.FromResult((Stream)File.OpenRead(file)));
        }
Esempio n. 4
0
 public static string BuildLocalCachePath(string basePath, PackageReference pr, PomComponentKind kind)
 {
     if (string.IsNullOrEmpty(pr.GroupId))
     {
         throw new ArgumentException("groupId is empty for " + pr);
     }
     if (string.IsNullOrEmpty(pr.ArtifactId))
     {
         throw new ArgumentException("artifactId is empty for " + pr);
     }
     if (string.IsNullOrEmpty(pr.Version))
     {
         throw new ArgumentException("version is empty for " + pr);
     }
     return(Path.Combine(basePath ?? "", pr.GroupId, pr.ArtifactId, pr.Version, $"{pr.ArtifactId}-{pr.Version}{kind.ToFileSuffix (pr)}"));
 }