private List <MavenCoordinates> Verify(MavenCoordinates coordinates, OverwriteOption overwrite) { if (overwrite == OverwriteOption.Replace) { return(new List <MavenCoordinates> { coordinates }); } var artifact = new Model.Artifact(coordinates); var search = Artifactory.Search() .ArtifactsByGavc() .GroupId(coordinates.GroupId) .ArtifactId(coordinates.ArtifactId) .Version(coordinates.Version); var run = search.Run(); if (run.Artifacts != null && run.Artifacts.Count > 0) { if (overwrite == OverwriteOption.Abort) { throw new ArgumentException(artifact + " already exists"); } else if (overwrite == OverwriteOption.AddNew) { Logger.Info(coordinates + " already exist. Skipping upload."); return(new List <MavenCoordinates>()); } } return(new List <MavenCoordinates> { coordinates });; }
private void Upload(Model.Project project, DirectoryInfo path, MavenCoordinates artifact) { var file = new FileInfo(Path.Combine(path.FullName, artifact.ExpandedName)); var artifactory = new Model.Artifact(artifact); var repo = GetRepository(project, artifactory); repo.Upload(artifactory.Path, File.ReadAllBytes(file.FullName)).Run(); }
private void FindReplace(DirectoryInfo workspace, string oldName, string newName, MavenCoordinates coordinate) { var folder = Path.Combine(workspace.FullName, coordinate.FlatName); foreach (var file in Directory.GetFiles(folder)) { FindReplaceInFileContent(file, oldName, newName); } }
internal void ProvideDependency(string source, MavenCoordinates dependency) { Dependency.Provide(source, dependency); }
internal void RequireDependency(string source, MavenCoordinates dependency) { Dependency.Require(source, dependency); }