Skip to content

Commit

Permalink
...cont
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmairegger committed Jan 13, 2025
1 parent f91b8f7 commit 5eb18d7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using Nuke.Common.CI.GitHubActions;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.GitVersion;
using Nuke.Common.Tools.NerdbankGitVersioning;
using Serilog;

Expand All @@ -21,7 +22,8 @@ class Build : NukeBuild
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
private readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;

[NerdbankGitVersioning]
[Required]
[NerdbankGitVersioning(UpdateBuildNumber = true)]
readonly NerdbankGitVersioning NerdbankVersioning;

[Parameter] [Secret] readonly string NuGetApiKey;
Expand All @@ -36,7 +38,6 @@ class Build : NukeBuild
Target Restore => t => t
.Executes(() =>
{
Log.Warning("NerdbankVersioning = {Value}", NerdbankVersioning.SimpleVersion);
DotNetRestore();
});

Expand Down Expand Up @@ -66,6 +67,7 @@ class Build : NukeBuild
{
DotNetPack(
c => c.EnableNoBuild()
.SetVersion(NerdbankVersioning.SimpleVersion)
.SetConfiguration(Configuration)
);
});
Expand Down
7 changes: 5 additions & 2 deletions build/build.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
Expand All @@ -11,8 +11,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.7.115" />
<PackageReference Include="Nuke.Common" Version="9.0.3" />
</ItemGroup>

<ItemGroup>
<PackageDownload Include="nbgv" Version="[3.7.115]" />
</ItemGroup>

</Project>
3 changes: 0 additions & 3 deletions src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,11 @@
<WarningsAsErrors Label="Package X has a known critical severity vulnerability">$(WarningsAsErrors);NU1904</WarningsAsErrors>
</PropertyGroup>
<PropertyGroup Label="Source commit tagging" Condition="'$(Configuration)' != 'Release'">
<!-- Note: This prevents rebuilding all projects because of a commit, since build steps injects version information into projects. -->
<!-- <NBGV_GitEngine>Disabled</NBGV_GitEngine>-->
<EnableSourceLink>false</EnableSourceLink>
<!-- prevents generation of $(ProjectName).sourcelink.json -->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" PrivateAssets="all" />
<!-- <GlobalPackageReference Include="Nerdbank.GitVersioning" PrivateAssets="all" Version="$(NerdbankGitVersioningVersion)" />-->
<GlobalPackageReference Include="WpfAnalyzers" Condition="'$(UseWpf)' == 'true'" Version="$(WpfAnalyzersVersion)" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 5eb18d7

Please sign in to comment.