From 1262ac03755aa73fb038fa6778042878fb85b508 Mon Sep 17 00:00:00 2001 From: Georg Dangl Date: Mon, 1 Apr 2024 23:04:36 +0200 Subject: [PATCH] Add NUKE and configure GitHub Actions and DanglDocu +semver: major --- .github/workflows/continuous.yml | 24 +++++ .gitignore | 2 + .nuke/build.schema.json | 129 ++++++++++++++++++++++++++ .nuke/parameters.json | 4 + CHANGELOG.md | 24 +---- GitVersion.yml | 11 +++ IPA.BCFier.sln | 51 +++++++++- README.md | 1 + build.cmd | 7 ++ build.ps1 | 74 +++++++++++++++ build.sh | 67 +++++++++++++ docfx.json | 61 ++++++++++++ docs/template/styles/main.css | 59 ++++++++++++ src/IPA.Bcfier/FileVersionProvider.cs | 14 +++ 14 files changed, 503 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/continuous.yml create mode 100644 .nuke/build.schema.json create mode 100644 .nuke/parameters.json create mode 100644 GitVersion.yml create mode 100755 build.cmd create mode 100644 build.ps1 create mode 100755 build.sh create mode 100644 docfx.json create mode 100644 docs/template/styles/main.css create mode 100644 src/IPA.Bcfier/FileVersionProvider.cs diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml new file mode 100644 index 00000000..b51852b4 --- /dev/null +++ b/.github/workflows/continuous.yml @@ -0,0 +1,24 @@ +name: continuous + +on: [push] + +jobs: + windows-latest: + name: windows-latest + runs-on: windows-latest + env: + GitHubAuthenticationToken: ${{ secrets.GITHUB_TOKEN }} + DocuApiKey: ${{ secrets.DOCUAPIKEY }} + steps: + - name: Checkout repository + uses: actions/checkout@v1 + - name: Tests + run: ./build.ps1 Tests -Configuration Debug + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results (${{ runner.os }}) + path: output/**/*_testresults.xml + - name: UploadDocumentation+PublishGitHubRelease + run: ./build.ps1 UploadDocumentation+PublishGitHubRelease diff --git a/.gitignore b/.gitignore index 57a1574c..ad240e5f 100644 --- a/.gitignore +++ b/.gitignore @@ -194,3 +194,5 @@ FakesAssemblies/ # Visual Studio 6 workspace options file *.opt + +output/ diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json new file mode 100644 index 00000000..e5780716 --- /dev/null +++ b/.nuke/build.schema.json @@ -0,0 +1,129 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$ref": "#/definitions/build", + "title": "Build Schema", + "definitions": { + "build": { + "type": "object", + "properties": { + "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" + }, + "DocuApiKey": { + "type": "string" + }, + "DocuBaseUrl": { + "type": "string" + }, + "GitHubAuthenticationToken": { + "type": "string" + }, + "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" + ] + }, + "NoLogo": { + "type": "boolean", + "description": "Disables displaying the NUKE logo" + }, + "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": [ + "BuildDocFxMetadata", + "BuildDocumentation", + "Clean", + "Compile", + "PublishGitHubRelease", + "Restore", + "Tests", + "UploadDocumentation" + ] + } + }, + "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": [ + "BuildDocFxMetadata", + "BuildDocumentation", + "Clean", + "Compile", + "PublishGitHubRelease", + "Restore", + "Tests", + "UploadDocumentation" + ] + } + }, + "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 00000000..fdd4aaca --- /dev/null +++ b/.nuke/parameters.json @@ -0,0 +1,4 @@ +{ + "$schema": "./build.schema.json", + "Solution": "IPA.BCFier.sln" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index dd0aa846..85832472 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,23 +1,7 @@ -#Changelog -### BCFier 2.2.0 - 07/08/2017 +# Changelog -#### New Features +All notable changes to **IPA.BCFier** are documented here. -- implemented BCF 2.1 schema [#29](https://github.com/teocomi/BCFier/issues/29) -- added *topic status* and *topic type* to UI and settings -- removed *comment status* and *verbal status* -- issues can be rearranged via [drag&drop interface](https://github.com/punker76/gong-wpf-dragdrop) -- added support for *topic* *index* and *viewpoint* *index*: this value is set on save [#14](https://github.com/teocomi/BCFier/issues/14) -- upgraded solution to Visual Studio 2017 -- merged and linkedAssemblyInfo files +## v3.0.0 -#### Bug Fixes - -- exception raised when view is captured from schedule (Revit): now a friendly warning message will show, no workaround has been implemented to grab a snapshot of the schedule [#12](https://github.com/teocomi/BCFier/issues/12) - - -#### To Do - -- support of extension.xsd -- support of ReferenceLink -- support of BimSnippet \ No newline at end of file +- Initial release of the **IPA.BCFier** fork diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 00000000..5476c0ac --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,11 @@ +assembly-versioning-scheme: MajorMinorPatch +assembly-file-versioning-scheme: MajorMinorPatch +mode: Mainline + +branches: + main: + regex: (origin/)?master + develop: + increment: Patch + tag: beta + regex: (origin/)?dev(elop)?(ment)?$ diff --git a/IPA.BCFier.sln b/IPA.BCFier.sln index f30d3538..1e37338b 100644 --- a/IPA.BCFier.sln +++ b/IPA.BCFier.sln @@ -19,7 +19,18 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPA.Bcfier", "src\IPA.Bcfie EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{97D50745-F340-4DC1-86A8-58C2D7B7D8E3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IPA.Bcfier.Tests", "tests\IPA.Bcfier.Tests\IPA.Bcfier.Tests.csproj", "{7A585522-0DDE-4F44-8D77-8D84BAA3AAC0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IPA.Bcfier.Tests", "tests\IPA.Bcfier.Tests\IPA.Bcfier.Tests.csproj", "{7A585522-0DDE-4F44-8D77-8D84BAA3AAC0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6C316DD6-5BCA-4CBC-A36A-182FC7D8B1B6}" + ProjectSection(SolutionItems) = preProject + CHANGELOG.md = CHANGELOG.md + docfx.json = docfx.json + GitVersion.yml = GitVersion.yml + LICENSE = LICENSE + README.md = README.md + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -44,7 +55,6 @@ Global EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {503CE2C1-09D7-4F15-BB42-86196EE01ED4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {503CE2C1-09D7-4F15-BB42-86196EE01ED4}.Debug|Any CPU.Build.0 = Debug|Any CPU {503CE2C1-09D7-4F15-BB42-86196EE01ED4}.Debug-2015|Any CPU.ActiveCfg = Debug|Any CPU {503CE2C1-09D7-4F15-BB42-86196EE01ED4}.Debug-2015|Any CPU.Build.0 = Debug|Any CPU {503CE2C1-09D7-4F15-BB42-86196EE01ED4}.Debug-2016|Any CPU.ActiveCfg = Debug|Any CPU @@ -115,7 +125,6 @@ Global {2D132990-5674-42DF-93BF-55BA8FDC6A23}.Release-2022|Any CPU.ActiveCfg = Release-2022|Any CPU {2D132990-5674-42DF-93BF-55BA8FDC6A23}.Release-2022|Any CPU.Build.0 = Release-2022|Any CPU {3C03085B-63AD-4890-AC2C-A4DE31AF1A6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C03085B-63AD-4890-AC2C-A4DE31AF1A6B}.Debug|Any CPU.Build.0 = Debug|Any CPU {3C03085B-63AD-4890-AC2C-A4DE31AF1A6B}.Debug-2015|Any CPU.ActiveCfg = Debug|Any CPU {3C03085B-63AD-4890-AC2C-A4DE31AF1A6B}.Debug-2015|Any CPU.Build.0 = Debug|Any CPU {3C03085B-63AD-4890-AC2C-A4DE31AF1A6B}.Debug-2016|Any CPU.ActiveCfg = Debug|Any CPU @@ -145,7 +154,6 @@ Global {3C03085B-63AD-4890-AC2C-A4DE31AF1A6B}.Release-2021|Any CPU.ActiveCfg = Release-2021|Any CPU {3C03085B-63AD-4890-AC2C-A4DE31AF1A6B}.Release-2022|Any CPU.ActiveCfg = Release-2021|Any CPU {CAF05B60-6A81-489D-B966-7B94F0D69AC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CAF05B60-6A81-489D-B966-7B94F0D69AC7}.Debug|Any CPU.Build.0 = Debug|Any CPU {CAF05B60-6A81-489D-B966-7B94F0D69AC7}.Debug-2015|Any CPU.ActiveCfg = Debug-2015|Any CPU {CAF05B60-6A81-489D-B966-7B94F0D69AC7}.Debug-2015|Any CPU.Build.0 = Debug-2015|Any CPU {CAF05B60-6A81-489D-B966-7B94F0D69AC7}.Debug-2016|Any CPU.ActiveCfg = Debug-2016|Any CPU @@ -171,7 +179,6 @@ Global {CAF05B60-6A81-489D-B966-7B94F0D69AC7}.Release-2021|Any CPU.ActiveCfg = Release-2021|Any CPU {CAF05B60-6A81-489D-B966-7B94F0D69AC7}.Release-2022|Any CPU.ActiveCfg = Release-2021|Any CPU {4CD7CA76-A40E-4DF4-831D-36B64818CC69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4CD7CA76-A40E-4DF4-831D-36B64818CC69}.Debug|Any CPU.Build.0 = Debug|Any CPU {4CD7CA76-A40E-4DF4-831D-36B64818CC69}.Debug-2015|Any CPU.ActiveCfg = Debug|Any CPU {4CD7CA76-A40E-4DF4-831D-36B64818CC69}.Debug-2015|Any CPU.Build.0 = Debug|Any CPU {4CD7CA76-A40E-4DF4-831D-36B64818CC69}.Debug-2016|Any CPU.ActiveCfg = Debug|Any CPU @@ -272,6 +279,40 @@ Global {7A585522-0DDE-4F44-8D77-8D84BAA3AAC0}.Release-2021|Any CPU.Build.0 = Release|Any CPU {7A585522-0DDE-4F44-8D77-8D84BAA3AAC0}.Release-2022|Any CPU.ActiveCfg = Release|Any CPU {7A585522-0DDE-4F44-8D77-8D84BAA3AAC0}.Release-2022|Any CPU.Build.0 = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2015|Any CPU.ActiveCfg = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2015|Any CPU.Build.0 = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2016|Any CPU.ActiveCfg = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2016|Any CPU.Build.0 = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2017|Any CPU.ActiveCfg = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2017|Any CPU.Build.0 = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2018|Any CPU.ActiveCfg = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2018|Any CPU.Build.0 = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2019|Any CPU.ActiveCfg = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2019|Any CPU.Build.0 = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2020|Any CPU.ActiveCfg = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2020|Any CPU.Build.0 = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2021|Any CPU.ActiveCfg = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2021|Any CPU.Build.0 = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2022|Any CPU.ActiveCfg = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Debug-2022|Any CPU.Build.0 = Debug|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2015|Any CPU.ActiveCfg = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2015|Any CPU.Build.0 = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2016|Any CPU.ActiveCfg = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2016|Any CPU.Build.0 = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2017|Any CPU.ActiveCfg = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2017|Any CPU.Build.0 = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2018|Any CPU.ActiveCfg = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2018|Any CPU.Build.0 = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2019|Any CPU.ActiveCfg = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2019|Any CPU.Build.0 = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2020|Any CPU.ActiveCfg = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2020|Any CPU.Build.0 = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2021|Any CPU.ActiveCfg = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2021|Any CPU.Build.0 = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2022|Any CPU.ActiveCfg = Release|Any CPU + {F8FB59AA-6AB5-42CB-A3A2-088DFBCD2490}.Release-2022|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/README.md b/README.md index 1e0eeff5..28d0fa13 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ ![](/Assets/bcfier-text.png) +[Documentation](https://docs.dangl-it.com/Projects/IPA.BCFier) ## Intro diff --git a/build.cmd b/build.cmd new file mode 100755 index 00000000..b08cc590 --- /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 00000000..4634dc03 --- /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.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 00000000..fdff0c62 --- /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.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/docfx.json b/docfx.json new file mode 100644 index 00000000..6d1b76c9 --- /dev/null +++ b/docfx.json @@ -0,0 +1,61 @@ +{ + "metadata": [ + { + "src": [ + { + "src": "./src", + "files": [ + "IPA.BCFier/*.csproj" + ], + "exclude": [ + "**/bin/**", + "**/obj/**" + ] + } + ], + "dest": "./api", + "properties": { + "TargetFramework": "netstandard2.0" + } + } + ], + "build": { + "content": [ + { + "files": [ + "**/*.md", + "**/*.yml" + ], + "exclude": [ + "output/**/*", + "docs/**/*", + "GitVersion.yml", + "**/*.nupkg", + "BCFier*/**/*", + "src/ipa-bcfier-ui/**/*" + ] + } + ], + "resource": [ + { + "files": [ + "**.png" + ] + } + ], + "overwrite": "specs/*.md", + "globalMetadata": { + "_appTitle": "IPA.BCFier Documentation", + "_appFooter": "© Dangl IT GmbH", + "_appLogoPath": "app-logo.png", + "_appFaviconPath": "app-logo.png", + "_enableSearch": true, + "_gitUrlPattern": "github" + }, + "dest": "./output/docs", + "template": [ + "default", + "docs/template" + ] + } +} diff --git a/docs/template/styles/main.css b/docs/template/styles/main.css new file mode 100644 index 00000000..4521d58b --- /dev/null +++ b/docs/template/styles/main.css @@ -0,0 +1,59 @@ +.toc-filter, .form-control { + border-radius: 0; + border: none; +} + +.toc .nav > li > a:hover, .toc .nav > li > a:focus, +.toc .nav > li.active > a:hover, .toc .nav > li.active > a:focus, +.toc .nav > li.active > a, .toc .nav > li.active > a { + color: #fff; +} + +button, a, +.affix > ul > li.active > a, .affix > ul > li.active > a:before { + color: #00acc1; +} + +.navbar-inverse { + border: none; + background-color: #00acc1;; + color: #fff; +} + +.navbar-inverse .navbar-nav>.active>a, +.navbar-inverse .navbar-nav>.active>a:focus, +.navbar-inverse .navbar-nav>.active>a:hover { + background-color: #3b4c55; + color: #00acc1; +} + +.sidefilter, .sidetoc, .toc, body .toc { + background-color: #3b4c55; + color: #bdbdbd; +} + +.sidefilter a, .sidetoc a, .toc a, .toc .nav > li > a { + color: #00acc1; +} + +.navbar-inverse .navbar-nav>li>a { + color: #fff; +} + +.navbar-default { + background-color: #3b4c55; + color: #bdbdbd; +} + +.navbar-default a { + color: #00acc1; +} + +.footer { + background-color: #3b4c55; + color: #bdbdbd +} + +.footer a { + color: #00acc1; +} diff --git a/src/IPA.Bcfier/FileVersionProvider.cs b/src/IPA.Bcfier/FileVersionProvider.cs new file mode 100644 index 00000000..008a3687 --- /dev/null +++ b/src/IPA.Bcfier/FileVersionProvider.cs @@ -0,0 +1,14 @@ +using System; +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +namespace IPA.BCFier +{ + // This file is automatically generated from the build script + [System.CodeDom.Compiler.GeneratedCode("GitVersionBuild", "")] + public static class FileVersionProvider + { + public static string AssemblyVersion => "2.2.6.0"; + public static string FileVersion => "2.2.6"; + public static string NuGetVersion => "2.2.6-initial-frontend0003"; + public static DateTime BuildDateUtc => new DateTime(2024, 4, 1, 20, 45, 36, DateTimeKind.Utc); + } +}