Skip to content

Commit

Permalink
Merge branch 'release/4.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead committed Nov 18, 2023
2 parents 1514512 + 7e22cba commit 5929514
Show file tree
Hide file tree
Showing 125 changed files with 656 additions and 660 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": "3.1.0",
"version": "3.2.0",
"commands": [
"dotnet-cake"
]
Expand Down
12 changes: 11 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,14 @@ indent_size = 4

[*.js]
indent_style = tab
indent_size = 2
indent_size = 2

# Verify settings
[*.{received,verified}.{txt,xml,json,cake}]
charset = "utf-8-bom"
end_of_line = lf
indent_size = unset
indent_style = unset
insert_final_newline = false
tab_width = unset
trim_trailing_whitespace = false
17 changes: 13 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
Expand Down Expand Up @@ -47,9 +47,9 @@

###############################################################################
# diff behavior for common document formats
#
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
Expand All @@ -61,4 +61,13 @@
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
#*.RTF diff=astextplain

###############################################################################
# Verify files
###############################################################################

*.verified.txt text eol=lf working-tree-encoding=UTF-8
*.verified.xml text eol=lf working-tree-encoding=UTF-8
*.verified.json text eol=lf working-tree-encoding=UTF-8
*.verified.cake text eol=lf working-tree-encoding=UTF-8
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ jobs:
with:
fetch-depth: 0

- name: Install .NET SDK 6.0.x
- name: Install .NET SDK 6.0.x - 8.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Install .NET Core SDK (global.json)
uses: actions/setup-dotnet@v3
Expand All @@ -46,4 +49,5 @@ jobs:
arguments: |
CAKE_NETCOREAPP_6_0_VERSION_OS: ${{ steps.build-cake.outputs.CAKE_NETCOREAPP_6_0_VERSION_OS }}
CAKE_NETCOREAPP_7_0_VERSION_OS: ${{ steps.build-cake.outputs.CAKE_NETCOREAPP_7_0_VERSION_OS }}
CAKE_NETCOREAPP_8_0_VERSION_OS: ${{ steps.build-cake.outputs.CAKE_NETCOREAPP_8_0_VERSION_OS }}
ValidateGitHubActionsProvider: true
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,7 @@ Thumbs.db
.DS_Store

# Generated Assembly info
AssemblyInfo.Generated.cs
AssemblyInfo.Generated.cs

# Verify
*.received
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
next-version: 3.0.0
next-version: 4.0.0
branches:
master:
regex: main
Expand Down
11 changes: 11 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### New in 4.0.0 (Released 2023/11/18)

* 4266 Update LatestPotentialBreakingChange to 4.0.0.
* 4132 Add File APIs for setting timestamps (creation time, last write time, last access time).
* 4250 Update System.Collections.Immutable to 8.0.0.
* 4260 Unzip alias should support overwrite files.
* 4251 Update System.Reflection.Metadata 8.0.0.
* 4249 Update Microsoft.Extensions.DependencyInjection to 8.0.0.
* 4197 Execution of Cake script fails if an addin defines an alias that uses nullable reference types in its signature.
* 4150 Cake script is contributing unactionable diagnostics in VS Code Problems pane.

### New in 3.2.0 (Released 2023/11/10)

* 4225 Add DotNetRemovePackage alias for dotnet remove package command.
Expand Down
7 changes: 4 additions & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Install .NET Core Global tools.
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitVersion.Tool&version=5.12.0"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitReleaseManager.Tool&version=0.13.0"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=GitReleaseManager.Tool&version=0.16.0"
#tool "dotnet:https://api.nuget.org/v3/index.json?package=sign&version=0.9.1-beta.23530.1&prerelease"

// Load other scripts.
Expand Down Expand Up @@ -108,7 +108,7 @@ Task("Run-Unit-Tests")
() => GetFiles("./src/**/*.Tests.csproj"),
(parameters, project, context) =>
{
foreach(var framework in new[] { "net6.0", "net7.0" })
foreach(var framework in new[] { "net6.0", "net7.0", "net8.0" })
{
FilePath testResultsPath = MakeAbsolute(parameters.Paths.Directories.TestResults
.CombineWithFilePath($"{project.GetFilenameWithoutExtension()}_{framework}_TestResults.xml"));
Expand Down Expand Up @@ -368,7 +368,8 @@ Task("Run-Integration-Tests")
.DoesForEach<BuildParameters, FilePath>(
parameters => new[] {
GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net6.0/**/Cake.dll").Single(),
GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net7.0/**/Cake.dll").Single()
GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net7.0/**/Cake.dll").Single(),
GetFiles($"{parameters.Paths.Directories.IntegrationTestsBinTool.FullPath}/**/net8.0/**/Cake.dll").Single()
},
(parameters, cakeAssembly, context) =>
{
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"src"
],
"sdk": {
"version": "7.0.403",
"version": "8.0.100",
"rollForward": "latestFeature"
}
}
4 changes: 2 additions & 2 deletions src/Cake.Common.Tests/Cake.Common.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
</ItemGroup>
<!-- Global packages -->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
23 changes: 18 additions & 5 deletions src/Cake.Common/IO/ZipAliases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,27 @@ public static void Zip(this ICakeContext context, DirectoryPath rootPath, FilePa
/// </example>
[CakeMethodAlias]
public static void Unzip(this ICakeContext context, FilePath zipFile, DirectoryPath outputPath)
=> context.Unzip(zipFile, outputPath, false);

/// <summary>
/// Unzips the specified file.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="zipFile">Zip file to unzip.</param>
/// <param name="outputPath">Output path to unzip into.</param>
/// <param name="overwriteFiles">Flag for if files should be overwritten in output.</param>
/// <example>
/// <code>
/// Unzip("Cake.zip", "./cake", true);
/// </code>
/// </example>
[CakeMethodAlias]
public static void Unzip(this ICakeContext context, FilePath zipFile, DirectoryPath outputPath, bool overwriteFiles)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context);

var zipper = new Zipper(context.FileSystem, context.Environment, context.Log);
zipper.Unzip(zipFile, outputPath);
zipper.Unzip(zipFile, outputPath, overwriteFiles);
}
}
}
23 changes: 13 additions & 10 deletions src/Cake.Common/IO/Zipper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,25 @@ public void Zip(DirectoryPath rootPath, FilePath outputPath, IEnumerable<FilePat
/// <param name="zipPath">Zip file path.</param>
/// <param name="outputPath">Output directory path.</param>
public void Unzip(FilePath zipPath, DirectoryPath outputPath)
=> Unzip(zipPath, outputPath, false);

/// <summary>
/// Unzips the specified file to the specified output path.
/// </summary>
/// <param name="zipPath">Zip file path.</param>
/// <param name="outputPath">Output directory path.</param>
/// <param name="overwriteFiles">Flag for if files should be overwritten in output.</param>
public void Unzip(FilePath zipPath, DirectoryPath outputPath, bool overwriteFiles)
{
if (zipPath == null)
{
throw new ArgumentNullException(nameof(zipPath));
}
if (outputPath == null)
{
throw new ArgumentNullException(nameof(outputPath));
}
ArgumentNullException.ThrowIfNull(zipPath);
ArgumentNullException.ThrowIfNull(outputPath);

// Make root path and output file path absolute.
zipPath = zipPath.MakeAbsolute(_environment);
outputPath = outputPath.MakeAbsolute(_environment);

_log.Verbose("Unzipping file {0} to {1}", zipPath.FullPath, outputPath.FullPath);
ZipFile.ExtractToDirectory(zipPath.FullPath, outputPath.FullPath);
_log.Verbose("Unzipping file {0} to {1} (overwrite files: {2})", zipPath.FullPath, outputPath.FullPath, overwriteFiles);
ZipFile.ExtractToDirectory(zipPath.FullPath, outputPath.FullPath, overwriteFiles);
}

private string GetRelativePath(DirectoryPath root, Path path)
Expand Down
7 changes: 4 additions & 3 deletions src/Cake.Core.Tests/Cake.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
</ItemGroup>
<!-- Global packages -->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Spectre.Verify.Extensions" Version="22.3.0" />
<PackageReference Include="Verify.Xunit" Version="22.5.0" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand All @@ -24,7 +26,6 @@
<PackageReference Include="Castle.Core" Version="5.1.1" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Unit\Scripting\CodeGen\Expected\Methods\*;Unit\Scripting\CodeGen\Expected\Properties\*" Exclude="bin\**;obj\**;**\*.xproj;packages\**;@(EmbeddedResource)" />
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>
16 changes: 16 additions & 0 deletions src/Cake.Core.Tests/Data/MethodAliasGeneratorData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,21 @@ public static dynamic NonGeneric_ExtensionMethodWithDynamicReturnValue(this ICak
{
throw new NotImplementedException();
}

[CakeMethodAlias]
#nullable enable
public static void NonGeneric_ExtensionMethodWithNullableParameter(this ICakeContext context, string? parameter)
#nullable disable
{
throw new NotImplementedException();
}

[CakeMethodAlias]
#nullable enable
public static string? NonGeneric_ExtensionMethodWithNullableReturnValue(this ICakeContext context)
#nullable disable
{
throw new NotImplementedException();
}
}
}
8 changes: 8 additions & 0 deletions src/Cake.Core.Tests/Data/PropertyAliasGeneratorData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,13 @@ public static int Cached_Obsolete_ExplicitError_WithMessage(this ICakeContext co
{
throw new NotImplementedException();
}

[CakePropertyAlias(Cache = true)]
#nullable enable
public static string? Cached_Nullable_Type(this ICakeContext context)
#nullable disable
{
throw new NotImplementedException();
}
}
}
26 changes: 0 additions & 26 deletions src/Cake.Core.Tests/Exceptions/CustomeExitCodeTests.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[System.Diagnostics.DebuggerStepThrough]
public void Generic_ExtensionMethod<TTest>()
=> Cake.Core.Tests.Data.MethodAliasGeneratorData.Generic_ExtensionMethod<TTest>(Context);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[System.Diagnostics.DebuggerStepThrough]
public TTest Generic_ExtensionMethodWithGenericReturnValue<TTest>(TTest value)
=> Cake.Core.Tests.Data.MethodAliasGeneratorData.Generic_ExtensionMethodWithGenericReturnValue<TTest>(Context, value);
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
public TOut Generic_ExtensionMethodWithGenericReturnValueAndTypeParamConstraints<TIn, TOut>(TIn arg)
where TIn : class, new()
where TOut : System.Collections.ArrayList, System.IDisposable
{
return Cake.Core.Tests.Data.MethodAliasGeneratorData.Generic_ExtensionMethodWithGenericReturnValueAndTypeParamConstraints<TIn, TOut>(Context, arg);
}
=> Cake.Core.Tests.Data.MethodAliasGeneratorData.Generic_ExtensionMethodWithGenericReturnValueAndTypeParamConstraints<TIn, TOut>(Context, arg);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[System.Diagnostics.DebuggerStepThrough]
public void Generic_ExtensionMethodWithParameter<TTest>(TTest value)
=> Cake.Core.Tests.Data.MethodAliasGeneratorData.Generic_ExtensionMethodWithParameter<TTest>(Context, value);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[System.Diagnostics.DebuggerStepThrough]
public dynamic NonGeneric_ExtensionMethodWithDynamicReturnValue()
=> Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithDynamicReturnValue(Context);
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithGenericCollectionOfNestedType(System.Collections.Generic.ICollection<Cake.Core.Tests.Data.MethodAliasGeneratorData.TestNestedEnum> items)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericCollectionOfNestedType(Context, items);
}
=> Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericCollectionOfNestedType(Context, items);
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithGenericExpressionArrayParameter(System.Linq.Expressions.Expression<System.Func<System.String, System.String>>[] expression)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericExpressionArrayParameter(Context, expression);
}
=> Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericExpressionArrayParameter(Context, expression);
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithGenericExpressionParameter(System.Linq.Expressions.Expression<System.Func<System.String, System.String>> expression)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericExpressionParameter(Context, expression);
}
=> Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericExpressionParameter(Context, expression);
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[System.Diagnostics.DebuggerStepThrough]
public void NonGeneric_ExtensionMethodWithGenericExpressionParamsArrayParameter(params System.Linq.Expressions.Expression<System.Func<System.String, System.String>>[] expression)
{
Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericExpressionParamsArrayParameter(Context, expression);
}
=> Cake.Core.Tests.Data.MethodAliasGeneratorData.NonGeneric_ExtensionMethodWithGenericExpressionParamsArrayParameter(Context, expression);
Loading

0 comments on commit 5929514

Please sign in to comment.