Skip to content

Commit

Permalink
RMIO-86 Add NUKE build
Browse files Browse the repository at this point in the history
  • Loading branch information
a-ctor committed Jul 11, 2024
1 parent 8219734 commit 84381ad
Show file tree
Hide file tree
Showing 30 changed files with 505 additions and 900 deletions.
202 changes: 202 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": {
"build": {
"type": "object",
"properties": {
"AdditionalBuildMetadata": {
"type": "string",
"description": "Additional build metadata that is attached to the assembly informational version"
},
"AssemblySigningKeyFile": {
"type": "string",
"description": "Path to the key file containing the signing key"
},
"Configurations": {
"type": "array",
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
"items": {
"type": "string"
}
},
"Continue": {
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
},
"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",
"TestHost",
"TravisCI",
"VisualStudio",
"VSCode"
]
},
"LogFolder": {
"type": "string",
"description": "Path to the log folder where log files are put"
},
"NoLogo": {
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"OutputFolder": {
"type": "string",
"description": "Path to the output folder where build artifacts are put"
},
"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": [
"Build",
"CIBuild",
"Clean",
"CreateTestMatrix",
"DetermineBuildMetadata",
"DetermineProjectMetadata",
"FullBuild",
"NightlyBuild",
"Pack",
"Restore",
"Test",
"VerifyTestParameters"
]
}
},
"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": [
"Build",
"CIBuild",
"Clean",
"CreateTestMatrix",
"DetermineBuildMetadata",
"DetermineProjectMetadata",
"FullBuild",
"NightlyBuild",
"Pack",
"Restore",
"Test",
"VerifyTestParameters"
]
}
},
"TempFolder": {
"type": "string",
"description": "Path to the temp folder where temporary build files are put"
},
"TestConfigurations": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Debug",
"Release"
]
}
},
"TestExecutionRuntimes": {
"type": "array",
"items": {
"type": "string",
"enum": [
"Docker_Win_NET462",
"Docker_Win_NET472",
"Docker_Win_NET48",
"Docker_Win_NET8_0",
"EnforcedLocalMachine",
"LocalMachine"
]
}
},
"TestFilter": {
"type": "string",
"description": "Executes only tests that match the specified test filter"
},
"TestPlatforms": {
"type": "array",
"items": {
"type": "string",
"enum": [
"x64",
"x86"
]
}
},
"TestTargetRuntimes": {
"type": "array",
"items": {
"type": "string",
"enum": [
"NET462",
"NET472",
"NET48",
"NET8_0"
]
}
},
"UseReleaseVersioning": {
"type": "boolean",
"description": "Uses release instead of debug versioning when determining the build versions"
},
"Verbosity": {
"type": "string",
"description": "Logging verbosity during build execution. Default is 'Normal'",
"enum": [
"Minimal",
"Normal",
"Quiet",
"Verbose"
]
}
}
}
}
}
9 changes: 9 additions & 0 deletions .nuke/parameters.ci.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "./build.schema.json",
"Solution": "Remotion-IO.sln",
"Target": [ "CIBuild" ],
"TestConfigurations": [ "Debug" ],
"TestExecutionRuntimes": [ "Docker_Win_NET48", "Docker_Win_NET8_0" ],
"TestPlatforms": [ "x64" ],
"TestTargetRuntimes": [ "NET48", "NET8_0" ]
}
10 changes: 10 additions & 0 deletions .nuke/parameters.full.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "./build.schema.json",
"Solution": "Remotion-IO.sln",
"Target": [ "FullBuild" ],
"UseReleaseVersioning": true,
"TestConfigurations": [ "Debug", "Release" ],
"TestExecutionRuntimes": [ "Docker_Win_NET462", "Docker_Win_NET472", "Docker_Win_NET48", "Docker_Win_NET8_0" ],
"TestPlatforms": [ "x86", "x64" ],
"TestTargetRuntimes": [ "NET462", "NET472", "NET48", "NET8_0" ]
}
4 changes: 4 additions & 0 deletions .nuke/parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "./build.schema.json",
"Solution": "Remotion-IO.sln"
}
9 changes: 9 additions & 0 deletions .nuke/parameters.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "./build.schema.json",
"Solution": "Remotion-IO.sln",
"Target": [ "CIBuild" ],
"TestConfigurations": [ "Debug" ],
"TestExecutionRuntimes": [ "LocalMachine" ],
"TestPlatforms": [ "x64" ],
"TestTargetRuntimes": [ "NET48", "NET8_0" ]
}
9 changes: 9 additions & 0 deletions .nuke/parameters.nightly.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "./build.schema.json",
"Solution": "Remotion-IO.sln",
"Target": [ "NightlyBuild" ],
"TestConfigurations": [ "Debug", "Release" ],
"TestExecutionRuntimes": [ "Docker_Win_NET462", "Docker_Win_NET472", "Docker_Win_NET48", "Docker_Win_NET8_0" ],
"TestPlatforms": [ "x86", "x64" ],
"TestTargetRuntimes": [ "NET462", "NET472", "NET48", "NET8_0" ]
}
129 changes: 6 additions & 123 deletions Build.cmd
Original file line number Diff line number Diff line change
@@ -1,124 +1,7 @@
@echo off
pushd %~dp0
:; set -eo pipefail
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
:; ${SCRIPT_DIR}/build.sh "$@"
:; exit $?

set program-path=%ProgramFiles%
set program-pathX86=%ProgramFiles(x86)%
if not exist "%program-pathX86%" set program-pathX86=%program-path%
set msbuild="%program-pathX86%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe"
if not exist %msbuild% set msbuild="%program-path%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe"
if not exist %msbuild% set msbuild="%program-path%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin\MSBuild.exe"
if not exist %msbuild% set msbuild="%program-path%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"

set log-dir=build\BuildOutput\log
set nuget-bin=build\BuildOutput\temp\nuget-bin
set nuget=%nuget-bin%\nuget.exe
set nuget-download=powershell.exe -NoProfile -Command "& {(New-Object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe','%nuget%')}"
set solutionFile=Remotion-IO.sln

if not exist remotion.snk goto nosnk

if not [%1]==[] goto %1

echo Welcome to the re-motion build tool!
echo.
echo Using %msbuild%
echo.
echo Choose your desired build:
echo [1] ... Test build ^(x86-debug^)
echo [2] ... Full build ^(x86-debug/release, x64-debug/release^)
rem echo [3] ... Quick build ^(x86-debug, no tests are run^)
echo [4] ... Docs build ^(x86-debug if not present, docs^)
echo Requires Sandcastle Help File Builder to be installed!
echo [5] ... Package ^(create zip package from pre-existent build^)
echo [6] ... Run DependDB
echo [7] ... Oops, nothing please - exit.
echo.

choice /c:1234567 /n /m "Your choice: "

if %ERRORLEVEL%==1 goto run_test_build
if %ERRORLEVEL%==2 goto run_full_build
if %ERRORLEVEL%==3 goto run_quick_build
if %ERRORLEVEL%==4 goto run_docs_build
if %ERRORLEVEL%==5 goto run_pkg_build
if %ERRORLEVEL%==6 goto run_dependdb
if %ERRORLEVEL%==7 goto run_exit
goto build_succeeded

:run_test_build
mkdir %log-dir%
mkdir %nuget-bin%
%nuget-download%
%nuget% restore %solutionFile% -NonInteractive
%msbuild% build\Remotion.Local.build /t:TestBuild /maxcpucount /verbosity:normal /flp:verbosity=normal;logfile=build\BuildOutput\log\build.log
if not %ERRORLEVEL%==0 goto build_failed
goto build_succeeded

:run_full_build
mkdir %log-dir%
mkdir %nuget-bin%
%nuget-download%
%nuget% restore %solutionFile% -NonInteractive
%msbuild% build\Remotion.Local.build /t:FullBuildWithoutDocumentation /maxcpucount /verbosity:normal /flp:verbosity=normal;logfile=build\BuildOutput\log\build.log
if not %ERRORLEVEL%==0 goto build_failed
goto build_succeeded

:run_quick_build
mkdir %log-dir%
mkdir %nuget-bin%
%nuget-download%
%nuget% restore %solutionFile% -NonInteractive
%msbuild% build\Remotion.Local.build /t:QuickBuild /maxcpucount /verbosity:normal /flp:verbosity=normal;logfile=build\BuildOutput\log\build.log
if not %ERRORLEVEL%==0 goto build_failed
goto build_succeeded

:run_docs_build
mkdir %log-dir%
mkdir %nuget-bin%
%nuget-download%
%nuget% restore %solutionFile% -NonInteractive
%msbuild% build\Remotion.Local.build /t:DocumentationBuild /maxcpucount /verbosity:minimal /flp:verbosity=normal;logfile=build\BuildOutput\log\build.log
if not %ERRORLEVEL%==0 goto build_failed
goto build_succeeded

:run_pkg_build
mkdir %log-dir%
mkdir %nuget-bin%
%nuget-download%
%nuget% restore %solutionFile% -NonInteractive
%msbuild% build\Remotion.Local.build /t:PackageBuild /maxcpucount /verbosity:minimal /flp:verbosity=normal;logfile=build\BuildOutput\log\build.log
if not %ERRORLEVEL%==0 goto build_failed
goto build_succeeded

:run_dependdb
mkdir %log-dir%
mkdir %nuget-bin%
%nuget-download%
%nuget% restore %solutionFile% -NonInteractive
%msbuild% build\Remotion.Local.build /t:DependDBBuild /maxcpucount /verbosity:normal /flp:verbosity=detailed;logfile=build\BuildOutput\log\build.log
if not %ERRORLEVEL%==0 goto build_failed
goto build_succeeded

:run_exit
exit /b 0


:build_failed
echo.
echo Building re-motion has failed.
start build\BuildOutput\log\build.log
pause
popd
exit /b 1

:build_succeeded
echo.
pause
popd
exit /b 0

:nosnk
echo remotion.snk does not exist. Please run Generate-Snk.cmd from a Visual Studio Command Prompt.
pause
popd
exit /b 2
@ECHO OFF
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*
11 changes: 11 additions & 0 deletions Build/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[*.cs]
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_property = false:warning
dotnet_style_qualification_for_method = false:warning
dotnet_style_qualification_for_event = false:warning
dotnet_style_require_accessibility_modifiers = never:warning

csharp_style_expression_bodied_methods = true:silent
csharp_style_expression_bodied_properties = true:warning
csharp_style_expression_bodied_indexers = true:warning
csharp_style_expression_bodied_accessors = true:warning
Loading

0 comments on commit 84381ad

Please sign in to comment.