public static string ToFileSuffix(this PomComponentKind kind, PackageReference pr) { switch (kind) { case PomComponentKind.PomXml: return(".pom"); case PomComponentKind.Binary: return("." + pr.Packaging); case PomComponentKind.JavadocJar: return("-javadoc.jar"); case PomComponentKind.SourcesJar: return("-sources.jar"); } throw new NotSupportedException(); }
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)}")); }
public override bool CanTryDownloading(PackageReference pr) { if (pr.GroupId.StartsWith("android.arch.") || pr.GroupId.StartsWith("com.android.databinding") || pr.GroupId.StartsWith("com.android.java.tools.build") || pr.GroupId.StartsWith("com.android.support") || pr.GroupId.StartsWith("com.android.tools") || pr.GroupId.StartsWith("com.android.tools")) { return(true); } switch (pr.GroupId) { case "com.google.firebase": case "com.google.android.gms": case "com.google.android.support": case "com.google.android.wearable": return(true); } return(false); }
public virtual bool ShouldSkipDownload(PackageReference pr) { return(false); }
public override bool CanTryDownloading(PackageReference pr) { return(IsAndroidSdkComponent(pr.GroupId)); }
/// <summary> /// constructs a download URL, or throw <see cref="T:RepositoryDownloadException" /> /// </summary> /// <returns>The download URL.</returns> /// <param name="pkg">Package.</param> /// <param name="kind">Pom component kind.</param> public virtual string BuildDownloadUrl(PackageReference pkg, PomComponentKind kind) { return(BuildDownloadUrl(BaseUrl, pkg, kind)); }
public virtual bool CanTryDownloading(PackageReference pr) { return(!IsAndroidSdkComponent(pr.GroupId)); }
bool IsScopeCovered(Options options, PackageReference p) { return(p.Scope == "compile" || options.ExtraScopes.Contains(p.Scope)); }
public Entry Find(PackageReference package, PomComponentKind kind) { return(Entries.FirstOrDefault(e => e.ComponentKind == kind && e.Package.Equals(package))); }
public bool Exists(PackageReference package, PomComponentKind kind) { return(Find(package, kind) != null); }
public Entry(PackageReference package, PomComponentKind kind, string localFile) { Package = package; ComponentKind = kind; LocalFile = localFile; }