Skip to content

Commit 8c4f04e

Browse files
committed
Migrate from Cake .NET Tool to Cake Frosting
Fixes #859
1 parent 26dbdcc commit 8c4f04e

File tree

19 files changed

+347
-258
lines changed

19 files changed

+347
-258
lines changed

.config/dotnet-tools.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

.github/workflows/cicd.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,14 @@ jobs:
113113
- name: Setup .NET
114114
uses: actions/setup-dotnet@v4
115115

116-
- name: Restore .NET Tools
117-
run: dotnet tool restore
118-
119116
- name: Restore NuGet Packages
120-
run: dotnet cake --target=Restore-NuGet-Packages
117+
run: ./build.sh --target=Restore-NuGet-Packages
121118

122119
- name: Run Build
123-
run: dotnet cake --target=Build
120+
run: ./build.sh --target=Build
124121

125122
- name: Run Tests
126-
run: dotnet cake --target=Test --test-project=${{ matrix.test-projects.name }}
123+
run: ./build.sh --target=Test --test-project=${{ matrix.test-projects.name }}
127124

128125
- name: Upload Test And Coverage Results
129126
uses: actions/upload-artifact@v4
@@ -188,23 +185,20 @@ jobs:
188185
- name: Setup .NET
189186
uses: actions/setup-dotnet@v4
190187

191-
- name: Restore .NET Tools
192-
run: dotnet tool restore
193-
194188
- name: Restore NuGet Packages
195-
run: dotnet cake --target=Restore-NuGet-Packages
189+
run: ./build.sh --target=Restore-NuGet-Packages
196190

197191
- name: Run Sonar Analysis
198-
run: dotnet cake --target=Sonar-Begin
192+
run: ./build.sh --target=Sonar-Begin
199193

200194
- name: Run Build
201-
run: dotnet cake --target=Build
195+
run: ./build.sh --target=Build
202196

203197
- name: Upload Sonar Results
204-
run: dotnet cake --target=Sonar-End
198+
run: ./build.sh --target=Sonar-End
205199

206200
- name: Publish NuGet Package
207-
run: dotnet cake --target=Publish
201+
run: ./build.sh --target=Publish
208202

209203
# Cake sets the semVer environment variable
210204
- uses: release-drafter/release-drafter@v6

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,6 @@ healthchecksdb
347347
# Backup folder for Package Reference Convert tool in Visual Studio 2017
348348
MigrationBackup/
349349

350-
# Cake Build
351-
.cake-tools/*
352-
!.cake-tools/packages.config
353-
354350
# Project
355351
test-results/
356352
test-coverage/

Directory.Packages.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3"/>
1313
<PackageVersion Include="SharpZipLib" Version="1.4.2"/>
1414
<PackageVersion Include="SSH.NET" Version="2024.2.0"/>
15+
<!-- Cake build: -->
16+
<PackageVersion Include="Cake.Frosting" Version="5.0.0"/>
17+
<PackageVersion Include="Cake.Frosting.Git" Version="5.0.1"/>
18+
<PackageVersion Include="Cake.Sonar" Version="5.0.0"/>
1519
<!-- Unit and integration test dependencies: -->
1620
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
1721
<PackageVersion Include="Microsoft.Extensions.Diagnostics.Testing" Version="8.10.0"/>

Testcontainers.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{673F23AE-769
1313
EndProject
1414
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{7164F1FB-7F24-444A-ACD2-2C329C2B3CCF}"
1515
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build", "build\Build.csproj", "{84C38720-3397-4012-8C38-822D1D367BAB}"
17+
EndProject
1618
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ActiveMq", "src\Testcontainers.ActiveMq\Testcontainers.ActiveMq.csproj", "{5365F780-0E6C-41F0-B1B9-7DC34368F80C}"
1719
EndProject
1820
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testcontainers.ArangoDb", "src\Testcontainers.ArangoDb\Testcontainers.ArangoDb.csproj", "{AB9C1563-07C7-4685-BACD-BB1FF64B3611}"
@@ -255,6 +257,10 @@ Global
255257
Release|Any CPU = Release|Any CPU
256258
EndGlobalSection
257259
GlobalSection(ProjectConfigurationPlatforms) = postSolution
260+
{84C38720-3397-4012-8C38-822D1D367BAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
261+
{84C38720-3397-4012-8C38-822D1D367BAB}.Debug|Any CPU.Build.0 = Debug|Any CPU
262+
{84C38720-3397-4012-8C38-822D1D367BAB}.Release|Any CPU.ActiveCfg = Release|Any CPU
263+
{84C38720-3397-4012-8C38-822D1D367BAB}.Release|Any CPU.Build.0 = Release|Any CPU
258264
{5365F780-0E6C-41F0-B1B9-7DC34368F80C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
259265
{5365F780-0E6C-41F0-B1B9-7DC34368F80C}.Debug|Any CPU.Build.0 = Debug|Any CPU
260266
{5365F780-0E6C-41F0-B1B9-7DC34368F80C}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -732,6 +738,7 @@ Global
732738
HideSolutionNode = FALSE
733739
EndGlobalSection
734740
GlobalSection(NestedProjects) = preSolution
741+
{84C38720-3397-4012-8C38-822D1D367BAB} = {AF017206-CE20-4DDF-8301-CAC68CED1BE6}
735742
{5365F780-0E6C-41F0-B1B9-7DC34368F80C} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
736743
{AB9C1563-07C7-4685-BACD-BB1FF64B3611} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}
737744
{3F2E254F-C203-43FD-A078-DC3E2CBC0F9F} = {673F23AE-7694-4BB9-ABD4-136D6C13634E}

build.cake

Lines changed: 0 additions & 217 deletions
This file was deleted.

build.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dotnet run --project build/Build.csproj -- $args
2+
exit $LASTEXITCODE;

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dotnet run --project ./build/Build.csproj -- "$@"

build/Build.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<SignAssembly>false</SignAssembly>
6+
<RunWorkingDirectory>$(MSBuildProjectDirectory)/..</RunWorkingDirectory>
7+
<RootNamespace>Testcontainers.Build</RootNamespace>
8+
</PropertyGroup>
9+
<ItemGroup>
10+
<PackageReference Include="Cake.Frosting"/>
11+
<PackageReference Include="Cake.Frosting.Git"/>
12+
<PackageReference Include="Cake.Sonar"/>
13+
<PackageReference Include="JetBrains.Annotations" VersionOverride="2023.3.0" PrivateAssets="All"/>
14+
</ItemGroup>
15+
</Project>
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
namespace TestContainers.Build;
2+
13
internal sealed class BuildCredentials
24
{
35
public string Username { get; private set; }
46
public string Password { get; private set; }
57

6-
public BuildCredentials(string username, string password)
8+
private BuildCredentials(string username, string password)
79
{
810
Username = username;
911
Password = password;

0 commit comments

Comments
 (0)