Allow single hyphen arguments in bash build (dotnet/corefx#35628)
authorViktor Hofer <viktor.hofer@microsoft.com>
Thu, 28 Feb 2019 17:55:25 +0000 (18:55 +0100)
committerGitHub <noreply@github.com>
Thu, 28 Feb 2019 17:55:25 +0000 (18:55 +0100)
* Allow single hyphen arguments in bash build

* Add clean switch

* Darc update from build '20190228.2'

Commit migrated from https://github.com/dotnet/corefx/commit/76e08b605f237bffb74283d83241eaadc4e7ce93

eng/pipelines/libraries/corefx-base.yml
src/libraries/clean.cmd [deleted file]
src/libraries/clean.sh [deleted file]

index 520e4f6..5d9433e 100644 (file)
@@ -23,7 +23,6 @@ parameters:
   #     _helixQueues: Windows.Amd64 (Only needed if submitToHelix -> true.) -- Queues should be separated by + if multiple.
 
   # Required: as part of the variables object, the following values need to be passed:
-  #     _skipTests: true | false
   #     _outerloop: true | false
 
   # Optional: _publishTests -> Boolean -> Publish test assets to blob storage if true.
@@ -76,6 +75,7 @@ jobs:
               - name: ${{ pair.key }}
                 value: ${{ pair.value }}
 
+        - _msbuildCommonParameters: ''
         - _archiveTestsParameter: ''
 
         - ${{ if eq(parameters.isOfficialBuild, 'true') }}:
@@ -84,36 +84,28 @@ jobs:
           - group: DotNet-Internal-Tools-Feed
           - group: DotNet-Blob-Feed
 
-        - ${{ if eq(parameters.isOfficialBuild, 'false') }}:
-          - _msbuildCommonParameters: ''
-
         - ${{ if eq(job.submitToHelix, 'true') }}:
           - group: DotNet-HelixApi-Access
           - _archiveTestsParameter: /p:ArchiveTests=Tests
 
+        - _args: -restore -build -configuration $(_BuildConfig) -ci -buildtests -arch $(_architecture) -framework $(_framework) $(_archiveTestsParameter)
+        - _commonArguments: $(_args)
+        - _windowsOfficialBuildArguments: ''
+
         # Windows variables
         - ${{ if eq(parameters.targetOS, 'Windows_NT') }}:
           - _buildScript: build.cmd
-          - _commonArguments: -restore -build -configuration $(_BuildConfig) -ci -buildtests -arch $(_architecture)
           - _msbuildCommand: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 -warnaserror:0 -ci
-
           - ${{ if eq(parameters.isOfficialBuild, 'true') }}:
             - _windowsOfficialBuildArguments: -sign
                                               /p:DotNetSignType=$(_SignType)
 
-          - ${{ if eq(parameters.isOfficialBuild, 'false') }}:
-            - _windowsOfficialBuildArguments: ''
-
         # Non-Windows variables
         - ${{ if ne(parameters.targetOS, 'Windows_NT') }}:
           - _buildScript: ${{ job.buildScriptPrefix }}./build.sh
-          - _args: --restore --build --configuration $(_BuildConfig) --ci --buildtests --arch $(_architecture)
-          - _commonArguments: $(_args)
-          - ${{ if eq(parameters.isOfficialBuild, 'true') }}:
-            - _commonArguments: $(_args) --stripSymbols
-
           - _msbuildCommand: ${{ job.buildScriptPrefix }}./eng/common/msbuild.sh --warnaserror false --ci
-          - _windowsOfficialBuildArguments: ''
+          - ${{ if eq(parameters.isOfficialBuild, 'true') }}:
+            - _commonArguments: $(_args) -stripSymbols
 
         - ${{ if and(eq(job.enableMicrobuild, 'true'), eq(parameters.isOfficialBuild, 'true')) }}:
           - _TeamName: DotNetCore
@@ -165,9 +157,7 @@ jobs:
           - ${{ if eq(job.customBuildSteps[0], '') }}:
             - script: $(_buildScript)
                     $(_commonArguments)
-                    -f $(_framework)
                     /p:OuterLoop=$(_outerloop)
-                    $(_archiveTestsParameter)
                     ${{ job.buildExtraArguments }}
                     $(_msbuildCommonParameters)
                     $(_windowsOfficialBuildArguments)
diff --git a/src/libraries/clean.cmd b/src/libraries/clean.cmd
deleted file mode 100644 (file)
index c7b9c8d..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-@if not defined _echo @echo off
-setlocal EnableDelayedExpansion
-
-set NO_DASHES_ARG=%1
-if not defined NO_DASHES_ARG goto no_help
-if /I [%NO_DASHES_ARG:-=%] == [?] goto Usage
-if /I [%NO_DASHES_ARG:-=%] == [h] goto Usage
-
-:no_help
-:: Check if VBCSCompiler.exe is running
-tasklist /fi "imagename eq VBCSCompiler.exe" |find ":" > nul
-:: Compiler is running if errorlevel == 1
-if errorlevel 1 (
-  echo Stop VBCSCompiler.exe execution.
-  for /f "tokens=2 delims=," %%F in ('tasklist /nh /fi "imagename eq VBCSCompiler.exe" /fo csv') do taskkill /f /PID %%~F
-)
-
-:: Strip all dashes off the argument and use invariant
-:: compare to match as many versions of "all" that we can
-:: All other argument validation happens inside Run.exe
-if not defined NO_DASHES_ARG goto no_args
-if /I [%NO_DASHES_ARG:-=%] == [all] (
-  echo Cleaning entire working directory ...
-  call git clean -xdf
-  exit /b !ERRORLEVEL!
-)
-
-:no_args
-powershell -ExecutionPolicy ByPass -NoProfile %~dp0eng\common\msbuild.ps1 %~dp0build.proj /t:Clean %__args% %*
-exit /b %ERRORLEVEL%
-
-:Usage
-echo.
-echo Usage: clean [-all]
-echo  Deletes the binary output directory.
-echo Options:
-echo     -all   - Cleans repository and restores it to pristine state.
-echo.
-exit /b
\ No newline at end of file
diff --git a/src/libraries/clean.sh b/src/libraries/clean.sh
deleted file mode 100755 (executable)
index d756ac5..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env bash
-
-usage()
-{
-    echo
-    echo "Usage: clean [-all]"
-    echo "Deletes the binary output directory."
-    echo "Options:"
-    echo "    -all   - Cleans repository and restores it to pristine state."
-    exit 1
-}
-
-if [ "$1" == "-?" ] || [ "$1" == "-h" ]; then
-    usage
-fi
-
-# Implement VBCSCompiler.exe kill logic once VBCSCompiler.exe is ported to unixes
-
-__working_tree_root="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-
-if [ "$*" == "-all" ]
-then
-   echo "Removing all untracked files in the working tree"
-   git clean -xdf $__working_tree_root
-   exit $?
-fi
-
-$__working_tree_root/eng/common/msbuild.sh $__working_tree_root/build.proj /t:Clean "$@"
-exit $?