Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
* release/2.0.0:
  (build) Updated version and release notes
  (GH-3561) Change GRM Label order
  (GH-2665) Support blockless using statment
  (#3685) Update build to use new dotnet aliases
  (build) Updated Cake Tool to version 2.0.0-rc0002
  • Loading branch information
devlead committed Nov 30, 2021
2 parents 68034f4 + 6c01727 commit 79402af
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "2.0.0-rc0001",
"version": "2.0.0-rc0002",
"commands": [
"dotnet-cake"
]
Expand Down
2 changes: 1 addition & 1 deletion GitReleaseManager.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
issue-labels-include:
- Breaking change
- Feature
- Bug
- Improvement
- Bug
- Documentation
issue-labels-exclude:
- Build
Expand Down
75 changes: 75 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,78 @@
### New in 2.0.0 (Released 2021/11/30)

* 3714 Use Basic.Reference.Assemblies.* to ensure all standard reference assemblies are available for Roslyn.
* 3654 IsRunningOnAzurePipelines should ignore agent type.
* 3631 Refactor GitHub Actions Paths.
* 3610 Remove TFBuildProvider.
* 3590 Directories in AzurePipelinesBuildInfo are FilePaths - FilePath.GetDirectory then inconsistent.
* 3581 Stop shipping Cake.Portable Chocolatey package and Cake Homebrew formulae.
* 3579 Stop shipping Cake runner for .NET Framework and Cake runner for .NET Core.
* 3577 Remove ReverseDependencyAttribute.
* 3572 Only build for TargetFrameworks netcoreapp3.1, net5.0 and net6.0.
* 3282 GitVersion Tool: Rename verbosity values to match GitVersion values.
* 3222 Add Xamarin.iOS platform targets to MSBuildSettings PlatformTarget enumeration.
* 3151 Add support for Engine event hooks after execution as well as before.
* 3003 Remove DependencyAttribute.
* 2872 Bump eol target frameworks.
* 2788 Tool:OpenCover - the register-setting should be an option, rather than a string.
* 1111 DotNetCoreRestore: dotnet restore no longer supports globbing.
* 3630 Add GitHub Actions Environment properties.
* 3629 Add GitHub Actions UploadArtifact Command.
* 3628 Add GitHub Actions SetEnvironmentVariable Command.
* 3627 Add GitHub Actions AddPath Command.
* 3341 Epic: Introduce DotNet aliases (synonyms to DotNetCore aliases).
* 3709 Arguments alias should support ICollection as default value.
* 3691 Update Microsoft.NETCore.Platforms to 6.0.0.
* 3690 Update Microsoft.Extensions.DependencyInjection to 6.0.0.
* 3689 Update System.Reflection.Metadata to 6.0.0.
* 3688 Update System.Collections.Immutable to 6.0.0.
* 3681 ScriptAssemblyResolver logging should be at debug/diagnostic level.
* 3662 Update Microsoft.CodeAnalysis.CSharp.Scripting to 4.0.0-6.final.
* 3647 Display message of criteria when task fails to run due to criteria not being met.
* 3644 Add DotNetNuGetUpdateSource aliases (synonym to DotNetCoreNuGetUpdateSource).
* 3643 Add DotNetNuGetRemoveSource aliases (synonym to DotNetCoreNuGetRemoveSource).
* 3642 Add DotNetNuGetListSourceSettings (derived from to DotNetNuGetSource).
* 3641 Add DotNetNuGetHasSource aliases (synonym to DotNetCoreNuGetHasSource).
* 3640 Add DotNetNuGetEnableSource aliases (synonym to DotNetCoreNuGetEnableSource).
* 3639 Add DotNetNuGetDisableSource aliases (synonym to DotNetCoreNuGetDisableSource).
* 3607 Add EnableCompressionInSingleFile to DotNetCorePublishSettings.
* 3599 Add VS2022 to default MSBuild Resolver.
* 3598 Remove Preview from VS2022 MSBuild Resolver.
* 3595 Update Autofac to 6.3.0.
* 3593 Update Microsoft.CodeAnalysis.CSharp.Scripting to 4.0.0-5.final.
* 3591 Update Microsoft.NETCore.Platforms to 6.0.0-rc.2.21480.5.
* 3555 Add DotNetNuGetAddSource aliases (synonym to DotNetCoreNuGetAddSource).
* 3554 Add DotNetNuGetDelete aliases (synonym to DotNetCoreNuGetDelete).
* 3553 Add DotNetNuGetPush aliases (synonym to DotNetCoreNuGetPush).
* 3552 Add DotNetPack alias (synonym to DotNetCorePack).
* 3551 Add DotNetPublish alias (synonym to DotNetCorePublish).
* 3550 Add DotNetVSTest alias (synonym to DotNetCoreVSTest).
* 3549 Add DotNetTest alias (synonym to DotNetCoreTest).
* 3548 Add DotNetBuildServer alias (synonym to DotNetCoreBuildServer).
* 3547 Add DotNetBuild alias (synonym to DotNetCoreBuild).
* 3546 Add DotNetRestore alias (synonym to DotNetCoreRestore).
* 3545 Add DotNetClean alias (synonym to DotNetCoreClean).
* 3544 Add DotNetExecute alias (synonym to DotNetCoreExecute).
* 3543 Add DotNetRun alias (synonym to DotNetCoreRun).
* 3542 Add DotNetTool alias (synonym to DotNetCoreTool).
* 3523 Add DotNetMSBuild alias (synonym to DotNetCoreMSBuild).
* 3215 Add RunCommand with postAction parameter to DotNetCoreTool.
* 3075 Make FilePath and DirectoryPath comparable by value.
* 2571 OctopusDeploy DeployTo property to take collection of string to specify multiple environments.
* 2075 Add overloads for DotNetCore*() methods taking FilePath instead of string.
* 1794 Private is missing from ProjectReference.
* 1616 Error message on circular references leads to poor developer experience.
* 3701 Add cake-module tag to Cake.DotNetTool.Module NuGet package.
* 3602 Switch to Cake.Tool as primary package in REAME.md.
* 3711 SemanticVersion missing equals/not equals operator, prerelease sorted wrong.
* 3697 Error: The requested service 'Cake.Commands.DefaultCommandSettings' has not been registered.
* 3693 Core suffix is still used in some settings classes.
* 3683 Use DotNetMSBuildSettings instead of DotNetCoreMSBuildSettings on new dotnet aliases settings.
* 3671 VS2022: msbuild can not be located, only Build Tools are installed.
* 2665 C* 8 Using Statement produces compile error.
* 2443 Erroneous "Target path must be an absolute path" when preserveFolderStructure is used with CopyFiles.
* 1669 Release notes does not tolerate prerelease versions.

### New in 2.0.0-rc0002 (Released 2021/11/26)

* 3714 Use Basic.Reference.Assemblies.* to ensure all standard reference assemblies are available for Roslyn
Expand Down
28 changes: 14 additions & 14 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ Task("Restore-NuGet-Packages")
.IsDependentOn("Clean")
.Does<BuildParameters>((context, parameters) =>
{
DotNetCoreRestore("./src/Cake.sln", new DotNetCoreRestoreSettings
DotNetRestore("./src/Cake.sln", new DotNetRestoreSettings
{
Verbosity = DotNetCoreVerbosity.Minimal,
Verbosity = DotNetVerbosity.Minimal,
Sources = new [] { "https://api.nuget.org/v3/index.json" },
MSBuildSettings = parameters.MSBuildSettings
});
Expand All @@ -109,7 +109,7 @@ Task("Build")
{
// Build the solution.
var path = MakeAbsolute(new DirectoryPath("./src/Cake.sln"));
DotNetCoreBuild(path.FullPath, new DotNetCoreBuildSettings()
DotNetBuild(path.FullPath, new DotNetBuildSettings
{
Configuration = parameters.Configuration,
NoRestore = true,
Expand All @@ -128,7 +128,7 @@ Task("Run-Unit-Tests")
FilePath testResultsPath = MakeAbsolute(parameters.Paths.Directories.TestResults
.CombineWithFilePath($"{project.GetFilenameWithoutExtension()}_{framework}_TestResults.xml"));

DotNetCoreTest(project.FullPath, new DotNetCoreTestSettings
DotNetTest(project.FullPath, new DotNetTestSettings
{
Framework = framework,
NoBuild = true,
Expand All @@ -153,7 +153,7 @@ Task("Create-NuGet-Packages")
continue;
}

DotNetCorePack(project.FullPath, new DotNetCorePackSettings {
DotNetPack(project.FullPath, new DotNetPackSettings {
Configuration = parameters.Configuration,
OutputDirectory = parameters.Paths.Directories.NuGetRoot,
NoBuild = true,
Expand Down Expand Up @@ -245,12 +245,12 @@ Task("Publish-MyGet")
foreach(var package in parameters.Packages.NuGet)
{
// Push the package.
var settings = new DotNetCoreNuGetPushSettings {
var settings = new DotNetNuGetPushSettings {
ApiKey = apiKey,
Source = apiUrl
};

DotNetCoreNuGetPush(package.PackagePath.FullPath, settings);
DotNetNuGetPush(package.PackagePath.FullPath, settings);
}
})
.OnError<BuildParameters>((exception, parameters) =>
Expand Down Expand Up @@ -280,12 +280,12 @@ Task("Publish-NuGet")
foreach(var package in parameters.Packages.NuGet)
{
// Push the package.
var settings = new DotNetCoreNuGetPushSettings {
var settings = new DotNetNuGetPushSettings {
ApiKey = apiKey,
Source = apiUrl
};

DotNetCoreNuGetPush(package.PackagePath.FullPath, settings);
DotNetNuGetPush(package.PackagePath.FullPath, settings);
}
})
.OnError<BuildParameters>((exception, parameters) =>
Expand Down Expand Up @@ -338,10 +338,10 @@ Task("Frosting-Integration-Tests")
new FilePath("tests/integration/Cake.Frosting/build/Build.csproj")
);

DotNetCoreBuild(project.FullPath,
new DotNetCoreBuildSettings
DotNetBuild(project.FullPath,
new DotNetBuildSettings
{
Verbosity = DotNetCoreVerbosity.Quiet,
Verbosity = DotNetVerbosity.Quiet,
Configuration = parameters.Configuration,
MSBuildSettings = parameters.MSBuildSettings
});
Expand All @@ -363,10 +363,10 @@ Task("Frosting-Integration-Tests")
{
Information("Testing: {0}", test.Framework);

DotNetCoreRun(test.Project.FullPath,
DotNetRun(test.Project.FullPath,
new ProcessArgumentBuilder()
.AppendSwitchQuoted("--verbosity", "=", "quiet"),
new DotNetCoreRunSettings
new DotNetRunSettings
{
Configuration = parameters.Configuration,
Framework = test.Framework,
Expand Down
4 changes: 2 additions & 2 deletions build/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class BuildParameters
public BuildPaths Paths { get; }
public BuildPackages Packages { get; }
public bool PublishingError { get; set; }
public DotNetCoreMSBuildSettings MSBuildSettings { get; }
public DotNetMSBuildSettings MSBuildSettings { get; }

public bool ShouldPublish
{
Expand Down Expand Up @@ -118,7 +118,7 @@ public class BuildParameters
ReleaseNotes.Notes.ToArray()
);

MSBuildSettings = new DotNetCoreMSBuildSettings {
MSBuildSettings = new DotNetMSBuildSettings {
Version = Version.SemVersion,
AssemblyVersion = Version.Version,
FileVersion = Version.Version,
Expand Down
12 changes: 11 additions & 1 deletion src/Cake.Core/Scripting/Processors/UsingStatementProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,23 @@ public override bool Process(IScriptAnalyzerContext context, string line, out st
return false;
}

// Using block?
// Using disposable block?
var @namespace = tokens[1].TrimEnd(';');
if (@namespace.StartsWith("("))
{
return false;
}

// Using disposable statement?
const int usingLength = 5;
int openParentheses = line.IndexOf('(', usingLength),
closeParentheses = openParentheses < usingLength ? -1 : line.IndexOf(')', openParentheses);

if (closeParentheses > openParentheses)
{
return false;
}

// Using alias directive?
if (tokens.Any(t => t == "="))
{
Expand Down
2 changes: 1 addition & 1 deletion src/SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
[assembly: AssemblyProduct("Cake")]
[assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0-beta.1+29.Branch.release-2.0.0-rc0002.Sha.0c17e1d2547252c226c8ebb205db18790f2459a5")]
[assembly: AssemblyInformationalVersion("2.0.0-beta.1+38.Branch.release-2.0.0.Sha.2ce2c67d9d7033b46446e82045c46589a3935584")]
[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")]
12 changes: 11 additions & 1 deletion tests/integration/Cake.Core/Scripting/UsingDirective.cake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ Task("Cake.Core.Scripting.UsingDirective.UsingStatic")
Information(Round(1.1));
});

Task("Cake.Core.Scripting.UsingDirective.UsingDisposable")
.Does(() =>
{
// Intentionally not indented
using var @string = new StringReader("String");
using var reader = new StringReader("Reader");
Information("{0}{1}", @string.ReadLine(), reader.ReadLine());
});

//////////////////////////////////////////////////////////////////////////////

Task("Cake.Core.Scripting.UsingDirective")
.IsDependentOn("Cake.Core.Scripting.UsingDirective.UsingStatic");
.IsDependentOn("Cake.Core.Scripting.UsingDirective.UsingStatic")
.IsDependentOn("Cake.Core.Scripting.UsingDirective.UsingDisposable");

0 comments on commit 79402af

Please sign in to comment.