Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update package versions and enhance build script runtime handling #1180

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 86 additions & 80 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,51 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": {
"build": {
"type": "object",
"Host": {
"type": "string",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"ExecutableTarget": {
"type": "string",
"enum": [
"BuildInstaller",
"BundleApp",
"Clean",
"Compile",
"NuGetPack",
"Publish",
"Restore",
"Zip"
]
},
"Verbosity": {
"type": "string",
"description": "",
"enum": [
"Verbose",
"Normal",
"Minimal",
"Quiet"
]
},
"NukeBuild": {
"properties": {
"AssemblyVersion": {
"type": "string"
},
"Configuration": {
"type": "string",
"enum": [
"Debug",
"Release"
]
},
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
Expand All @@ -25,28 +55,8 @@
"description": "Shows the help text for this build assembly"
},
"Host": {
"type": "string",
"description": "Host for execution. Default is 'automatic'",
"enum": [
"AppVeyor",
"AzurePipelines",
"Bamboo",
"Bitbucket",
"Bitrise",
"GitHubActions",
"GitLab",
"Jenkins",
"Rider",
"SpaceAutomation",
"TeamCity",
"Terminal",
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"InformationalVersion": {
"type": "string"
"$ref": "#/definitions/Host"
},
"NoLogo": {
"type": "boolean",
Expand All @@ -71,6 +81,43 @@
"type": "string",
"description": "Root directory during build execution"
},
"Skip": {
"type": "array",
"description": "List of targets to be skipped. Empty list skips all dependencies",
"items": {
"$ref": "#/definitions/ExecutableTarget"
}
},
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
"items": {
"$ref": "#/definitions/ExecutableTarget"
}
},
"Verbosity": {
"description": "Logging verbosity during build execution. Default is 'Normal'",
"$ref": "#/definitions/Verbosity"
}
}
}
},
"allOf": [
{
"properties": {
"AssemblyVersion": {
"type": "string"
},
"Configuration": {
"type": "string",
"enum": [
"Debug",
"Release"
]
},
"InformationalVersion": {
"type": "string"
},
"Runtime": {
"type": "string",
"enum": [
Expand All @@ -86,58 +133,17 @@
"SelfContained": {
"type": "boolean"
},
"Skip": {
"type": "array",
"description": "List of targets to be skipped. Empty list skips all dependencies",
"items": {
"type": "string",
"enum": [
"BuildInstaller",
"BundleApp",
"Clean",
"Compile",
"NuGetPack",
"Publish",
"Restore",
"Zip"
]
}
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
},
"Target": {
"type": "array",
"description": "List of targets to be invoked. Default is '{default_target}'",
"items": {
"type": "string",
"enum": [
"BuildInstaller",
"BundleApp",
"Clean",
"Compile",
"NuGetPack",
"Publish",
"Restore",
"Zip"
]
}
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
"enum": [
"Minimal",
"Normal",
"Quiet",
"Verbose"
]
},
"Version": {
"type": "string"
}
}
},
{
"$ref": "#/definitions/NukeBuild"
}
}
]
}
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="9.0.0" />
<PackageVersion Include="NAudio.Core" Version="2.2.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Nito.AsyncEx" Version="5.1.2" />
<PackageVersion Include="NuGet.ProjectModel" Version="6.12.1" />
<PackageVersion Include="NuGet.Protocol" Version="6.12.1" />
<PackageVersion Include="NuGet.Resolver" Version="6.12.1" />
<PackageVersion Include="Nuke.Common" Version="8.1.4" />
<PackageVersion Include="Nuke.Common" Version="9.0.1" />
<PackageVersion Include="NUnit" Version="4.2.2" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="OpenCvSharp4" Version="4.10.0.20241108" />
Expand Down Expand Up @@ -84,4 +84,4 @@
<PackageVersion Include="System.Reactive" Version="6.0.1" />
<PackageVersion Include="Vortice.XAudio2" Version="3.6.2" />
</ItemGroup>
</Project>
</Project>
16 changes: 8 additions & 8 deletions nukebuild/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ private string GetTFM()

DotNetPublish(s => s
.EnableNoRestore()
.When(Runtime != null, s => s.SetRuntime(Runtime).SetSelfContained(SelfContained))
.When(Runtime == RuntimeIdentifier.win_x64, s => s.SetFramework($"{tfm}-windows"))
.When(Runtime != RuntimeIdentifier.win_x64, s => s.SetFramework(tfm))
.When(_ => Runtime != null, s => s.SetRuntime(Runtime).SetSelfContained(SelfContained))
.When(_ => Runtime == RuntimeIdentifier.win_x64, s => s.SetFramework($"{tfm}-windows"))
.When(_ => Runtime != RuntimeIdentifier.win_x64, s => s.SetFramework(tfm))
.SetConfiguration(Configuration)
.SetVersions(Version, AssemblyVersion, InformationalVersion)
.SetProject(mainProj)
Expand All @@ -100,9 +100,9 @@ private string GetTFM()
{
AbsolutePath output = OutputDirectory / item;
DotNetPublish(s => s
.When(Runtime != null, s => s.SetRuntime(Runtime).SetSelfContained(SelfContained))
.When(Runtime == RuntimeIdentifier.win_x64, s => s.SetFramework($"{tfm}-windows"))
.When(Runtime != RuntimeIdentifier.win_x64, s => s.SetFramework(tfm))
.When(_ => Runtime != null, s => s.SetRuntime(Runtime).SetSelfContained(SelfContained))
.When(_ => Runtime == RuntimeIdentifier.win_x64, s => s.SetFramework($"{tfm}-windows"))
.When(_ => Runtime != RuntimeIdentifier.win_x64, s => s.SetFramework(tfm))
.EnableNoRestore()
.SetConfiguration(Configuration)
.SetVersions(Version, AssemblyVersion, InformationalVersion)
Expand All @@ -111,7 +111,7 @@ private string GetTFM()

output.GlobFiles($"**/{item}*")
.Select(p => (Source: p, Target: mainOutput / output.GetRelativePathTo(p)))
.ForEach(t => CopyFile(t.Source, t.Target));
.ForEach(t => t.Source.Copy(t.Target));
}

string[] asmsToCopy =
Expand All @@ -129,7 +129,7 @@ private string GetTFM()
AbsolutePath output = OutputDirectory / asm;
output.GlobFiles($"**/{asm}.*")
.Select(p => (Source: p, Target: mainOutput / output.GetRelativePathTo(p)))
.ForEach(t => CopyFile(t.Source, t.Target));
.ForEach(t => t.Source.Copy(t.Target));
}
}
});
Expand Down
1 change: 0 additions & 1 deletion nukebuild/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<ImplicitUsings>true</ImplicitUsings>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading