Skip to content

Commit

Permalink
Closes cake-contrib#81 Updated Cake to v3.0
Browse files Browse the repository at this point in the history
Targeting .Net 6 and .Net 7
Consolidated references and removed duplicate analyzer references from project files
Moved 'Cake.Core' reference to make the build experience consistent across every environment
Updated other packages

Did not update to v3.1 because of official guidelines
  • Loading branch information
ebrahimi-esf committed Aug 15, 2023
1 parent 596abbb commit 9de8d94
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 69 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",
"version": "3.0.0",
"commands": [
"dotnet-cake"
]
Expand Down
21 changes: 8 additions & 13 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.13.0"
#tool "nuget:?package=GitVersion.CommandLine&version=5.8.1"
#tool "nuget:?package=NuGet.CommandLine&version=5.9.1"
#tool "nuget:?package=NUnit.ConsoleRunner&version=3.16.3"
#tool "nuget:?package=GitVersion.CommandLine&version=5.12.0"
#tool "nuget:?package=NuGet.CommandLine&version=6.6.1"
#load "./parameters.cake"


Expand Down Expand Up @@ -147,22 +147,17 @@ Task("Copy-Files")
.Does(() =>
{
EnsureDirectoryExists(parameters.ResultBinDir);
EnsureDirectoryExists(parameters.ResultBinDir + "/netcoreapp3.1");
EnsureDirectoryExists(parameters.ResultBinDir + "/net5.0");
EnsureDirectoryExists(parameters.ResultBinDir + "/net6.0");

CopyFileToDirectory(parameters.BuildDir + "/netcoreapp3.1/Cake.SqlServer.dll", parameters.ResultBinDir + "/netcoreapp3.1");
CopyFileToDirectory(parameters.BuildDir + "/netcoreapp3.1/Cake.SqlServer.pdb", parameters.ResultBinDir + "/netcoreapp3.1");
CopyFileToDirectory(parameters.BuildDir + "/netcoreapp3.1/Cake.SqlServer.xml", parameters.ResultBinDir + "/netcoreapp3.1");

CopyFileToDirectory(parameters.BuildDir + "/net5.0/Cake.SqlServer.dll", parameters.ResultBinDir + "/net5.0");
CopyFileToDirectory(parameters.BuildDir + "/net5.0/Cake.SqlServer.pdb", parameters.ResultBinDir + "/net5.0");
CopyFileToDirectory(parameters.BuildDir + "/net5.0/Cake.SqlServer.xml", parameters.ResultBinDir + "/net5.0");
EnsureDirectoryExists(parameters.ResultBinDir + "/net7.0");

CopyFileToDirectory(parameters.BuildDir + "/net6.0/Cake.SqlServer.dll", parameters.ResultBinDir + "/net6.0");
CopyFileToDirectory(parameters.BuildDir + "/net6.0/Cake.SqlServer.pdb", parameters.ResultBinDir + "/net6.0");
CopyFileToDirectory(parameters.BuildDir + "/net6.0/Cake.SqlServer.xml", parameters.ResultBinDir + "/net6.0");

CopyFileToDirectory(parameters.BuildDir + "/net7.0/Cake.SqlServer.dll", parameters.ResultBinDir + "/net7.0");
CopyFileToDirectory(parameters.BuildDir + "/net7.0/Cake.SqlServer.pdb", parameters.ResultBinDir + "/net7.0");
CopyFileToDirectory(parameters.BuildDir + "/net7.0/Cake.SqlServer.xml", parameters.ResultBinDir + "/net7.0");

CopyFiles(new FilePath[] { "LICENSE", "README.md", "ReleaseNotes.md" }, parameters.ResultBinDir);
});

Expand Down
12 changes: 4 additions & 8 deletions src/Cake.SqlServer/Cake.SqlServer.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>CS1591</NoWarn>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<ContentSNIFiles>true</ContentSNIFiles>
<PackageTags>cake script build cake-build addin cake-addin</PackageTags>
Expand All @@ -14,14 +12,12 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Cake.Core" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="CakeContrib.Guidelines" Version="1.3.0" PrivateAssets="All">
<PackageReference Include="CakeContrib.Guidelines" Version="1.4.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.0.0" />
<PackageReference Include="Microsoft.SqlServer.DACFx" Version="150.5282.3" Condition="'$(TargetFramework)' != 'net6.0'" />
<PackageReference Include="Microsoft.SqlServer.DACFx" Version="160.5339.7-preview" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" />
<PackageReference Include="Microsoft.SqlServer.DACFx" Version="162.0.52" />
</ItemGroup>

</Project>
21 changes: 4 additions & 17 deletions src/Cake.SqlServer/Cake.SqlServer.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,19 @@
<dependencies>
<group>
<dependency id="Microsoft.Data.SqlClient" version="4.0.0" />
</group>
<group targetFramework="netcoreapp3.1">
<dependency id="Microsoft.SqlServer.DACFx" version="150.5164.1" />
</group>
<group targetFramework="net5.0">
<dependency id="Microsoft.SqlServer.DACFx" version="150.5164.1" />
</group>
<group targetFramework="net6.0">
<dependency id="Microsoft.SqlServer.DACFx" version="160.5339.7-preview" />
</group>
</dependencies>
</metadata>
<files>

<file src="netcoreapp3.1/Cake.SqlServer.dll" target="lib/netcoreapp3.1" />
<file src="netcoreapp3.1/Cake.SqlServer.pdb" target="lib/netcoreapp3.1" />
<file src="netcoreapp3.1/Cake.SqlServer.xml" target="lib/netcoreapp3.1" />

<file src="net5.0/Cake.SqlServer.dll" target="lib/net5.0" />
<file src="net5.0/Cake.SqlServer.pdb" target="lib/net5.0" />
<file src="net5.0/Cake.SqlServer.xml" target="lib/net5.0" />

<file src="net6.0/Cake.SqlServer.dll" target="lib/net6.0" />
<file src="net6.0/Cake.SqlServer.pdb" target="lib/net6.0" />
<file src="net6.0/Cake.SqlServer.xml" target="lib/net6.0" />

<file src="net7.0/Cake.SqlServer.dll" target="lib/net7.0" />
<file src="net7.0/Cake.SqlServer.pdb" target="lib/net7.0" />
<file src="net7.0/Cake.SqlServer.xml" target="lib/net7.0" />

<file src="LICENSE" />
</files>
</package>
40 changes: 22 additions & 18 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,62 +13,66 @@
</PropertyGroup>

<ItemGroup>
<!-- Add reference to analyzers to all projects -->
<PackageReference Include="AsyncFixer" Version="1.5.1" >
<PackageReference Include="Cake.Core" Version="3.0.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>

<!-- Add reference to analyzers to all projects -->
<PackageReference Include="Asyncify" Version="0.9.7">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="codecracker.CSharp" Version="1.1.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="ConcurrencyLab.ParallelChecker" Version="2.2.0" >
<PackageReference Include="AsyncFixer" Version="1.6.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="ConcurrencyLab.ParallelChecker" Version="2.7.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="IDisposableAnalyzers" Version="4.0.0" >
<PackageReference Include="IDisposableAnalyzers" Version="4.0.6">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Meziantou.Analyzer" Version="1.0.679" >
<PackageReference Include="Meziantou.Analyzer" Version="2.0.82">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1" >
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" >
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.0.1" >
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" >
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.0.1" >
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.0.1" >
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0" >
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.3">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.0.1" >
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.0.64">
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.7.30">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="3.3.0" >
<PackageReference Include="Roslynator.Analyzers" Version="4.4.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" Version="3.3.0" >
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" Version="4.4.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="3.3.0" >
<PackageReference Include="Roslynator.Formatting.Analyzers" Version="4.4.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.32.0.39516" >
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.7.0.75501">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.354">
Expand Down
22 changes: 10 additions & 12 deletions src/Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<NoWarn>CS1591</NoWarn>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Cake.SqlServer\Cake.SqlServer.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Cake.Common" Version="2.0.0" />
<PackageReference Include="Cake.Core" Version="2.0.0" />
<PackageReference Include="Cake.Testing" Version="2.0.0" />
<PackageReference Include="Dapper" Version="2.0.123" />
<PackageReference Include="FluentAssertions" Version="6.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
<PackageReference Include="NunitXml.TestLogger" Version="3.0.117" />
<PackageReference Include="Cake.Common" Version="3.0.0" />
<PackageReference Include="Cake.Testing" Version="3.0.0" />
<PackageReference Include="Dapper" Version="2.0.143" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageReference Include="NSubstitute" Version="5.0.0" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NunitXml.TestLogger" Version="3.1.15" />
</ItemGroup>
<ItemGroup>
<None Update="TestData\backupGeneration.sql">
Expand Down

0 comments on commit 9de8d94

Please sign in to comment.