Exemple #1
0
        static partial void PreProcess(InspectCodeSettings toolSettings)
        {
            var installedPlugins = GetInstalledPlugins();

            if (installedPlugins.Count == 0 && toolSettings.Extensions.Count == 0)
            {
                return;
            }

            var shadowDirectory = GetShadowDirectory(toolSettings, installedPlugins);

            FileSystemTasks.CopyRecursively(
                Path.GetDirectoryName(toolSettings.ToolPath).NotNull(),
                shadowDirectory,
                FileSystemTasks.FileExistsPolicy.OverwriteIfNewer);

            installedPlugins.Select(x => x.FileName)
            .ForEach(x => File.Copy(x, Path.Combine(shadowDirectory, Path.GetFileName(x).NotNull()), overwrite: true));

#if !NETCORE
            toolSettings.Extensions.ForEach(x => HttpTasks.HttpDownloadFile(
                                                $"https://resharper-plugins.jetbrains.com/api/v2/package/{x}",
                                                Path.Combine(shadowDirectory, $"{x}.nupkg")));
#else
            ControlFlow.Assert(toolSettings.Extensions.Count == 0,
                               "InspectCodeSettings.Extensions is currently not supported on .NET Core. However, after adding the ReSharper gallery feed " +
                               "(https://resharper-plugins.jetbrains.com/api/v2), you can reference them as normal NuGet packages in your project file.");
#endif
        }
Exemple #2
0
        static partial void PreProcess(InspectCodeSettings toolSettings)
        {
            var installedPlugins = GetInstalledPlugins();

            if (installedPlugins.Count == 0 && toolSettings.Extensions.Count == 0)
            {
                return;
            }

            var shadowDirectory = GetShadowDirectory(toolSettings, installedPlugins);

            FileSystemTasks.CopyRecursively(
                Path.GetDirectoryName(toolSettings.ToolPath).NotNull(),
                shadowDirectory,
                FileSystemTasks.FileExistsPolicy.OverwriteIfNewer);

            installedPlugins.Select(x => x.FileName)
            .ForEach(x => File.Copy(x, Path.Combine(shadowDirectory, Path.GetFileName(x).NotNull()), overwrite: true));

            toolSettings.Extensions.ForEach(x => HttpTasks.HttpDownloadFile(
                                                $"https://resharper-plugins.jetbrains.com/api/v2/package/{x}",
                                                Path.Combine(shadowDirectory, $"{x}.nupkg")));
        }