public static bool Execute(string rootDir) { DeleteBackupFolders(rootDir); var version = GetVersion(rootDir); var documentHelper = new DocumentHelper(); var projectFiles = GetProjects(rootDir).ToArray(); foreach (var file in projectFiles) { var projectReferencesUpdater = new ProjectUpdater(documentHelper,rootDir,version); projectReferencesUpdater.Update(file); } var nuspecs = Directory.GetFiles(Path.Combine(rootDir, @"Support\Nuspec"), "*.nuspec"); foreach (var file in nuspecs) { var projectReferencesUpdater = new NugetUpdater(documentHelper, rootDir, version, projectFiles,nuspecs); projectReferencesUpdater.Update(file); } return true; }
public static bool Execute(string rootDir){ DeleteBackupFolders(rootDir); var documentHelper = new DocumentHelper(); var files = Directory.GetFiles(rootDir, "*.csproj", SearchOption.AllDirectories); foreach (var file in files) { if (!_excludedDirs.Any(s => file.IndexOf(s, StringComparison.Ordinal)>-1)) { var projectReferencesUpdater = new ProjectUpdater(documentHelper,rootDir); projectReferencesUpdater.Update(file); } } var version = GetVersion(rootDir); files = Directory.GetFiles(Path.Combine(rootDir, @"Resource\Nuget"), "*.nuspec"); foreach (var file in files) { var projectReferencesUpdater = new NugetUpdater(documentHelper, rootDir, version); projectReferencesUpdater.Update(file); } return true; }
bool HasReferenceRequirementInReferenceProjects(XDocument document, string reference) { var documents = document.Descendants().Where(element => element.Name.LocalName == "ProjectReference").Select(element => DocumentHelper.GetXDocument(Path.GetFullPath(element.Attribute("Include").Value))); return(documents.Any(xDocument => HasReferenceRequirementInProject(xDocument, reference))); }