diff --git a/build.ps1 b/build.ps1 index 584e2260..0337c22b 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,13 +1,8 @@ [CmdletBinding()] Param( [switch]$NoInit, - [string]$Target, - [ValidateSet("Release", "Debug")] - [string]$Configuration, - [ValidateSet("Quiet", "Minimal", "Normal", "Verbose")] - [string]$Verbosity, [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)] - [string[]]$ScriptArgs + [string[]]$BuildArguments ) Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { $host.SetShouldExit(1) } @@ -51,4 +46,4 @@ ExecSafe { & $MSBuildFile $BuildProjectFile } # EXECUTE BUILD ########################################################################### -ExecSafe { & $BuildExeFile "-Target=$Target" "-Configuration=$Configuration" "-Verbosity=$Verbosity" $ScriptArgs } +ExecSafe { & $BuildExeFile $BuildArguments } diff --git a/build.sh b/build.sh index 8c220d75..37a07e63 100644 --- a/build.sh +++ b/build.sh @@ -1,14 +1,10 @@ #!/usr/bin/env bash -SCRIPT_ARGUMENTS=() +BUILD_ARGUMENTS=() for i in "$@"; do case $1 in -n|--noinit) NOINIT=1; shift;; - -t|--target) TARGET="$2"; shift ;; - -c|--configuration) CONFIGURATION="$2"; shift ;; - -v|--verbosity) VERBOSITY="$2"; shift ;; - --) shift; SCRIPT_ARGUMENTS+=("$@"); break ;; - *) SCRIPT_ARGUMENTS+=("$1") ;; + *) BUILD_ARGUMENTS+=("$1") ;; esac shift done @@ -46,5 +42,4 @@ msbuild $BUILD_PROJECT_FILE # EXECUTE BUILD ########################################################################### -mono $BUILD_EXE_FILE --verbosity=$VERBOSITY --configuration=$CONFIGURATION --target=$TARGET $DRYRUN "${SCRIPT_ARGUMENTS[@]}" - +mono $BUILD_EXE_FILE ${BUILD_ARGUMENTS[@]} diff --git a/build/Build.cs b/build/Build.cs index c7819b56..7c0a6da3 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -11,8 +11,6 @@ class Build : NukeBuild { [GitVersion] readonly GitVersion GitVersion; - public override string Configuration => IsServerBuild ? "Release" : Argument("configuration"); - public string PackageVersionSuffix => GitVersion.BranchName.Replace("/", "-") + "-" + DateTime.UtcNow.ToString("yyyyMMddhhmm"); public static int Main() => Execute(x => x.Pack); @@ -20,7 +18,7 @@ class Build : NukeBuild Target Initialize => _ => _ .Executes(() => { - Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1"); + SetVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "1"); }); Target Clean => _ => _ @@ -54,7 +52,7 @@ class Build : NukeBuild Target Pack => _ => _ .DependsOn(Test) - .Requires(() => GitVersion != null) + .Requires(() => GitVersion) .Executes(() => { EnsureExistingDirectory(ArtifactsDirectory);