diff --git a/build/BuildDefaults.props b/build/BuildDefaults.props index 8561a45b0..fc76770a0 100644 --- a/build/BuildDefaults.props +++ b/build/BuildDefaults.props @@ -4,6 +4,8 @@ Debug true false + true + true true true true @@ -16,5 +18,7 @@ NU1701 true + + $(DefineConstants);SOURCE_BUILD diff --git a/build/BundledRuntimes.props b/build/BundledRuntimes.props index 5828d0c23..8e0b2eca7 100644 --- a/build/BundledRuntimes.props +++ b/build/BundledRuntimes.props @@ -1,7 +1,7 @@ $(HostRid) - $(HostMonikerRid) + $(HostMonikerRid) -internal @@ -80,21 +80,21 @@ <_DownloadAndExtractItem Include="AspNetCoreRuntimeInstallerWixLibFile" - Condition=" '$(AspNetCoreRuntimeInstallerWixLibFile)' != '' And !Exists('$(AspNetCoreRuntimeInstallerWixLibFile)')"> + Condition="'$(IncludeAspNetCoreRuntime)' == 'true' And '$(SkipBuildingInstallers)' != 'true' And '$(AspNetCoreRuntimeInstallerWixLibFile)' != '' And !Exists('$(AspNetCoreRuntimeInstallerWixLibFile)')"> $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreRuntimeInstallerWixLibFileName)$(CoreSetupBlobAccessTokenParam) $(AspNetCoreRuntimeInstallerWixLibFile) <_DownloadAndExtractItem Include="AspNetCoreRuntimeInstallerArchiveFile" - Condition="!Exists('$(AspNetCoreRuntimeInstallerArchiveFile)')"> + Condition="'$(IncludeAspNetCoreRuntime)' == 'true' And !Exists('$(AspNetCoreRuntimeInstallerArchiveFile)')"> $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreRuntimeInstallerArchiveFileName)$(CoreSetupBlobAccessTokenParam) $(AspNetCoreRuntimeInstallerArchiveFile) $(AspNetRuntimePackageStorePublishDirectory) <_DownloadAndExtractItem Include="AspNetCoreSharedRuntimeVersionFile" - Condition="!Exists('$(AspNetCoreSharedRuntimeVersionFile)')"> + Condition="'$(IncludeAspNetCoreRuntime)' == 'true' And !Exists('$(AspNetCoreSharedRuntimeVersionFile)')"> $(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreSharedRuntimeVersionFileName)$(CoreSetupBlobAccessTokenParam) $(AspNetCoreSharedRuntimeVersionFile) diff --git a/build/Compile.targets b/build/Compile.targets index d2a3747aa..1369ad7d5 100644 --- a/build/Compile.targets +++ b/build/Compile.targets @@ -14,11 +14,12 @@ Targets="Publish" /> - + diff --git a/build/GitCommitInfo.targets b/build/GitCommitInfo.targets index 6ac729e50..a81e1a7f3 100644 --- a/build/GitCommitInfo.targets +++ b/build/GitCommitInfo.targets @@ -1,12 +1,14 @@ + ConsoleToMSBuild="true" + Condition="'$(GitInfoCommitCount)' == ''"> + ConsoleToMSBuild="true" + Condition="'$(GitInfoCommitHash)' == ''"> diff --git a/build/Prepare.targets b/build/Prepare.targets index 3b373ecfc..e0cdb1bd2 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -68,7 +68,8 @@ - + + diff --git a/build/package/Nupkg.targets b/build/package/Nupkg.targets index d7287c8b7..07b7524cc 100644 --- a/build/package/Nupkg.targets +++ b/build/package/Nupkg.targets @@ -11,7 +11,7 @@ Microsoft.DotNet.Cli.Utils $(SdkNugetVersion) - + Microsoft.DotNet.MSBuildSdkResolver $(SdkNugetVersion) diff --git a/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj b/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj index fefc8affe..ea3d8e435 100644 --- a/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj +++ b/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj @@ -12,7 +12,7 @@ - + diff --git a/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs b/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs index 1dfb0b3de..090a128be 100644 --- a/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs +++ b/build_projects/dotnet-cli-build/CheckIfAllBuildsHavePublished.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +#if !SOURCE_BUILD + using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System; @@ -84,3 +86,5 @@ namespace Microsoft.DotNet.Cli.Build } } } + +#endif diff --git a/build_projects/dotnet-cli-build/CopyBlobsToLatest.cs b/build_projects/dotnet-cli-build/CopyBlobsToLatest.cs index 3078a2b39..1adab0114 100644 --- a/build_projects/dotnet-cli-build/CopyBlobsToLatest.cs +++ b/build_projects/dotnet-cli-build/CopyBlobsToLatest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +#if !SOURCE_BUILD using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using System.IO; @@ -112,3 +113,4 @@ namespace Microsoft.DotNet.Cli.Build } } } +#endif diff --git a/build_projects/dotnet-cli-build/SetBlobPropertiesBasedOnFileTypeTask.cs b/build_projects/dotnet-cli-build/SetBlobPropertiesBasedOnFileTypeTask.cs index d4caddc04..6a7c8d446 100644 --- a/build_projects/dotnet-cli-build/SetBlobPropertiesBasedOnFileTypeTask.cs +++ b/build_projects/dotnet-cli-build/SetBlobPropertiesBasedOnFileTypeTask.cs @@ -1,6 +1,8 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +#if !SOURCE_BUILD + using System; using System.Collections.Generic; using System.IO; @@ -65,3 +67,5 @@ namespace Microsoft.DotNet.Cli.Build } } } + +#endif \ No newline at end of file diff --git a/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs b/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs index f528e05ad..615a2e5ca 100644 --- a/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs +++ b/build_projects/dotnet-cli-build/UpdateVersionsRepo.cs @@ -1,11 +1,13 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +#if !SOURCE_BUILD using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using Microsoft.DotNet.VersionTools.Automation; using System.IO; + namespace Microsoft.DotNet.Cli.Build { public class UpdateVersionsRepo : Task @@ -33,3 +35,4 @@ namespace Microsoft.DotNet.Cli.Build } } } +#endif diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index 2b6c115d8..f76765aff 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -15,20 +15,12 @@ - - - + - - + - - - - - + diff --git a/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs b/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs index 1f1047644..5d77dfc76 100644 --- a/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs +++ b/build_projects/shared-build-targets-utils/Publishing/AzurePublisher.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. +#if !SOURCE_BUILD using System; using System.Collections.Generic; using System.Diagnostics; @@ -230,3 +231,4 @@ namespace Microsoft.DotNet.Cli.Build } } } +#endif \ No newline at end of file diff --git a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj index ed7002589..252e89bb6 100644 --- a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj +++ b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj @@ -12,15 +12,14 @@ + - - - - + + diff --git a/build_projects/update-dependencies/Directory.Build.props b/build_projects/update-dependencies/Directory.Build.props new file mode 100644 index 000000000..a8d332ca6 --- /dev/null +++ b/build_projects/update-dependencies/Directory.Build.props @@ -0,0 +1,8 @@ + + + + + diff --git a/build_projects/update-dependencies/update-dependencies.ps1 b/build_projects/update-dependencies/update-dependencies.ps1 index b76d10bc1..ed5411110 100644 --- a/build_projects/update-dependencies/update-dependencies.ps1 +++ b/build_projects/update-dependencies/update-dependencies.ps1 @@ -34,19 +34,24 @@ if (!$env:DOTNET_INSTALL_DIR) $env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\$Architecture" } +$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + # Install a stage 0 -Write-Output "Installing .NET Core CLI Stage 0" -& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel "master" -Architecture $Architecture -if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" } + Write-Output "Installing .NET Core CLI Stage 0" + +if (!$env:DOTNET_TOOL_DIR) +{ + & "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel "master" -Architecture $Architecture + if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" } +} +else +{ + Copy-Item -Force -Recurse $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR +} # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" -# Restore the app -Write-Output "Restoring $ProjectPath..." -dotnet restore "$ProjectPath" -if($LASTEXITCODE -ne 0) { throw "Failed to restore" } - # Run the app Write-Output "Invoking App $ProjectPath..." dotnet run -p "$ProjectPath" "$ProjectArgs" diff --git a/build_projects/update-dependencies/update-dependencies.sh b/build_projects/update-dependencies/update-dependencies.sh index 4781c8453..ff95d79a6 100755 --- a/build_projects/update-dependencies/update-dependencies.sh +++ b/build_projects/update-dependencies/update-dependencies.sh @@ -30,26 +30,28 @@ if [ -z "${DOTNET_INSTALL_DIR:-}" ]; then export DOTNET_INSTALL_DIR=$REPO_ROOT/.dotnet_stage0/x64 fi +export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + +if [ ! -d "$DOTNET_INSTALL_DIR" ]; then + mkdir -p $DOTNET_INSTALL_DIR +fi # Install a stage 0 echo "Installing .NET Core CLI Stage 0" -$REPO_ROOT/scripts/obtain/dotnet-install.sh -Channel master -Architecture x64 -if [ $? -ne 0 ]; then - echo "Failed to install stage 0" - exit 1 +if [ -z "$DOTNET_TOOL_DIR" ]; then + $REPO_ROOT/scripts/obtain/dotnet-install.sh -Channel master -Architecture x64 + + if [ $? -ne 0 ]; then + echo "Failed to install stage 0" + exit 1 + fi +else + cp -r $DOTNET_TOOL_DIR/* $DOTNET_INSTALL_DIR/ fi # Put the stage 0 on the path export PATH=$DOTNET_INSTALL_DIR:$PATH -echo "Restoring $PROJECT_PATH..." -dotnet restore "$PROJECT_PATH" - -if [ $? -ne 0 ]; then - echo "Failed to restore" - exit 1 -fi - echo "Invoking App $PROJECT_PATH..." dotnet run -p "$PROJECT_PATH" $@ diff --git a/run-build.ps1 b/run-build.ps1 index 6acbb15ce..b3caef1e1 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -66,14 +66,21 @@ $env:VSTEST_BUILD_TRACE=1 $env:VSTEST_TRACE_BUILD=1 # install a stage0 -$dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1" - -Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" -Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" -if ($LastExitCode -ne 0) +if (!$env:DOTNET_TOOL_DIR) { - Write-Output "The .NET CLI installation failed with exit code $LastExitCode" - exit $LastExitCode + $dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1" + + Write-Output "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" + Invoke-Expression "$dotnetInstallPath -Channel ""release/2.0.0"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture""" + if ($LastExitCode -ne 0) + { + Write-Output "The .NET CLI installation failed with exit code $LastExitCode" + exit $LastExitCode + } +} +else +{ + Copy-Item -Recurse -Force $env:DOTNET_TOOL_DIR $env:DOTNET_INSTALL_DIR } # Put the stage0 on the path diff --git a/run-build.sh b/run-build.sh index 0dce787e9..f4e7a90ed 100755 --- a/run-build.sh +++ b/run-build.sh @@ -150,14 +150,19 @@ export VSTEST_TRACE_BUILD=1 export DOTNET_MULTILEVEL_LOOKUP=0 # Install a stage 0 -(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "release/2.0.0" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) +if [ -z "$DOTNET_TOOL_DIR" ]; then + (set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "release/2.0.0" --install-dir "$DOTNET_INSTALL_DIR" --architecture "$ARCHITECTURE" $LINUX_PORTABLE_INSTALL_ARGS) -EXIT_CODE=$? -if [ $EXIT_CODE != 0 ]; then - echo "run-build: Error: installing stage0 with exit code $EXIT_CODE." >&2 - exit $EXIT_CODE + EXIT_CODE=$? + if [ $EXIT_CODE != 0 ]; then + echo "run-build: Error: installing stage0 with exit code $EXIT_CODE." >&2 + exit $EXIT_CODE + fi +else + cp -r $DOTNET_TOOL_DIR/* $DOTNET_INSTALL_DIR/ fi + # Put stage 0 on the PATH (for this shell only) PATH="$DOTNET_INSTALL_DIR:$PATH" diff --git a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj index a1dd1e22f..dc4ff23d6 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj +++ b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj @@ -3,7 +3,7 @@ $(SdkVersion) netstandard1.5;net46 - netstandard1.5 + netstandard1.5 true ../../tools/Key.snk true diff --git a/src/tool_fsharp/tool_fsc.csproj b/src/tool_fsharp/tool_fsc.csproj index 1ec0f52b5..729c2bdb4 100644 --- a/src/tool_fsharp/tool_fsc.csproj +++ b/src/tool_fsharp/tool_fsc.csproj @@ -13,6 +13,8 @@ + +