diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..3ca39f9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: build + +on: [push, pull_request] + +jobs: + build: + strategy: + matrix: + configuration: [Debug, Release] + runs-on: windows-latest + env: + CONFIGURATION: ${{ matrix.configuration }} + MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }} + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v3 + - name: 'Cache: .nuke/temp, ~/.nuget/packages' + uses: actions/cache@v3 + with: + path: | + .nuke/temp + ~/.nuget/packages + key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }} + - name: 'Run: ' + run: ./build.cmd diff --git a/.gitignore b/.gitignore index 9dc970b..7216a73 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ # Build results +.nuke/temp/ + [Aa]rtifacts/ [Bb]in/ [Oo]bj/ diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json new file mode 100644 index 0000000..8d2c8e4 --- /dev/null +++ b/.nuke/build.schema.json @@ -0,0 +1,127 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/build", + "title": "Build Schema", + "definitions": { + "build": { + "type": "object", + "properties": { + "BuildNumberOffset": { + "type": "string" + }, + "Configuration": { + "type": "string", + "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)", + "enum": [ + "Debug", + "Release" + ] + }, + "Continue": { + "type": "boolean", + "description": "Indicates to continue a previously failed build attempt" + }, + "GitHubToken": { + "type": "string", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "Help": { + "type": "boolean", + "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" + ] + }, + "MyGetApiKey": { + "type": "string", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "NoLogo": { + "type": "boolean", + "description": "Disables displaying the NUKE logo" + }, + "NuGetApiKey": { + "type": "string", + "default": "Secrets must be entered via 'nuke :secrets [profile]'" + }, + "Partition": { + "type": "string", + "description": "Partition to use on CI" + }, + "Plan": { + "type": "boolean", + "description": "Shows the execution plan (HTML)" + }, + "Profile": { + "type": "array", + "description": "Defines the profiles to load", + "items": { + "type": "string" + } + }, + "Root": { + "type": "string", + "description": "Root directory during build execution" + }, + "Skip": { + "type": "array", + "description": "List of targets to be skipped. Empty list skips all dependencies", + "items": { + "type": "string", + "enum": [ + "Compile", + "Pack", + "PushMyGet", + "PushNuGet", + "ReleaseGitHub", + "Restore" + ] + } + }, + "Target": { + "type": "array", + "description": "List of targets to be invoked. Default is '{default_target}'", + "items": { + "type": "string", + "enum": [ + "Compile", + "Pack", + "PushMyGet", + "PushNuGet", + "ReleaseGitHub", + "Restore" + ] + } + }, + "Verbosity": { + "type": "string", + "description": "Logging verbosity during build execution. Default is 'Normal'", + "enum": [ + "Minimal", + "Normal", + "Quiet", + "Verbose" + ] + } + } + } + } +} diff --git a/.nuke/parameters.json b/.nuke/parameters.json new file mode 100644 index 0000000..46b8230 --- /dev/null +++ b/.nuke/parameters.json @@ -0,0 +1,3 @@ +{ + "$schema": "./build.schema.json" +} diff --git a/Movere.sln b/Movere.sln index 0903bec..d18fdb6 100644 --- a/Movere.sln +++ b/Movere.sln @@ -6,9 +6,17 @@ MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{89EF6D8C-C8F7-4374-B424-C88013F4791C}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig - appveyor.yml = appveyor.yml + .gitignore = .gitignore Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets + README.md = README.md + EndProjectSection +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{5198C849-634F-4EFC-9D2B-37EDC21545B7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflow", "workflow", "{00A091A2-D308-4078-B5E3-A9D04DD9503D}" + ProjectSection(SolutionItems) = preProject + .github\workflows\build.yml = .github\workflows\build.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{233FDDCD-5706-4E83-AF15-41A0CA9F0E42}" @@ -26,6 +34,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Targets", "Targets", "{9C93 build\Targets\RepoLayout.props = build\Targets\RepoLayout.props EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build\_build.csproj", "{111F78F0-6F7E-438A-BE99-DAFEB691BBFD}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Movere", "src\Movere\Movere.csproj", "{4B0E3D01-F0C9-42EF-9556-32C96F59E353}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Movere.Sample", "samples\Movere.Sample\Movere.Sample.csproj", "{1C5611B0-C2EE-43C5-BA3F-8016E2704969}" @@ -38,6 +48,8 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {111F78F0-6F7E-438A-BE99-DAFEB691BBFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {111F78F0-6F7E-438A-BE99-DAFEB691BBFD}.Release|Any CPU.ActiveCfg = Release|Any CPU {4B0E3D01-F0C9-42EF-9556-32C96F59E353}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4B0E3D01-F0C9-42EF-9556-32C96F59E353}.Debug|Any CPU.Build.0 = Debug|Any CPU {4B0E3D01-F0C9-42EF-9556-32C96F59E353}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -55,6 +67,8 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution + {5198C849-634F-4EFC-9D2B-37EDC21545B7} = {89EF6D8C-C8F7-4374-B424-C88013F4791C} + {00A091A2-D308-4078-B5E3-A9D04DD9503D} = {5198C849-634F-4EFC-9D2B-37EDC21545B7} {233FDDCD-5706-4E83-AF15-41A0CA9F0E42} = {89EF6D8C-C8F7-4374-B424-C88013F4791C} {9C9397C0-677A-481E-9A3B-5C0152ECF6E1} = {233FDDCD-5706-4E83-AF15-41A0CA9F0E42} EndGlobalSection diff --git a/README.md b/README.md index 708e82b..1338d46 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build status](https://ci.appveyor.com/api/projects/status/8iddgvgjklwoj91y/branch/master?svg=true)](https://ci.appveyor.com/project/jp2masa/Movere/branch/master) +[![Build Status](https://github.com/jp2masa/Movere/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/jp2masa/Movere/actions/workflows/build.yml) [![NuGet](https://img.shields.io/nuget/v/Movere.svg)](https://www.nuget.org/packages/Movere/) [![MyGet](https://img.shields.io/myget/jp2masa/vpre/Movere.svg?label=myget)](https://www.myget.org/feed/jp2masa/package/nuget/Movere) diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index a515d70..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,55 +0,0 @@ -version: 0.2.0-build{build} -image: Visual Studio 2022 - -shallow_clone: true -clone_folder: c:\Movere - -configuration: - - Debug - - Release -platform: Any CPU - -matrix: - fast_finish: true - -nuget: - account_feed: false - project_feed: true - disable_publish_on_pr: true - -build_script: - - cmd: dotnet msbuild /t:Restore;Build;Pack Movere.sln - -test: off - -artifacts: - - path: 'artifacts\Debug\nupkg\*.nupkg' - name: DebugNupkg - - path: 'artifacts\Release\nupkg\*.nupkg' - name: ReleaseNupkg - -deploy: -- provider: GitHub - auth_token: - secure: RTVjUSopq60NVzduiYyX2q/DPWQbp7EGQpKVjTY52hs5pi6gXP43rkocX24ddA2w - artifact: ReleaseNupkg - on: - branch: master - configuration: Release - appveyor_repo_tag: true -- provider: NuGet - api_key: - secure: Hn80g98uHMQpM1TktBSSgPs7b4UNNkh/463+unvkHeuSTwwnD4c7hfaHuoDBWA2K - artifact: ReleaseNupkg - on: - branch: master - configuration: Release - appveyor_repo_tag: true -- provider: NuGet - server: https://www.myget.org/F/jp2masa/api/v2/package - artifact: DebugNupkg - api_key: - secure: puOcEbngEmaVMEnUL20u4mzATgvoyaTPRWGGwE98as1+8KGY3ypOKzt5OV63duwI - on: - branch: master - configuration: Debug diff --git a/build.cmd b/build.cmd new file mode 100755 index 0000000..b08cc59 --- /dev/null +++ b/build.cmd @@ -0,0 +1,7 @@ +:; set -eo pipefail +:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) +:; ${SCRIPT_DIR}/build.sh "$@" +:; exit $? + +@ECHO OFF +powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %* diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..77c2e42 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,74 @@ +[CmdletBinding()] +Param( + [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] + [string[]]$BuildArguments +) + +Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)" + +Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 } +$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent + +########################################################################### +# CONFIGURATION +########################################################################### + +$BuildProjectFile = "$PSScriptRoot\build\_build\_build.csproj" +$TempDirectory = "$PSScriptRoot\\.nuke\temp" + +$DotNetGlobalFile = "$PSScriptRoot\\global.json" +$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1" +$DotNetChannel = "STS" + +$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1 +$env:DOTNET_NOLOGO = 1 + +########################################################################### +# EXECUTION +########################################################################### + +function ExecSafe([scriptblock] $cmd) { + & $cmd + if ($LASTEXITCODE) { exit $LASTEXITCODE } +} + +# If dotnet CLI is installed globally and it matches requested version, use for execution +if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and ` + $(dotnet --version) -and $LASTEXITCODE -eq 0) { + $env:DOTNET_EXE = (Get-Command "dotnet").Path +} +else { + # Download install script + $DotNetInstallFile = "$TempDirectory\dotnet-install.ps1" + New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile) + + # If global.json exists, load expected version + if (Test-Path $DotNetGlobalFile) { + $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json) + if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) { + $DotNetVersion = $DotNetGlobal.sdk.version + } + } + + # Install by channel or version + $DotNetDirectory = "$TempDirectory\dotnet-win" + if (!(Test-Path variable:DotNetVersion)) { + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath } + } else { + ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath } + } + $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe" + $env:PATH = "$DotNetDirectory;$env:PATH" +} + +Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)" + +if (Test-Path env:NUKE_ENTERPRISE_TOKEN) { + & $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null + & $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null +} + +ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet } +ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments } diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..a5f213d --- /dev/null +++ b/build.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash + +bash --version 2>&1 | head -n 1 + +set -eo pipefail +SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) + +########################################################################### +# CONFIGURATION +########################################################################### + +BUILD_PROJECT_FILE="$SCRIPT_DIR/build/_build/_build.csproj" +TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp" + +DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json" +DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh" +DOTNET_CHANNEL="STS" + +export DOTNET_CLI_TELEMETRY_OPTOUT=1 +export DOTNET_NOLOGO=1 + +########################################################################### +# EXECUTION +########################################################################### + +function FirstJsonValue { + perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}" +} + +# If dotnet CLI is installed globally and it matches requested version, use for execution +if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then + export DOTNET_EXE="$(command -v dotnet)" +else + # Download install script + DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh" + mkdir -p "$TEMP_DIRECTORY" + curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL" + chmod +x "$DOTNET_INSTALL_FILE" + + # If global.json exists, load expected version + if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then + DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")") + if [[ "$DOTNET_VERSION" == "" ]]; then + unset DOTNET_VERSION + fi + fi + + # Install by channel or version + DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix" + if [[ -z ${DOTNET_VERSION+x} ]]; then + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path + else + "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path + fi + export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet" + export PATH="$DOTNET_DIRECTORY:$PATH" +fi + +echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)" + +if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then + "$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true + "$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true +fi + +"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet +"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@" diff --git a/build/_build/Build.cs b/build/_build/Build.cs new file mode 100644 index 0000000..38e8acd --- /dev/null +++ b/build/_build/Build.cs @@ -0,0 +1,233 @@ +using System; +using System.IO; +using System.Linq; +using System.Threading.Tasks; + +using NuGet.Configuration; +using NuGet.Versioning; + +using Nuke.Common; +using Nuke.Common.CI; +using Nuke.Common.CI.GitHubActions; +using Nuke.Common.Execution; +using Nuke.Common.Git; +using Nuke.Common.IO; +using Nuke.Common.ProjectModel; +using Nuke.Common.Tooling; +using Nuke.Common.Tools.DotNet; +using Nuke.Common.Tools.NuGet; +using Nuke.Common.Utilities.Collections; +using static Nuke.Common.EnvironmentInfo; +using static Nuke.Common.IO.FileSystemTasks; +using static Nuke.Common.IO.PathConstruction; + +using Octokit; + +class Build : NukeBuild +{ + /// Support plugins are available for: + /// - JetBrains ReSharper https://nuke.build/resharper + /// - JetBrains Rider https://nuke.build/rider + /// - Microsoft VisualStudio https://nuke.build/visualstudio + /// - Microsoft VSCode https://nuke.build/vscode + + private const string MyGetFeedUrl = + "https://www.myget.org/F/jp2masa/api/v2/package"; + + public static int Main() => + Execute(x => x.Pack); + + [Parameter, Secret] + private readonly string? MyGetApiKey; + + [Parameter, Secret] + private readonly string? NuGetApiKey; + + [Parameter, Secret] + private readonly string? GitHubToken; + + [Parameter( + "Configuration to build - Default is 'Debug' (local) or 'Release'" + + " (server)" + )] + private readonly Configuration Configuration = IsLocalBuild + ? Configuration.Debug + : Configuration.Release; + + [Parameter] + private readonly long BuildNumberOffset; + + [GitRepository] + private readonly GitRepository Repository; + + private GitHubActions GitHubActions => + GitHubActions.Instance; + + private AbsolutePath MovereSlnPath => + RootDirectory / "Movere.sln"; + + private AbsolutePath ArtifactsPath => + RootDirectory / "artifacts" / Configuration; + + private AbsolutePath NupkgArtifactsPath => + ArtifactsPath / "nupkg"; + + private string? BranchName => + StringEqualsOrdinalIgnoreCase(GitHubActions.RefType, "branch") + ? GitHubActions.RefName + : null; + + private string? TagName => + StringEqualsOrdinalIgnoreCase(GitHubActions.RefType, "tag") + ? GitHubActions.RefName + : null; + + private SemanticVersion? TagVersion => + TagName is not null + && SemanticVersion.TryParse(TagName, out var version) + ? version + : null; + + private long BuildNumber => + BuildNumberOffset + GitHubActions.RunNumber; + + private string PackageVersionSuffix => + IsLocalBuild + ? "-local" + : ( + TagName is not null + ? "" + : $"-build2.{BuildNumber}+{GitHubActions.Sha[0..7]}" + ); + + + private Target Restore => _ => _ + .Executes( + () => DotNetTasks.DotNetRestore( + x => x + .SetProjectFile(MovereSlnPath) + .AddProperty("PackageVersionSuffix", PackageVersionSuffix) + ) + ); + + private Target Compile => _ => _ + .DependsOn(Restore) + .Executes( + () => DotNetTasks.DotNetBuild( + x => x + .SetProjectFile(MovereSlnPath) + .AddProperty("PackageVersionSuffix", PackageVersionSuffix) + ) + ); + + private Target Pack => _ => _ + .DependsOn(Compile) + .Executes( + () => DotNetTasks.DotNetPack( + x => x + .SetProject(MovereSlnPath) + .SetConfiguration(Configuration) + .AddProperty("PackageVersionSuffix", PackageVersionSuffix) + ) + ); + + private Target PushMyGet => _ => _ + .TriggeredBy(Pack) + .OnlyWhenStatic( + () => + !GitHubActions.IsPullRequest + && Configuration == Configuration.Debug + ) + .Requires(() => MyGetApiKey) + .Executes( + () => + NupkgArtifactsPath + .GetFiles() + .ForEach( + nupkg => DotNetTasks.DotNetNuGetPush( + x => x + .SetSource(MyGetFeedUrl) + .SetApiKey(MyGetApiKey) + .SetTargetPath(nupkg) + ) + ) + ); + + private Target PushNuGet => _ => _ + .TriggeredBy(Pack) + .OnlyWhenStatic( + () => + TagVersion is not null + && Configuration == Configuration.Release + ) + .Requires(() => NuGetApiKey) + .Executes( + () => + NupkgArtifactsPath + .GetFiles() + .ForEach( + nupkg => DotNetTasks.DotNetNuGetPush( + x => x + .SetSource(NuGetConstants.V3FeedUrl) + .SetApiKey(NuGetApiKey) + .SetTargetPath(nupkg) + ) + ) + ); + + private Target ReleaseGitHub => _ => _ + .TriggeredBy(Pack, PushNuGet) + .OnlyWhenStatic( + () => + TagVersion is not null + && Configuration == Configuration.Release + ) + .Requires(() => GitHubToken) + .Executes( + new Func( + async () => + { + var client = new GitHubClient( + new ProductHeaderValue("jp2masa"), + new Octokit.Internal.InMemoryCredentialStore( + new Credentials(GitHubToken) + ) + ); + + var release = await client + .Repository + .Release + .Create( + GetVariable("GITHUB_REPOSITORY_ID"), + new NewRelease(TagName!) + { + Name = TagName!, + Prerelease = TagVersion!.IsPrerelease + } + ); + + // preserve order + foreach (var nupkg in NupkgArtifactsPath.GetFiles()) + { + using var ms = new MemoryStream(nupkg.ReadAllBytes()); + + await client + .Repository + .Release + .UploadAsset( + release, + new ReleaseAssetUpload( + nupkg.Name, + "application/octet-stream", + ms, + null + ) + ); + } + } + ) + ); + + private static bool StringEqualsOrdinalIgnoreCase(string? x, string? y) => + String.Equals(x, y, StringComparison.OrdinalIgnoreCase); +} diff --git a/build/_build/Configuration.cs b/build/_build/Configuration.cs new file mode 100644 index 0000000..adda937 --- /dev/null +++ b/build/_build/Configuration.cs @@ -0,0 +1,16 @@ +using System; +using System.ComponentModel; +using System.Linq; +using Nuke.Common.Tooling; + +[TypeConverter(typeof(TypeConverter))] +public class Configuration : Enumeration +{ + public static Configuration Debug = new Configuration { Value = nameof(Debug) }; + public static Configuration Release = new Configuration { Value = nameof(Release) }; + + public static implicit operator string(Configuration configuration) + { + return configuration.Value; + } +} diff --git a/build/_build/Directory.Build.props b/build/_build/Directory.Build.props new file mode 100644 index 0000000..7c44fc9 --- /dev/null +++ b/build/_build/Directory.Build.props @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/build/_build/Directory.Build.targets b/build/_build/Directory.Build.targets new file mode 100644 index 0000000..105339c --- /dev/null +++ b/build/_build/Directory.Build.targets @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/build/_build/_build.csproj b/build/_build/_build.csproj new file mode 100644 index 0000000..77426c8 --- /dev/null +++ b/build/_build/_build.csproj @@ -0,0 +1,18 @@ + + + + net8.0 + Exe + + CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006 + ..\.. + ..\.. + 1 + false + + + + + + +