private static void PreProcess(ref CleanupCodeSettings toolSettings) { var installedPlugins = GetInstalledPlugins(); if (installedPlugins.Count == 0 && toolSettings.Extensions.Count == 0) { return; } var shadowDirectory = GetShadowDirectory(installedPlugins); FileSystemTasks.CopyDirectoryRecursively( Path.GetDirectoryName(toolSettings.ToolPath).NotNull(), shadowDirectory, DirectoryExistsPolicy.Merge, FileExistsPolicy.OverwriteIfNewer ); installedPlugins.Select(x => x.FileName) .ForEach(x => File.Copy(x, Path.Combine(shadowDirectory, Path.GetFileName(x).NotNull()), true)); toolSettings.Extensions.ForEach( x => HttpTasks.HttpDownloadFile( $"https://resharper-plugins.jetbrains.com/api/v2/package/{x}", Path.Combine(shadowDirectory, $"{x}.nupkg") ) ); }
/// <summary> /// Copies from the compiled directory to the publish directory with the version as the last folder for Visual Studio projects.. /// </summary> private void Publish_Copy_VS() { AOT_Normal("Publishing Visual Studio Projects"); foreach (SlugCIProject project in CISession.Projects) { if (project.Deploy != SlugCIDeployMethod.Copy) { continue; } // Each framework needs to be copied. foreach (string item in project.Frameworks) { project.Results.PublishedSuccess = false; AbsolutePath destFolder = BuildDestinationFolderLayout_VS(project, item); AbsolutePath srcFolder = project.VSProject.Directory / "bin" / CISession.CompileConfig / item; FileSystemTasks.CopyDirectoryRecursively(srcFolder, destFolder, DirectoryExistsPolicy.Merge, FileExistsPolicy.OverwriteIfNewer); AOT_Success("Copied: " + project.Name + " to Deployment folder: " + destFolder); } SetInprocessStageStatus(StageCompletionStatusEnum.Success); project.Results.PublishedSuccess = true; } }
/// <summary> /// Publish Angular projects /// </summary> private void Publish_Copy_Angular() { AOT_Normal("Publishing Angular Projects"); if (CISession.SkipAngularBuild) { AOT_Warning("All Angular Projects were skipped due to manually set argument."); } // Angular projects: We only support single app publishes per project. Angular NX supports more, we just don't have any examples at the moment. foreach (AngularProject project in CISession.SlugCIConfigObj.AngularProjects) { project.Results.PublishedSuccess = false; if (CISession.SkipAngularBuild) { continue; } // TODO - Replace "" with Angular Apps from dist folder AbsolutePath destFolder = BuildDestinationFolderName_Angular(project, ""); AbsolutePath angularDistPath = CISession.AngularDirectory / project.Name / "dist"; AbsolutePath angularAppsSubFolder = angularDistPath / "apps"; ControlFlow.Assert(Directory.Exists(angularDistPath), "Cannot find Angular dist folder. Has Angular app been compiled?"); AbsolutePath srcFolder = (AbsolutePath)"c:"; // Determine where the source distribution files are. This is either right in the dist folder OR there is a folder in dist called // "apps" with subfolders and the "web" is in each subfolder. if (!Directory.Exists(angularAppsSubFolder)) { srcFolder = angularDistPath; } else { List <string> dirNames = Directory.GetDirectories(angularAppsSubFolder).ToList(); ControlFlow.Assert(dirNames.Count > 0, "There are no compiled apps in the [" + angularAppsSubFolder + "]."); if (dirNames.Count == 1) { srcFolder = (AbsolutePath)dirNames [0]; } else { ControlFlow.Assert(dirNames.Count < 2, "There is more than 1 app in the folder [" + angularAppsSubFolder + "]. We can only handle 1 at this time."); } } FileSystemTasks.CopyDirectoryRecursively(srcFolder, destFolder, DirectoryExistsPolicy.Merge, FileExistsPolicy.OverwriteIfNewer); AOT_Success("Copied: " + project.Name + " to Deployment folder: " + destFolder); SetInprocessStageStatus(StageCompletionStatusEnum.Success); project.Results.PublishedSuccess = true; } }
private static void PreProcess <T>(ref T toolSettings) where T : ReSharperSettingsBase { if (toolSettings.Plugins.Count == 0) { return; } var wave = GetWave(toolSettings).NotNull("wave != null"); var shadowDirectory = GetShadowDirectory(toolSettings, wave); FileSystemTasks.CopyDirectoryRecursively( Path.GetDirectoryName(toolSettings.ProcessToolPath).NotNull(), shadowDirectory, DirectoryExistsPolicy.Merge, FileExistsPolicy.OverwriteIfNewer); toolSettings.Plugins.ForEach(x => HttpTasks.HttpDownloadFile( $"http://resharper-plugins.jetbrains.com/dotnet/api/v2/curated-feeds/Wave_v{wave}.0/Packages(Id='{x.Key}',Version='{x.Value}')/Download", Path.Combine(shadowDirectory, $"{x.Key}.nupkg"))); toolSettings = toolSettings.SetProcessToolPath(Path.Combine(shadowDirectory, Path.GetFileName(toolSettings.ProcessToolPath))); }
private static void PreProcess(ref InspectCodeSettings toolSettings) { var installedPlugins = GetInstalledPlugins(); if (installedPlugins.Count == 0 && toolSettings.Plugins.Count == 0) { return; } var shadowDirectory = GetShadowDirectory(toolSettings, installedPlugins); FileSystemTasks.CopyDirectoryRecursively( Path.GetDirectoryName(toolSettings.ToolPath).NotNull(), shadowDirectory, DirectoryExistsPolicy.Merge, FileExistsPolicy.OverwriteIfNewer); installedPlugins.Select(x => x.FileName) .ForEach(x => File.Copy(x, Path.Combine(shadowDirectory, Path.GetFileName(x).NotNull()), overwrite: true)); toolSettings.Plugins.ForEach(x => HttpTasks.HttpDownloadFile( $"http://resharper-plugins.jetbrains.com/dotnet/api/v2/Packages(Id='{x.Key}',Version='{x.Value}')/Download", Path.Combine(shadowDirectory, $"{x.Key}.nupkg"))); }
public static void CopyProjectBinDir(this Project project, AbsolutePath targetDir, Configuration configuration) { FileSystemTasks.CopyDirectoryRecursively(project.GetOutputDir(configuration), targetDir); }