Skip to content

Commit 368917d

Browse files
authored
Merge pull request #467 from DemoBytom/feature/update-nuke
Updated Nuke to 10.1.0 Enabled source generation for Solution within build.
2 parents c50c7b5 + f3f0dc6 commit 368917d

File tree

4 files changed

+17
-24
lines changed

4 files changed

+17
-24
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
"nuke.globaltool": {
6-
"version": "10.0.0",
6+
"version": "10.1.0",
77
"commands": [
88
"nuke"
99
],

.github/workflows/CI.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
name: windows-latest
2424
runs-on: windows-latest
2525
steps:
26-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v6
2727
with:
2828
lfs: true
2929
fetch-depth: 0
@@ -40,22 +40,22 @@ jobs:
4040
CoverallsToken: ${{ secrets.COVERALLS_TOKEN }}
4141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4242
- name: 'Publish: coverage.zip'
43-
uses: actions/upload-artifact@v4
43+
uses: actions/upload-artifact@v5
4444
with:
4545
name: coverage.zip
4646
path: artifacts/coverage.zip
4747
- name: 'Publish: Demo.Engine.zip'
48-
uses: actions/upload-artifact@v4
48+
uses: actions/upload-artifact@v5
4949
with:
5050
name: Demo.Engine.zip
5151
path: artifacts/Demo.Engine.zip
5252
- name: 'Publish: Demo.Engine.win-x64.zip'
53-
uses: actions/upload-artifact@v4
53+
uses: actions/upload-artifact@v5
5454
with:
5555
name: Demo.Engine.win-x64.zip
5656
path: artifacts/Demo.Engine.win-x64.zip
5757
- name: 'Publish: Demo.Engine.win-arm64.zip'
58-
uses: actions/upload-artifact@v4
58+
uses: actions/upload-artifact@v5
5959
with:
6060
name: Demo.Engine.win-arm64.zip
6161
path: artifacts/Demo.Engine.win-arm64.zip

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
3939
<PackageVersion Include="Shouldly" Version="4.3.0" />
4040
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
41-
<PackageVersion Include="Nuke.Common" Version="10.0.0" />
41+
<PackageVersion Include="Nuke.Common" Version="10.1.0" />
4242
<PackageVersion Include="ReportGenerator" Version="5.5.0" />
4343
<PackageVersion Include="coveralls.net" Version="4.0.1" />
4444
</ItemGroup>

build/Build.cs

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ var nuke when nuke.TryGetValue("NUKE_RUN_ID", out var nukeid) => nukeid,
9090
_ => null
9191
};
9292

93-
[Solution] public readonly Solution Solution = default!;
93+
[Solution(GenerateProjects = true)] public readonly Solution Solution = default!;
9494
[GitRepository] private readonly GitRepository _gitRepository = default!;
9595

9696
private GitVersion _gitVersion = default!;
9797

9898
private static AbsolutePath SourceDirectory => RootDirectory / "src";
9999
private static AbsolutePath TestDirectory => RootDirectory / "test";
100100
private static AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
101-
private Project[] TestProjects => Solution.GetAllProjects("*.UTs").ToArray();
101+
private Project[] TestProjects => [.. Solution.test.Projects];
102102

103103
//private const string MASTER_BRANCH = "master";
104104
private const string DEVELOP_BRANCH = "develop";
@@ -287,7 +287,7 @@ protected override void OnBuildInitialized()
287287
{
288288
//A runtime dependant version is also currently generated by default and exposed to CI artifacts
289289
PublishApp(
290-
projectName: "Demo.Engine");
290+
Solution.src.Demo_Engine);
291291

292292
//We generate a self contained, "one file", trimmed version for Windows x64 by default
293293
//Any other can be generated as well, but aren't currently supported so aren't exposed to CI artifacts
@@ -300,7 +300,7 @@ protected override void OnBuildInitialized()
300300
foreach (var rid in rids)
301301
{
302302
PublishApp(
303-
projectName: "Demo.Engine",
303+
Solution.src.Demo_Engine,
304304
rid: rid);
305305
}
306306
});
@@ -346,30 +346,23 @@ protected override void OnBuildInitialized()
346346
);
347347
});
348348

349-
private void PublishApp(string projectName, string? rid = null, bool zipProject = true)
349+
private void PublishApp(Project project, string? rid = null, bool zipProject = true)
350350
{
351351
AbsolutePath outputDir;
352352
if (string.IsNullOrEmpty(rid))
353353
{
354-
outputDir = ArtifactsDirectory / projectName;
355-
Log.Information($"Publishing {projectName} into {outputDir}");
354+
outputDir = ArtifactsDirectory / project.Name;
355+
Log.Information($"Publishing {project.Name} into {outputDir}");
356356
}
357357
else
358358
{
359-
outputDir = ArtifactsDirectory / $"{projectName}.{rid}";
360-
Log.Information($"Publishing {projectName} for {rid} into {outputDir}");
359+
outputDir = ArtifactsDirectory / $"{project.Name}.{rid}";
360+
Log.Information($"Publishing {project.Name} for {rid} into {outputDir}");
361361
}
362362

363363
_ = DotNetPublish(t => t
364364
.SetProject(
365-
/* This doesn't work, because Demo.Engine is in a solution folder
366-
* And Solution.GetProject only searches through projects that are directly in the Solution
367-
* */
368-
//Solution.GetProject(projectName))
369-
v: Solution
370-
.AllProjects
371-
.Single(project
372-
=> project.Name.Equals(projectName, StringComparison.Ordinal)))
365+
v: project)
373366
.SetConfiguration(Configuration)
374367
//.SetProperty("Platform", platform)
375368
.SetAssemblyVersion(_gitVersion.AssemblySemVer)

0 commit comments

Comments
 (0)