diff options
author | Viktor Hofer <viktor.hofer@microsoft.com> | 2020-04-06 12:54:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 12:54:10 +0300 |
commit | 42183b1b86656a348e0b6af7fa7c75072865f759 (patch) | |
tree | f178d9b245efa810cbd23597c92429d873c46032 /eng/build.sh | |
parent | 59ca590949ade88c712e4ca8c6835acd0e9cbf46 (diff) |
Enable restore for ref and src projects in libs (#33553)
- Use RestoreUseStaticGraphEvaluation which improves no-op restore by 10-15x down to 10-20 seconds.
- .builds msbuild files renamed to .proj as RestoreUseStaticGraphEvaluation throws for non .proj files without an env var set.
- Introducing subsets for libraries and mono and replacing -buildtests switch which was only working for libraries in favor of the subset switch -subset tests which works consistently.
- Fixing the Microsoft.DotNet.CodeAnalysis analyzer which wasn't running and adding missing exclusions.
- Separating restore and build phases in different parts in the repo (ie for installer.tasks) as generated props and targets need to be imported which requires a reevaluation in the build phase.
- Fix eng/docker/build-docker-sdk.ps1 by using the official build entrypoints (cc @alnikola)
- Remove a few depprojs in favor of project restore (faster restore :))
- Fix root code coverage measurement not working correctly
- Traversal support instead of dir.traversal.targets or manual build target defines.
- Introduce a root Build.proj entrypoint which is responsible for building and restoring the repository. This is necessary to enable the new NuGet fast restore which works best and fastest with a single entrypoint.
- Avoid binclashes in libraries and between libraries and installer (netstandard.depproj vs netstandard.csproj)
- Upgrading the SDK to 5.0 latest
- Code cleanup
Diffstat (limited to 'eng/build.sh')
-rwxr-xr-x | eng/build.sh | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/eng/build.sh b/eng/build.sh index 812b820a17b..36970ae5e45 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -33,7 +33,6 @@ usage() echo "Actions (defaults to --restore --build):" echo " --restore Restore dependencies (short: -r)" echo " --build Build all source projects (short: -b)" - echo " --buildtests Build all test projects" echo " --rebuild Rebuild all source projects" echo " --test Build and run tests (short: -t)" echo " --pack Package build outputs into NuGet packages" @@ -46,6 +45,7 @@ usage() echo " --framework Build framework: netcoreapp5.0 or net472 (short: -f)" echo " --coverage Collect code coverage when testing" echo " --testscope Test scope, allowed values: innerloop, outerloop, all" + echo " --testnobuild Skip building tests when invoking -test" echo " --allconfigurations Build packages for all build configurations" echo "" @@ -83,15 +83,14 @@ arguments='' cmakeargs='' extraargs='' build=false -buildtests=false subsetCategory='' -checkedPossibleDirectoryToBuild=false +checkedSolutionBuild=false crossBuild=0 source $scriptroot/native/init-os-and-arch.sh # Check if an action is passed in -declare -a actions=("r" "restore" "b" "build" "buildtests" "rebuild" "t" "test" "pack" "sign" "publish" "clean") +declare -a actions=("b" "build" "r" "restore" "rebuild" "testnobuild" "sign" "publish" "clean") actInt=($(comm -12 <(printf '%s\n' "${actions[@]/#/-}" | sort) <(printf '%s\n' "${@/#--/-}" | sort))) while [[ $# > 0 ]]; do @@ -138,14 +137,14 @@ while [[ $# > 0 ]]; do arguments="$arguments -build" shift 1 ;; - -buildtests) - buildtests=true - shift 1 - ;; -testscope) arguments="$arguments /p:TestScope=$2" shift 2 ;; + -testnobuild) + arguments="$arguments /p:TestNoBuild=$2" + shift 2 + ;; -coverage) arguments="$arguments /p:Coverage=true" shift 1 @@ -179,13 +178,13 @@ while [[ $# > 0 ]]; do *) ea=$1 - if [[ $checkedPossibleDirectoryToBuild == false ]] && [[ $subsetCategory == "libraries" ]]; then - checkedPossibleDirectoryToBuild=true + if [[ $checkedSolutionBuild == false ]]; then + checkedSolutionBuild=true if [[ -d "$1" ]]; then - ea="/p:DirectoryToBuild=$1" - elif [[ -d "$scriptroot/../src/libraries/$1" ]]; then - ea="/p:DirectoryToBuild=$scriptroot/../src/libraries/$1" + ea="-projects $1" + elif [[ -d "$scriptroot/../src/libraries/$1/$1.sln" ]]; then + ea="-projects $scriptroot/../src/libraries/$1/$1.sln" fi fi @@ -195,14 +194,6 @@ while [[ $# > 0 ]]; do esac done -if [[ "$buildtests" == true ]]; then - if [[ "$build" == true ]]; then - arguments="$arguments /p:BuildTests=true" - else - arguments="$arguments -build /p:BuildTests=only" - fi -fi - if [ ${#actInt[@]} -eq 0 ]; then arguments="-restore -build $arguments" fi |