Skip to content

Commit

Permalink
Merge branch 'hotfix/0.23.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Jan 12, 2020
2 parents 46124a0 + d7c196c commit 8f53256
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 63 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [vNext]

## [0.23.6] / 2020-01-12
- Fixed `InspectCodeTasks` to use new plugin endpoint for downloading
- Fixed `AppVeyorOutputSink` to issue a warning when exceeding the default limit of 500 messages

## [0.23.5] / 2020-01-10
- Fixed CI integrations to use correct warning/error reporting infrastructure
- Fixed TeamCity configuration to use `UTF-8` encoding
Expand Down Expand Up @@ -463,7 +467,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added CLT tasks for Git
- Fixed background color in console output

[vNext]: https://github.com/nuke-build/nuke/compare/0.23.5...HEAD
[vNext]: https://github.com/nuke-build/nuke/compare/0.23.6...HEAD
[0.23.6]: https://github.com/nuke-build/nuke/compare/0.23.5...0.23.6
[0.23.5]: https://github.com/nuke-build/nuke/compare/0.23.4...0.23.5
[0.23.4]: https://github.com/nuke-build/nuke/compare/0.23.3...0.23.4
[0.23.3]: https://github.com/nuke-build/nuke/compare/0.23.2...0.23.3
Expand Down
11 changes: 5 additions & 6 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,11 @@ from framework in project.GetTargetFrameworks()
InspectCode(_ => _
.SetTargetPath(Solution)
.SetOutput(OutputDirectory / "inspectCode.xml")
.AddExtensions(
"EtherealCode.ReSpeller",
"PowerToys.CyclomaticComplexity",
"ReSharper.ImplicitNullability",
"ReSharper.SerializationInspections",
"ReSharper.XmlDocInspections"));
.AddPlugin("EtherealCode.ReSpeller", InspectCodePluginLatest)
.AddPlugin("PowerToys.CyclomaticComplexity", InspectCodePluginLatest)
.AddPlugin("ReSharper.ImplicitNullability", InspectCodePluginLatest)
.AddPlugin("ReSharper.SerializationInspections", InspectCodePluginLatest)
.AddPlugin("ReSharper.XmlDocInspections", InspectCodePluginLatest));
});

[Parameter("NuGet Api Key")] readonly string ApiKey;
Expand Down
6 changes: 3 additions & 3 deletions build/specifications/InspectCode.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
"help": "Lets you specify a custom location for the data that InspectCode caches. By default, the <em>%LOCALAPPDATA%</em> directory is used, unless there are settings files, in which case the one specified there is used. This parameter can be helpful if you want to use a fast SSD disk for the cache or if you want to store all your build processing data in a single place."
},
{
"name": "Extensions",
"type": "List<string>",
"name": "Plugins",
"type": "Dictionary<string, string>",
"noArgument": true,
"help": "Allows using ReSharper extensions that affect code analysis. To use an extension, specify its ID, which you can find by opening the extension package page in the <a href=\"http://resharper-plugins.jetbrains.com/\">ReSharper Gallery</a>, and then the Package Statistics page. Multiple values are separated with the semicolon."
"help": "Allows adding ReSharper plugins that will get included during code analysis. To add a plugin, specify its ID and version. Available plugins are listed in the <a href=\"https://resharper-plugins.jetbrains.com/\">Plugin Repository</a>. The ID can be grabbed from the download URL. Using <c>InspectCodePluginLatest</c> or <c>null</c> will download the latest version."
},
{
"name": "Properties",
Expand Down
15 changes: 15 additions & 0 deletions source/Nuke.Common/CI/AppVeyor/AppVeyorOutputSink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Nuke.Common.CI.AppVeyor
internal class AppVeyorOutputSink : AnsiColorOutputSink
{
private readonly AppVeyor _appVeyor;
private int _messageCount;

internal AppVeyorOutputSink(AppVeyor appVeyor)
{
Expand All @@ -29,12 +30,26 @@ internal AppVeyorOutputSink(AppVeyor appVeyor)

protected override void ReportWarning(string text, string details = null)
{
IncreaseAndCheckMessageCount();
_appVeyor.WriteWarning(text, details);
}

protected override void ReportError(string text, string details = null)
{
IncreaseAndCheckMessageCount();
_appVeyor.WriteError(text, details);
}

private void IncreaseAndCheckMessageCount()
{
_messageCount++;

if (_messageCount == 501)
{
base.WriteWarning("AppVeyor has a default limit of 500 messages. " +
"If you're getting an exception from 'appveyor.exe' after this message, " +
"contact https://appveyor.com/support to resolve this issue for your account.");
}
}
}
}
72 changes: 24 additions & 48 deletions source/Nuke.Common/Tools/InspectCode/InspectCode.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ public partial class InspectCodeSettings : ToolSettings
/// </summary>
public virtual string CachesHome { get; internal set; }
/// <summary>
/// Allows using ReSharper extensions that affect code analysis. To use an extension, specify its ID, which you can find by opening the extension package page in the <a href="http://resharper-plugins.jetbrains.com/">ReSharper Gallery</a>, and then the Package Statistics page. Multiple values are separated with the semicolon.
/// Allows adding ReSharper plugins that will get included during code analysis. To add a plugin, specify its ID and version. Available plugins are listed in the <a href="https://resharper-plugins.jetbrains.com/">Plugin Repository</a>. The ID can be grabbed from the download URL. Using <c>InspectCodePluginLatest</c> or <c>null</c> will download the latest version.
/// </summary>
public virtual IReadOnlyList<string> Extensions => ExtensionsInternal.AsReadOnly();
internal List<string> ExtensionsInternal { get; set; } = new List<string>();
public virtual IReadOnlyDictionary<string, string> Plugins => PluginsInternal.AsReadOnly();
internal Dictionary<string, string> PluginsInternal { get; set; } = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Lets you override MSBuild properties. The specified properties are applied to all analyzed projects. Currently, there is no direct way to set a property to a specific project only. The workaround is to create a custom property in this project and assign it to the desired property, then use the custom property in dupFinder parameters.
/// </summary>
Expand Down Expand Up @@ -527,84 +527,60 @@ public static InspectCodeSettings ResetCachesHome(this InspectCodeSettings toolS
return toolSettings;
}
#endregion
#region Extensions
#region Plugins
/// <summary>
/// <p><em>Sets <see cref="InspectCodeSettings.Extensions"/> to a new list</em></p>
/// <p>Allows using ReSharper extensions that affect code analysis. To use an extension, specify its ID, which you can find by opening the extension package page in the <a href="http://resharper-plugins.jetbrains.com/">ReSharper Gallery</a>, and then the Package Statistics page. Multiple values are separated with the semicolon.</p>
/// <p><em>Sets <see cref="InspectCodeSettings.Plugins"/> to a new dictionary</em></p>
/// <p>Allows adding ReSharper plugins that will get included during code analysis. To add a plugin, specify its ID and version. Available plugins are listed in the <a href="https://resharper-plugins.jetbrains.com/">Plugin Repository</a>. The ID can be grabbed from the download URL. Using <c>InspectCodePluginLatest</c> or <c>null</c> will download the latest version.</p>
/// </summary>
[Pure]
public static InspectCodeSettings SetExtensions(this InspectCodeSettings toolSettings, params string[] extensions)
public static InspectCodeSettings SetPlugins(this InspectCodeSettings toolSettings, IDictionary<string, string> plugins)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ExtensionsInternal = extensions.ToList();
toolSettings.PluginsInternal = plugins.ToDictionary(x => x.Key, x => x.Value, StringComparer.OrdinalIgnoreCase);
return toolSettings;
}
/// <summary>
/// <p><em>Sets <see cref="InspectCodeSettings.Extensions"/> to a new list</em></p>
/// <p>Allows using ReSharper extensions that affect code analysis. To use an extension, specify its ID, which you can find by opening the extension package page in the <a href="http://resharper-plugins.jetbrains.com/">ReSharper Gallery</a>, and then the Package Statistics page. Multiple values are separated with the semicolon.</p>
/// <p><em>Clears <see cref="InspectCodeSettings.Plugins"/></em></p>
/// <p>Allows adding ReSharper plugins that will get included during code analysis. To add a plugin, specify its ID and version. Available plugins are listed in the <a href="https://resharper-plugins.jetbrains.com/">Plugin Repository</a>. The ID can be grabbed from the download URL. Using <c>InspectCodePluginLatest</c> or <c>null</c> will download the latest version.</p>
/// </summary>
[Pure]
public static InspectCodeSettings SetExtensions(this InspectCodeSettings toolSettings, IEnumerable<string> extensions)
public static InspectCodeSettings ClearPlugins(this InspectCodeSettings toolSettings)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ExtensionsInternal = extensions.ToList();
toolSettings.PluginsInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="InspectCodeSettings.Extensions"/></em></p>
/// <p>Allows using ReSharper extensions that affect code analysis. To use an extension, specify its ID, which you can find by opening the extension package page in the <a href="http://resharper-plugins.jetbrains.com/">ReSharper Gallery</a>, and then the Package Statistics page. Multiple values are separated with the semicolon.</p>
/// <p><em>Adds a new key-value-pair <see cref="InspectCodeSettings.Plugins"/></em></p>
/// <p>Allows adding ReSharper plugins that will get included during code analysis. To add a plugin, specify its ID and version. Available plugins are listed in the <a href="https://resharper-plugins.jetbrains.com/">Plugin Repository</a>. The ID can be grabbed from the download URL. Using <c>InspectCodePluginLatest</c> or <c>null</c> will download the latest version.</p>
/// </summary>
[Pure]
public static InspectCodeSettings AddExtensions(this InspectCodeSettings toolSettings, params string[] extensions)
public static InspectCodeSettings AddPlugin(this InspectCodeSettings toolSettings, string pluginKey, string pluginValue)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ExtensionsInternal.AddRange(extensions);
toolSettings.PluginsInternal.Add(pluginKey, pluginValue);
return toolSettings;
}
/// <summary>
/// <p><em>Adds values to <see cref="InspectCodeSettings.Extensions"/></em></p>
/// <p>Allows using ReSharper extensions that affect code analysis. To use an extension, specify its ID, which you can find by opening the extension package page in the <a href="http://resharper-plugins.jetbrains.com/">ReSharper Gallery</a>, and then the Package Statistics page. Multiple values are separated with the semicolon.</p>
/// <p><em>Removes a key-value-pair from <see cref="InspectCodeSettings.Plugins"/></em></p>
/// <p>Allows adding ReSharper plugins that will get included during code analysis. To add a plugin, specify its ID and version. Available plugins are listed in the <a href="https://resharper-plugins.jetbrains.com/">Plugin Repository</a>. The ID can be grabbed from the download URL. Using <c>InspectCodePluginLatest</c> or <c>null</c> will download the latest version.</p>
/// </summary>
[Pure]
public static InspectCodeSettings AddExtensions(this InspectCodeSettings toolSettings, IEnumerable<string> extensions)
public static InspectCodeSettings RemovePlugin(this InspectCodeSettings toolSettings, string pluginKey)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ExtensionsInternal.AddRange(extensions);
toolSettings.PluginsInternal.Remove(pluginKey);
return toolSettings;
}
/// <summary>
/// <p><em>Clears <see cref="InspectCodeSettings.Extensions"/></em></p>
/// <p>Allows using ReSharper extensions that affect code analysis. To use an extension, specify its ID, which you can find by opening the extension package page in the <a href="http://resharper-plugins.jetbrains.com/">ReSharper Gallery</a>, and then the Package Statistics page. Multiple values are separated with the semicolon.</p>
/// <p><em>Sets a key-value-pair in <see cref="InspectCodeSettings.Plugins"/></em></p>
/// <p>Allows adding ReSharper plugins that will get included during code analysis. To add a plugin, specify its ID and version. Available plugins are listed in the <a href="https://resharper-plugins.jetbrains.com/">Plugin Repository</a>. The ID can be grabbed from the download URL. Using <c>InspectCodePluginLatest</c> or <c>null</c> will download the latest version.</p>
/// </summary>
[Pure]
public static InspectCodeSettings ClearExtensions(this InspectCodeSettings toolSettings)
public static InspectCodeSettings SetPlugin(this InspectCodeSettings toolSettings, string pluginKey, string pluginValue)
{
toolSettings = toolSettings.NewInstance();
toolSettings.ExtensionsInternal.Clear();
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="InspectCodeSettings.Extensions"/></em></p>
/// <p>Allows using ReSharper extensions that affect code analysis. To use an extension, specify its ID, which you can find by opening the extension package page in the <a href="http://resharper-plugins.jetbrains.com/">ReSharper Gallery</a>, and then the Package Statistics page. Multiple values are separated with the semicolon.</p>
/// </summary>
[Pure]
public static InspectCodeSettings RemoveExtensions(this InspectCodeSettings toolSettings, params string[] extensions)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(extensions);
toolSettings.ExtensionsInternal.RemoveAll(x => hashSet.Contains(x));
return toolSettings;
}
/// <summary>
/// <p><em>Removes values from <see cref="InspectCodeSettings.Extensions"/></em></p>
/// <p>Allows using ReSharper extensions that affect code analysis. To use an extension, specify its ID, which you can find by opening the extension package page in the <a href="http://resharper-plugins.jetbrains.com/">ReSharper Gallery</a>, and then the Package Statistics page. Multiple values are separated with the semicolon.</p>
/// </summary>
[Pure]
public static InspectCodeSettings RemoveExtensions(this InspectCodeSettings toolSettings, IEnumerable<string> extensions)
{
toolSettings = toolSettings.NewInstance();
var hashSet = new HashSet<string>(extensions);
toolSettings.ExtensionsInternal.RemoveAll(x => hashSet.Contains(x));
toolSettings.PluginsInternal[pluginKey] = pluginValue;
return toolSettings;
}
#endregion
Expand Down
12 changes: 7 additions & 5 deletions source/Nuke.Common/Tools/InspectCode/InspectCodeTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace Nuke.Common.Tools.InspectCode
{
public static partial class InspectCodeTasks
{
public const string InspectCodePluginLatest = null;

private static string GetPackageExecutable()
{
return EnvironmentInfo.Is64Bit ? "inspectcode.exe" : "inspectcode.x86.exe";
Expand All @@ -25,7 +27,7 @@ private static string GetPackageExecutable()
private static void PreProcess(ref InspectCodeSettings toolSettings)
{
var installedPlugins = GetInstalledPlugins();
if (installedPlugins.Count == 0 && toolSettings.Extensions.Count == 0)
if (installedPlugins.Count == 0 && toolSettings.Plugins.Count == 0)
return;

var shadowDirectory = GetShadowDirectory(toolSettings, installedPlugins);
Expand All @@ -39,16 +41,16 @@ private static void PreProcess(ref InspectCodeSettings toolSettings)
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")));
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")));
}

[CanBeNull]
private static IProcess StartProcess(InspectCodeSettings toolSettings)
{
var installedPackages = GetInstalledPlugins();
if (toolSettings.Extensions.Count > 0 || installedPackages.Count > 0)
if (toolSettings.Plugins.Count > 0 || installedPackages.Count > 0)
{
toolSettings = toolSettings.SetToolPath(
Path.Combine(
Expand Down

0 comments on commit 8f53256

Please sign in to comment.