Skip to content

Commit dd409b1

Browse files
Update build and packages (#105)
* Experiment with build * build * tidy * fix build * f * f * f * f * f * f
1 parent 17d0dc6 commit dd409b1

File tree

13 files changed

+87
-388
lines changed

13 files changed

+87
-388
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"gitversion.tool": {
6-
"version": "6.1.0",
6+
"version": "6.3.0",
77
"commands": [
88
"dotnet-gitversion"
99
]

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ updates:
33
- package-ecosystem: "nuget"
44
directory: "/"
55
schedule:
6-
interval: "daily"
6+
interval: "monthly"
77

88
- package-ecosystem: "nuget"
99
directory: "/build"
1010
schedule:
11-
interval: "weekly"
11+
interval: "monthly"
1212

1313
- package-ecosystem: "nuget"
1414
directory: "/.config"
1515
schedule:
16-
interval: "weekly"
16+
interval: "monthly"

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
2020
- name: Fetch all tags and branches
2121
run: git fetch --prune --unshallow
2222
- name: Build
2323
run: ./build.sh
2424
- name: Upload artifacts
25-
uses: actions/upload-artifact@v3
25+
uses: actions/upload-artifact@v4
2626
with:
2727
path: artifacts/*.nupkg

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414

1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
- name: Fetch all tags and branches
1919
run: git fetch --prune --unshallow
2020
- name: Deploy
2121
env:
2222
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
2323
run: ./build.sh publish
2424
- name: Upload artifacts
25-
uses: actions/upload-artifact@v3
25+
uses: actions/upload-artifact@v4
2626
with:
2727
path: artifacts/*.nupkg

build/build.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
}
1818
});
1919

20-
Target("restore", DependsOn("clean"), () =>
20+
Target("restore", dependsOn: ["clean"], () =>
2121
{
2222
Run("dotnet", "restore");
2323
});
2424

25-
Target("build", DependsOn("restore"), () =>
25+
Target("build", dependsOn: ["restore"], () =>
2626
{
2727
Run("dotnet", "build " +
2828
"--no-restore " +
@@ -33,24 +33,24 @@
3333
$"--property InformationalVersion={version.InformationalVersion}");
3434
});
3535

36-
Target("test", DependsOn("build"), () =>
36+
Target("test", dependsOn: ["build"], () =>
3737
{
3838
Run("dotnet", "test --configuration Release --no-restore --no-build");
3939
});
4040

41-
Target("package", DependsOn("build", "test"), () =>
41+
Target("package", dependsOn: ["build", "test"], () =>
4242
{
4343
Run("dotnet", $"pack --configuration Release --no-restore --no-build --output artifacts --property Version={version.SemVer}");
4444
});
4545

46-
Target("publish", DependsOn("package"), () =>
46+
Target("publish", dependsOn: ["package"], () =>
4747
{
4848
var apiKey = Environment.GetEnvironmentVariable("NUGET_API_KEY");
4949

5050
Run("dotnet", $"nuget push {Path.Combine("artifacts", "*.nupkg")} --api-key {apiKey} --source https://api.nuget.org/v3/index.json");
5151
});
5252

53-
Target("default", DependsOn("package"));
53+
Target("default", dependsOn: ["package"]);
5454

5555
await RunTargetsAndExitAsync(args);
5656

build/build.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Bullseye" Version="5.0.0" />
9+
<PackageReference Include="Bullseye" Version="6.0.0" />
1010
<PackageReference Include="SimpleExec" Version="12.0.0" />
11-
<PackageReference Include="System.Text.Json" Version="9.0.0" />
1211
</ItemGroup>
1312

1413
</Project>

src/Conductor.Tests/Conductor.Tests.csproj

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0</TargetFrameworks>
5-
<RootNamespace>Conductor</RootNamespace>
4+
<TargetFrameworks>net8.0</TargetFrameworks>
65
<LangVersion>latest</LangVersion>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
78
<IsPackable>false</IsPackable>
89
</PropertyGroup>
910

1011
<ItemGroup>
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
12-
<PackageReference Include="xunit" Version="2.9.2" />
13-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
14-
<PrivateAssets>all</PrivateAssets>
15-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16-
</PackageReference>
12+
<PackageReference Include="TUnit" Version="0.25.21" />
1713
</ItemGroup>
1814

1915
<ItemGroup>
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
1-
using System;
2-
using Xunit;
3-
4-
namespace Conductor
1+
namespace Conductor.Tests
52
{
63
public class InitializeModuleExceptionTests
74
{
8-
[Fact]
9-
public void IsTypeOfException()
5+
[Test]
6+
public async Task IsTypeOfException()
107
{
118
var exception = new InitializeModuleException();
129

13-
Assert.IsAssignableFrom<Exception>(exception);
10+
await Assert.That(exception).IsAssignableTo<Exception>();
1411
}
1512

16-
[Fact]
17-
public void InnerExceptionSet()
13+
[Test]
14+
public async Task InnerExceptionSet()
1815
{
1916
var innerException = new Exception();
2017
var exception = new InitializeModuleException("msg", innerException);
2118

22-
Assert.Same(innerException, exception.InnerException);
19+
await Assert.That(innerException).IsSameReferenceAs(exception.InnerException);
2320
}
2421

25-
[Fact]
26-
public void HasMessage()
22+
[Test]
23+
public async Task HasMessage()
2724
{
2825
var exception = new InitializeModuleException("msg");
2926

30-
Assert.Equal("msg", exception.Message);
27+
await Assert.That(exception.Message).IsEqualTo("msg");
3128
}
3229
}
3330
}

src/Conductor.Tests/ModuleLoaderTests.cs

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
using System;
2-
using Xunit;
1+
using TUnit.Assertions.AssertConditions.Throws;
32

4-
namespace Conductor
3+
namespace Conductor.Tests
54
{
65
public class ModuleLoaderTests
76
{
8-
[Fact]
9-
public void NullConstructorThrows()
7+
[Test]
8+
public async Task NullConstructorThrows()
109
{
11-
var exception = Record.Exception(() => new ModuleLoader(null!));
12-
13-
Assert.IsType<ArgumentNullException>(exception);
10+
await Assert.That(() => new ModuleLoader(null!)).Throws<ArgumentNullException>();
1411
}
1512

16-
[Fact]
17-
public void InitialiseTypePassedToCreator()
13+
[Test]
14+
public async Task InitialiseTypePassedToCreator()
1815
{
1916
var module = new MockModule();
20-
Type type = null;
17+
Type type = null!;
2118

2219
IModule Action(Type x)
2320
{
@@ -31,11 +28,11 @@ IModule Action(Type x)
3128

3229
loader.Initialize();
3330

34-
Assert.Equal(typeof(object), type);
31+
await Assert.That(type).IsEqualTo(typeof(object));
3532
}
3633

37-
[Fact]
38-
public void InitialiseCalledOnModule()
34+
[Test]
35+
public async Task InitialiseCalledOnModule()
3936
{
4037
var module = new MockModule();
4138

@@ -44,84 +41,83 @@ public void InitialiseCalledOnModule()
4441

4542
loader.Initialize();
4643

47-
Assert.True(module.InitializeCalled);
44+
await Assert.That(module.InitializeCalled).IsTrue();
4845
}
4946

50-
[Fact]
51-
public void InnerErrorInInitialiseRaisesModuleInitialiseException()
47+
[Test]
48+
public async Task InnerErrorInInitialiseRaisesModuleInitialiseException()
5249
{
5350
var module = new InvalidModule();
5451

5552
var loader = new ModuleLoader(_ => module);
5653
loader.Add(typeof(object));
5754

58-
var exception = Record.Exception(() => loader.Initialize());
55+
var exception = Assert.Throws(() => loader.Initialize());
5956

60-
Assert.IsType<InitializeModuleException>(exception);
61-
Assert.IsType<InvalidOperationException>(exception.InnerException);
57+
await Assert.That(exception).IsTypeOf<InitializeModuleException>();
58+
await Assert.That(exception.InnerException).IsTypeOf<InvalidOperationException>();
6259
}
6360

64-
[Fact]
65-
public void NullModuleReturnedThrows()
61+
[Test]
62+
public async Task NullModuleReturnedThrows()
6663
{
67-
var loader = new ModuleLoader(_ => null);
64+
var loader = new ModuleLoader(_ => null!);
6865
loader.Add(typeof(object));
6966

70-
var exception = Record.Exception(() => loader.Initialize());
67+
var exception = Assert.Throws(() => loader.Initialize());
7168

72-
Assert.IsType<InitializeModuleException>(exception);
69+
await Assert.That(exception).IsTypeOf<InitializeModuleException>();
7370
}
7471

75-
[Fact]
76-
public void InitializeAfterInitializedThrows()
72+
[Test]
73+
public async Task InitializeAfterInitializedThrows()
7774
{
78-
var loader = new ModuleLoader(_ => null);
75+
var loader = new ModuleLoader(_ => null!);
7976
loader.Initialize();
8077

81-
var exception = Record.Exception(() => loader.Initialize());
78+
var exception = Assert.Throws(() => loader.Initialize());
8279

83-
Assert.IsType<InvalidOperationException>(exception);
80+
await Assert.That(exception).IsTypeOf<InvalidOperationException>();
8481
}
8582

86-
[Fact]
87-
public void CreatesWithEmptyModules()
83+
[Test]
84+
public async Task CreatesWithEmptyModules()
8885
{
89-
var loader = new ModuleLoader(_ => null);
86+
var loader = new ModuleLoader(_ => null!);
9087

91-
Assert.NotNull(loader.ModuleTypes);
92-
Assert.Empty(loader.ModuleTypes);
88+
await Assert.That(loader.ModuleTypes).IsNotNull().And.IsEmpty();
9389
}
9490

95-
[Fact]
96-
public void NullAddArgumentThrows()
91+
[Test]
92+
public async Task NullAddArgumentThrows()
9793
{
98-
var loader = new ModuleLoader(_ => null);
94+
var loader = new ModuleLoader(_ => null!);
9995

100-
var exception = Record.Exception(() => loader.Add(null!));
96+
var exception = Assert.Throws(() => loader.Add(null!));
10197

102-
Assert.IsType<ArgumentNullException>(exception);
98+
await Assert.That(exception).IsTypeOf<ArgumentNullException>();
10399
}
104100

105-
[Fact]
106-
public void AddExistingModuleThrows()
101+
[Test]
102+
public async Task AddExistingModuleThrows()
107103
{
108-
var loader = new ModuleLoader(_ => null);
104+
var loader = new ModuleLoader(_ => null!);
109105

110106
loader.Add(typeof(object));
111107

112-
var exception = Record.Exception(() => loader.Add(typeof(object)));
108+
var exception = Assert.Throws(() => loader.Add(typeof(object)));
113109

114-
Assert.IsType<InvalidOperationException>(exception);
110+
await Assert.That(exception).IsTypeOf<InvalidOperationException>();
115111
}
116112

117-
[Fact]
118-
public void AddedModuleIsVisibleInCatalog()
113+
[Test]
114+
public async Task AddedModuleIsVisibleInCatalog()
119115
{
120-
var loader = new ModuleLoader(_ => null);
116+
var loader = new ModuleLoader(_ => null!);
121117

122118
loader.Add(typeof(object));
123119

124-
Assert.Contains(typeof(object), loader.ModuleTypes);
120+
await Assert.That(loader.ModuleTypes).Contains(typeof(object));
125121
}
126122

127123
private class MockModule : IModule

src/Conductor/Conductor.csproj

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Version>1.0.0</Version>
5-
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0</TargetFrameworks>
4+
<TargetFramework>netstandard2.0</TargetFramework>
65
<LangVersion>latest</LangVersion>
6+
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<GenerateDocumentationFile>true</GenerateDocumentationFile>
9+
</PropertyGroup>
910

11+
<PropertyGroup>
1012
<Authors>Robert Coltheart</Authors>
1113
<Description>A framework for building modular applications.</Description>
1214
<PackageProjectUrl>https://github.com/robertcoltheart/Conductor</PackageProjectUrl>
1315
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1416
<PackageTags>module modular framework</PackageTags>
17+
<PackageReadmeFile>README.md</PackageReadmeFile>
1518
</PropertyGroup>
1619

1720
<ItemGroup>
18-
<Compile Update="Properties\Resources.Designer.cs">
19-
<DesignTime>True</DesignTime>
20-
<AutoGen>True</AutoGen>
21-
<DependentUpon>Resources.resx</DependentUpon>
22-
</Compile>
23-
</ItemGroup>
24-
25-
<ItemGroup>
26-
<EmbeddedResource Update="Properties\Resources.resx">
27-
<Generator>ResXFileCodeGenerator</Generator>
28-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
29-
</EmbeddedResource>
21+
<None Include="../../README.md" Pack="true" PackagePath="\" />
3022
</ItemGroup>
3123

3224
</Project>

0 commit comments

Comments
 (0)