Merge remote-tracking branch 'upstream/dev/release/2.0.0'
authorEric Erhardt <eric.erhardt@microsoft.com>
Mon, 9 Oct 2017 19:09:17 +0000 (14:09 -0500)
committerEric Erhardt <eric.erhardt@microsoft.com>
Mon, 9 Oct 2017 19:09:17 +0000 (14:09 -0500)
Commit migrated from https://github.com/dotnet/core-setup/commit/3119d09f2b974336b20185924e1da828adcd30b0

28 files changed:
1  2 
src/installer/RepoDirectories.props
src/installer/build.proj
src/installer/buildpipeline/Core-Setup-Linux-BT.json
src/installer/buildpipeline/Core-Setup-Publish.json
src/installer/buildpipeline/Core-Setup-Windows-Arm-BT.json
src/installer/buildpipeline/Core-Setup-Windows-BT.json
src/installer/buildpipeline/pipeline.json
src/installer/config.json
src/installer/corehost/build.proj
src/installer/dependencies.props
src/installer/init-tools.sh
src/installer/pkg/packaging/deb/dotnet-sharedframework-debian_config.json
src/installer/pkg/packaging/deb/package.targets
src/installer/pkg/packaging/dir.proj
src/installer/pkg/projects/Microsoft.NETCore.App/src/Microsoft.NETCore.App.depproj
src/installer/pkg/projects/Microsoft.NETCore.UniversalWindowsPlatform/src/Microsoft.NETCore.UniversalWindowsPlatform.depproj
src/installer/pkg/projects/dir.targets
src/installer/publish/dir.props
src/installer/publish/dir.targets
src/installer/publish/publish.proj
src/installer/signing/sign.proj
src/installer/test/HostActivationTests/GivenThatICareAboutMultilevelSDKLookup.cs
src/installer/test/dir.proj
tools-local/scripts/arm32_ci_script.sh
tools-local/scripts/dockerbuild.sh
tools-local/scripts/dockerrun.sh
tools-local/tasks/core-setup.tasks.builds
tools-local/tasks/core-setup.tasks.csproj

Simple merge
    <Target Name="BuildTraversalBuildDependencies"
            DependsOnTargets="$(TraversalBuildDependencies)" />
  
 -  <Target Name="BuildCustomTasks">
 -      <MSBuild Projects="tools-local/Microsoft.DotNet.Build.Tasks.Local/Microsoft.DotNet.Build.Tasks.Local.builds" />
 -      <MSBuild Projects="tools-local/tasks/core-setup.tasks.builds" />
 -
 -    <PropertyGroup>
 -      <DependencyModelTFM>netstandard1.3</DependencyModelTFM>
 -      <DependencyModelTFM Condition="'$(MSBuildRuntimeType)' != 'Core'">net451</DependencyModelTFM>
 -    </PropertyGroup>
 -
 -      <ItemGroup>
 -        <CustomTaskDependencies Include="$(BuildToolsTaskDir)Newtonsoft.Json.dll" />
 -        <CustomTaskDependencies Include="$(BuildToolsTaskDir)Microsoft.DotNet.PlatformAbstractions.dll" />
 -        <CustomTaskDependencies Include="$(PackagesDir)microsoft.extensions.dependencymodel\1.1.1\lib\$(DependencyModelTFM)\Microsoft.Extensions.DependencyModel.dll" />
 -      </ItemGroup>
 -      <Copy SourceFiles="@(CustomTaskDependencies)"
 -            DestinationFolder="$(LocalBuildToolsTaskDir)"
 -            OverwriteReadOnlyFiles="true"
 -            SkipUnchangedFiles="true" />
 -  </Target>
 -
+   <Target Name="CreateHostMachineInfoFile">
+     <GetTargetMachineInfo>
+       <Output PropertyName="HostMachineRid" TaskParameter="RuntimeIdentifier" />
+     </GetTargetMachineInfo>
+     <PropertyGroup>
+       <HostMachineInfoPropsContent>
+ &lt;Project&gt;
+   &lt;PropertyGroup&gt;
+     &lt;HostMachineRid&gt;$(HostMachineRid)&lt;/HostMachineRid&gt;
+   &lt;/PropertyGroup&gt;
+ &lt;/Project&gt;
+       </HostMachineInfoPropsContent>
+     </PropertyGroup>
+     <WriteLinesToFile File="$(HostMachineInfoProps)"
+                       Lines="$(HostMachineInfoPropsContent)"
+                       Overwrite="True" />
+   </Target>
    <Target Name="BatchRestorePackages" Condition="'$(RestoreDuringBuild)'=='true'">
      <Message Importance="High" Text="Restoring all packages..." />
      <Exec Condition="'@(SdkRestoreProjects)' != ''" Command="$(DotnetRestoreCommand) &quot;%(SdkRestoreProjects.FullPath)&quot; $(MSBuildPassThroughPropertyList)" StandardOutputImportance="Low" />
          "failOnStandardError": "false"
        }
      },
-         "arguments": "run --rm $(DockerCommonRunArgs_Debian9) $(PB_GitDirectory)/Tools/msbuild.sh $(PB_GitDirectory)/build.proj /t:BuildTraversalBuildDependencies /p:DistroRid=$(DistroRid_Debian9) $(DistroSpecificMSBuildArguments)",
 +      {
 +      "enabled": true,
 +      "continueOnError": false,
 +      "alwaysRun": false,
 +      "displayName": "Initialize docker - Debian 9",
 +      "timeoutInMinutes": 0,
 +      "task": {
 +        "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
 +        "versionSpec": "1.*",
 +        "definitionType": "task"
 +      },
 +      "inputs": {
 +        "filename": "$(PB_DockerHost_ToolsDirectory)/scripts/docker/init-docker.sh",
 +        "arguments": "$(DockerImageName_Debian9)",
 +        "workingFolder": "$(PB_DockerHost_Sandbox)",
 +        "failOnStandardError": "false"
 +      }
 +    },
 +    {
 +      "enabled": true,
 +      "continueOnError": false,
 +      "alwaysRun": false,
 +      "displayName": "Init tools - Debian 9 container",
 +      "timeoutInMinutes": 0,
 +      "task": {
 +        "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
 +        "versionSpec": "1.*",
 +        "definitionType": "task"
 +      },
 +      "inputs": {
 +        "filename": "docker",
 +        "arguments": "run --rm $(DockerCommonRunArgs_Debian9) /bin/bash -c \"HOME=$(PB_GitDirectory); git clean -X -d -f; $(PB_GitDirectory)/init-tools.sh\"",
 +        "workingFolder": "",
 +        "failOnStandardError": "false"
 +      }
 +    },
 +    {
 +      "enabled": true,
 +      "continueOnError": false,
 +      "alwaysRun": false,
 +      "displayName": "Build traversal build dependencies - Debian 9",
 +      "timeoutInMinutes": 0,
 +      "task": {
 +        "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
 +        "versionSpec": "1.*",
 +        "definitionType": "task"
 +      },
 +      "inputs": {
 +        "filename": "docker",
-         "arguments": "run --rm $(DockerCommonRunArgs_Debian9) $(PB_GitDirectory)/Tools/msbuild.sh $(PB_GitDirectory)/src/pkg/packaging/dir.proj $(AdditionalMSBuildProperties) /p:DistroRid=$(DistroRid_Debian9) $(DistroSpecificMSBuildArguments)",
++        "arguments": "run --rm $(DockerCommonRunArgs_Debian9) $(PB_GitDirectory)/Tools/msbuild.sh $(PB_GitDirectory)/build.proj /t:BuildTraversalBuildDependencies $(DistroSpecificMSBuildArguments)",
 +        "workingFolder": "",
 +        "failOnStandardError": "false"
 +      }
 +    },
 +    {
 +      "enabled": true,
 +      "continueOnError": false,
 +      "alwaysRun": false,
 +      "displayName": "Package - Debian 9",
 +      "timeoutInMinutes": 0,
 +      "task": {
 +        "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
 +        "versionSpec": "1.*",
 +        "definitionType": "task"
 +      },
 +      "inputs": {
 +        "filename": "docker",
-         "arguments": "run --rm $(DockerCommonRunArgs_Debian9) $(PB_GitDirectory)/Tools/msbuild.sh $(PB_GitDirectory)/publish/publish.proj /p:DistroRid=$(DistroRid_Debian9) $(DistroSpecificMSBuildArguments) $(DistroSpecificMSBuildPublishArgs)",
++        "arguments": "run --rm $(DockerCommonRunArgs_Debian9) $(PB_GitDirectory)/Tools/msbuild.sh $(PB_GitDirectory)/src/pkg/packaging/dir.proj $(AdditionalMSBuildProperties) $(DistroSpecificMSBuildArguments)",
 +        "workingFolder": "",
 +        "failOnStandardError": "false"
 +      }
 +    },
 +    {
 +      "enabled": true,
 +      "continueOnError": false,
 +      "alwaysRun": false,
 +      "displayName": "Publish - Debian 9",
 +      "timeoutInMinutes": 0,
 +      "task": {
 +        "id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
 +        "versionSpec": "1.*",
 +        "definitionType": "task"
 +      },
 +      "inputs": {
 +        "filename": "docker",
++        "arguments": "run --rm $(DockerCommonRunArgs_Debian9) $(PB_GitDirectory)/Tools/msbuild.sh $(PB_GitDirectory)/publish/publish.proj $(DistroSpecificMSBuildArguments) $(DistroSpecificMSBuildPublishArgs)",
 +        "workingFolder": "",
 +        "failOnStandardError": "false"
 +      }
 +    },
      {
        "enabled": true,
        "continueOnError": false,
        "value": "/flp:v=diag /p:TargetArchitecture=$(PB_TargetArchitecture) /p:PortableBuild=false /p:ConfigurationGroup=$(BuildConfiguration) /p:OSGroup=Linux /p:OfficialBuildId=$(OfficialBuildId)"
      },
      "DistroSpecificMSBuildPublishArgs": {
-       "value": "/p:AzureAccountName=$(PB_AzureAccountName) /p:AzureAccessToken=$(PB_AzureAccessToken) /p:ChecksumAzureAccountName=$(PB_ChecksumAzureAccountName) /p:ChecksumAzureAccessToken=$(PB_ChecksumAzureAccessToken) /p:DebRepoUser=$(PB_DebRepoUser) /p:DebRepoServer=$(PB_DebRepoServer) /p:DebRepoPass=$(DEB_REPO_PASSWORD) $(PB_DebianKeys)"
+       "value": "/p:AzureAccountName=$(PB_AzureAccountName) /p:ContainerName=$(PB_ContainerName) /p:AzureAccessToken=$(PB_AzureAccessToken) /p:ChecksumAzureAccountName=$(PB_ChecksumAzureAccountName) /p:ChecksumContainerName=$(PB_ChecksumContainerName) /p:ChecksumAzureAccessToken=$(PB_ChecksumAzureAccessToken) /p:DebRepoUser=$(PB_DebRepoUser) /p:DebRepoServer=$(PB_DebRepoServer) /p:DebRepoPass=$(DEB_REPO_PASSWORD) $(PB_DebianKeys)"
      },
      "PB_DebianKeys": {
 -      "value": "/p:DebianId_ubuntu1404-x64=$(PB_DebianId_ubuntu1404-x64) /p:DebianId_debian8-x64=$(PB_DebianId_debian8-x64) /p:DebianId_ubuntu1604-x64=$(PB_DebianId_ubuntu1604-x64) /p:DebianId_ubuntu1610-x64=$(PB_DebianId_ubuntu1610-x64)"
 +      "value": "/p:DebianId_ubuntu1404-x64=$(PB_DebianId_ubuntu1404-x64) /p:DebianId_debian8-x64=$(PB_DebianId_debian8-x64) /p:DebianId_debian9-x64=$(PB_DebianId_debian9-x64) /p:DebianId_ubuntu1604-x64=$(PB_DebianId_ubuntu1604-x64) /p:DebianId_ubuntu1610-x64=$(PB_DebianId_ubuntu1610-x64)"
      },
      "DockerTag_Ubuntu1404": {
        "value": "ubuntu-14.04-debpkg-e5cf912-20175003025046"
      "DockerCommonRunArgs_Debian8": {
        "value": "--name $(PB_DockerContainerName)$(DockerTag_Debian8) -v \"$(PB_SourcesDirectory):$(PB_GitDirectory)\" -v $(Build.StagingDirectory)/sharedFrameworkPublish/:/root/sharedFrameworkPublish/ -w=\"$(PB_GitDirectory)\" $(DockerImageName_Debian8)"
      },
-     "DistroRid_Debian9": {
-       "value": "debian.9-$(PB_TargetArchitecture)"
-     },
 +    "DockerTag_Debian9": {
 +      "value": "debian-8.2-debpkg-9f87c3c-20173003023006"
 +    },
 +    "DockerImageName_Debian9": {
 +      "value": "$(PB_DockerRepository):$(DockerTag_Debian9)"
 +    },
 +    "DockerCommonRunArgs_Debian9": {
 +      "value": "--name $(PB_DockerContainerName)$(DockerTag_Debian9) -v \"$(PB_SourcesDirectory):$(PB_GitDirectory)\" -v $(Build.StagingDirectory)/sharedFrameworkPublish/:/root/sharedFrameworkPublish/ -w=\"$(PB_GitDirectory)\" $(DockerImageName_Debian9)"
 +    },
      "DockerTag_Rhel7": {
        "value": "rhel-7-rpmpkg-c982313-20174116044113"
      },
          "solution": "$(PB_SourcesDirectory)\\publish\\publish.proj",
          "platform": "$(PB_TargetArchitecture)",
          "configuration": "$(BuildConfiguration)",
-         "msbuildArguments": "/p:Configuration=$(BuildConfiguration) $(PB_CommonMSBuildArgs) /p:SignType=$(PB_SignType) /p:NuGetFeedUrl=$(NUGET_FEED_URL) /p:NuGetSymbolsFeedUrl=$(NUGET_SYMBOLS_FEED_URL) /p:NuGetApiKey=$(NUGET_API_KEY) /p:AzureAccountName=$(PB_AzureAccountName) /p:AzureAccessToken=$(PB_AzureAccessToken) /p:ChecksumAzureAccountName=$(PB_ChecksumAzureAccountName) /p:ChecksumAzureAccessToken=$(PB_ChecksumAzureAccessToken) /p:GitHubUser=$(PB_GitHubUser) /p:GitHubEmail=$(PB_GitHubEmail) /p:GitHubAuthToken=$(GITHUB_PASSWORD) /p:VersionsRepoOwner=$(PB_VersionsRepoOwner) /p:VersionsRepo=$(PB_VersionsRepo) /p:VersionsRepoPath=build-info/dotnet/$(PB_RepoName)/$(SourceBranch) /p:Finalize=true /p:DotNetToolDir=$(DotNetToolDir) /p:EmbedIndexToolDir=$(EmbedIndexToolDir) /flp:v=detailed;LogFile=$(PB_SourcesDirectory)\\publish.log",
 -        "msbuildArguments": "/p:Configuration=$(BuildConfiguration) $(PB_CommonMSBuildArgs) /p:NuGetFeedUrl=$(NUGET_FEED_URL) /p:NuGetSymbolsFeedUrl=$(NUGET_SYMBOLS_FEED_URL) /p:NuGetApiKey=$(NUGET_API_KEY) /p:AzureAccountName=$(PB_AzureAccountName) /p:ContainerName=$(PB_ContainerName) /p:AzureAccessToken=$(PB_AzureAccessToken) /p:ChecksumAzureAccountName=$(PB_ChecksumAzureAccountName) /p:ChecksumContainerName=$(PB_ChecksumContainerName) /p:ChecksumAzureAccessToken=$(PB_ChecksumAzureAccessToken) /p:GitHubUser=$(PB_GitHubUser) /p:GitHubEmail=$(PB_GitHubEmail) /p:GitHubAuthToken=$(GITHUB_PASSWORD) /p:VersionsRepoOwner=$(PB_VersionsRepoOwner) /p:VersionsRepo=$(PB_VersionsRepo) /p:VersionsRepoPath=build-info/dotnet/$(PB_RepoName)/$(SourceBranch) /p:Finalize=true /flp:v=detailed;LogFile=$(PB_SourcesDirectory)\\publish.log",
++        "msbuildArguments": "/p:Configuration=$(BuildConfiguration) $(PB_CommonMSBuildArgs) /p:SignType=$(PB_SignType) /p:NuGetFeedUrl=$(NUGET_FEED_URL) /p:NuGetSymbolsFeedUrl=$(NUGET_SYMBOLS_FEED_URL) /p:NuGetApiKey=$(NUGET_API_KEY) /p:AzureAccountName=$(PB_AzureAccountName) /p:ContainerName=$(PB_ContainerName) /p:AzureAccessToken=$(PB_AzureAccessToken) /p:ChecksumAzureAccountName=$(PB_ChecksumAzureAccountName) /p:ChecksumContainerName=$(PB_ChecksumContainerName) /p:ChecksumAzureAccessToken=$(PB_ChecksumAzureAccessToken) /p:GitHubUser=$(PB_GitHubUser) /p:GitHubEmail=$(PB_GitHubEmail) /p:GitHubAuthToken=$(GITHUB_PASSWORD) /p:VersionsRepoOwner=$(PB_VersionsRepoOwner) /p:VersionsRepo=$(PB_VersionsRepo) /p:VersionsRepoPath=build-info/dotnet/$(PB_RepoName)/$(SourceBranch) /p:Finalize=true /p:DotNetToolDir=$(DotNetToolDir) /p:EmbedIndexToolDir=$(EmbedIndexToolDir) /flp:v=detailed;LogFile=$(PB_SourcesDirectory)\\publish.log",
          "clean": "false",
          "maximumCpuCount": "false",
          "restoreNugetPackages": "false",
      "CertificateId": {
        "value": "400"
      },
-     "PB_DistroRid": {
-       "value": "win-$(PB_TargetArchitecture)",
-       "allowOverride": true
-     },
      "MsbuildSigningArguments": {
 -      "value": "/p:CertificateId=$(CertificateId) /v:detailed"
 +      "value": "/p:CertificateId=$(CertificateId) /v:detailed /p:SignType=$(PB_SignType)"
      },
      "TeamName": {
        "value": "DotNetCore"
        "value": "HEAD"
      },
      "PB_SignType": {
 -      "value": "real"
 +      "value": "real",
 +      "allowOverride": true
      },
      "PB_CommonMSBuildArgs": {
-       "value": "/p:DistroRid=$(PB_DistroRid) /p:ConfigurationGroup=$(BuildConfiguration) /p:TargetArchitecture=$(PB_TargetArchitecture) /p:PortableBuild=$(PB_PortableBuild) /p:DisableCrossgen=true $(PB_AdditionalBuildArguments)"
+       "value": "/p:ConfigurationGroup=$(BuildConfiguration) /p:TargetArchitecture=$(PB_TargetArchitecture) /p:PortableBuild=$(PB_PortableBuild) /p:DisableCrossgen=true $(PB_AdditionalBuildArguments)"
      },
      "PB_AdditionalBuildArguments": {
        "value": ""
          "msbuildLocation": "",
          "platform": "$(PB_TargetArchitecture)",
          "configuration": "$(BuildConfiguration)",
-         "msbuildArguments": "$(PB_CommonMSBuildArgs) /p:AzureAccountName=$(PB_AzureAccountName) /p:AzureAccessToken=$(PB_AzureAccessToken) /p:PublishRidAgnosticPackages=$(PB_PublishRidAgnosticPackages) /p:BuildFullPlatformManifest=$(PB_BuildFullPlatformManifest) /p:ChecksumAzureAccountName=$(PB_ChecksumAzureAccountName) /p:ChecksumAzureAccessToken=$(PB_ChecksumAzureAccessToken) /flp:v=detailed;LogFile=$(PB_SourcesDirectory)\\publish.log",
 -        "msbuildArguments": "$(PB_CommonMSBuildArgs) /p:AzureAccountName=$(PB_AzureAccountName) /p:ContainerName=$(PB_ContainerName) /p:AzureAccessToken=$(PB_AzureAccessToken) /p:PublishRidAgnosticPackages=$(PB_PublishRidAgnosticPackages) /p:BuildFullPlatformManifest=$(PB_BuildFullPlatformManifest) /p:ChecksumAzureAccountName=$(PB_ChecksumAzureAccountName) /p:ChecksumContainerName=$(PB_ChecksumContainerName) /p:ChecksumAzureAccessToken=$(PB_ChecksumAzureAccessToken) /flp:v=detailed;LogFile=$(PB_SourcesDirectory)\\publish.log",
++        "msbuildArguments": "$(PB_CommonMSBuildArgs) /p:AzureAccountName=$(PB_AzureAccountName) /p:ContainerName=$(PB_ContainerName) /p:AzureAccessToken=$(PB_AzureAccessToken) /p:PublishRidAgnosticPackages=$(PB_PublishRidAgnosticPackages) /p:BuildFullPlatformManifest=$(PB_BuildFullPlatformManifest) /p:ChecksumAzureAccountName=$(PB_ChecksumAzureAccountName) p:ChecksumContainerName=$(PB_ChecksumContainerName) /p:ChecksumAzureAccessToken=$(PB_ChecksumAzureAccessToken) /flp:v=detailed;LogFile=$(PB_SourcesDirectory)\\publish.log",
          "clean": "false",
          "maximumCpuCount": "false",
          "restoreNugetPackages": "false",
      "PB_AzureAccountName": {
        "value": "sourcebuild"
      },
 -    "PB_AzureAccessToken": {
+     "PB_ContainerName": {
+       "value": "dotnet"
+     },
 +    "PB_Branch": {
 +      "value": "master",
 +      "allowOverride": true
 +    },
 +    "PB_BuildFullPlatformManifest": {
 +      "value": "false"
 +    },
 +    "PB_ChecksumAzureAccessToken": {
        "value": null,
        "isSecret": true
      },
      "PB_ChecksumAzureAccountName": {
        "value": "dotnetclichecksums"
      },
 -    "PB_ChecksumAzureAccessToken": {
 -      "value": null,
 -      "isSecret": true
+     "PB_ChecksumContainerName": {
+       "value": "dotnet"
+     },
 +    "PB_CleanAgent": {
 +      "value": "true"
      },
 -    "PB_VsoAccountName": {
 -      "value": "dn-bot"
 +    "PB_CommonMSBuildArgs": {
 +      "value": "/p:DistroRid=$(PB_DistroRid) /p:ConfigurationGroup=$(BuildConfiguration) /p:TargetArchitecture=$(PB_TargetArchitecture) /p:PortableBuild=$(PB_PortableBuild)"
      },
 -    "PB_VsoPassword": {
 -      "value": null,
 -      "isSecret": true
 +    "PB_DistroRid": {
 +      "value": "win-$(PB_TargetArchitecture)",
 +      "allowOverride": true
      },
 -    "PB_Branch": {
 -      "value": "master"
 +    "PB_PortableBuild": {
 +      "value": "true",
 +      "allowOverride": true
      },
 -    "SourceVersion": {
 -      "value": "HEAD"
 +    "PB_PublishRidAgnosticPackages": {
 +      "value": "false"
      },
      "PB_SignType": {
 -      "value": "real"
 -    },
 -    "PB_CommonMSBuildArgs": {
 -      "value": "/p:ConfigurationGroup=$(BuildConfiguration) /p:TargetArchitecture=$(PB_TargetArchitecture) /p:PortableBuild=$(PB_PortableBuild)"
 +      "value": "real",
 +      "allowOverride": true
      },
 -    "OfficialBuildId": {
 -      "value": "$(Build.BuildNumber)"
 +    "PB_SourcesDirectory": {
 +      "value": "$(Build.SourcesDirectory)\\core-setup"
      },
      "PB_TargetArchitecture": {
        "value": "x64",
Simple merge
Simple merge
Simple merge
@@@ -12,126 -12,109 +12,116 @@@ __BUILD_TOOLS_PACKAGE_VERSION=$(cat $__
  __DOTNET_TOOLS_VERSION=$(cat $__scriptpath/DotnetCLIVersion.txt)
  __BUILD_TOOLS_PATH=$__PACKAGES_DIR/microsoft.dotnet.buildtools/$__BUILD_TOOLS_PACKAGE_VERSION/lib
  __INIT_TOOLS_RESTORE_PROJECT=$__scriptpath/init-tools.msbuild
- __INIT_TOOLS_DONE_MARKER_DIR=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION
- __INIT_TOOLS_DONE_MARKER=$__INIT_TOOLS_DONE_MARKER_DIR/done
+ __BUILD_TOOLS_SEMAPHORE=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION/init-tools.complete
  
- # We do not want to run the first-time experience.
- export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
+ if [ -e $__BUILD_TOOLS_SEMAPHORE ]; then
+     echo "Tools are already initialized"
+     return #return instead of exit because this script is inlined in other scripts which we don't want to exit
+ fi
+ if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi
  
- if [ -z "$__DOTNET_PKG" ]; then
-     if [ "$(uname -m | grep "i[3456]86")" = "i686" ]; then
-         echo "Warning: build not supported on 32 bit Unix"
+ if [ -d "$DotNetBuildToolsDir" ]; then
+     echo "Using tools from '$DotNetBuildToolsDir'."
+     ln -s "$DotNetBuildToolsDir" "$__TOOLRUNTIME_DIR"
+     if [ ! -e "$__DOTNET_CMD" ]; then
+         echo "ERROR: Ensure that $DotNetBuildToolsDir contains the .NET Core SDK at $__DOTNET_PATH"
+         exit 1
      fi
- OSName=$(uname -s)
-     case $OSName in
-         Darwin)
-             OS=OSX
-             __DOTNET_PKG=dotnet-dev-osx-x64
-             ulimit -n 2048
-             ;;
-         Linux)
-             __DOTNET_PKG=dotnet-dev-linux-x64
-             OS=Linux
-             if [ -e /etc/os-release ]; then
-                 source /etc/os-release
-                 if [[ $ID == "alpine" ]]; then
-                     # remove the last version digit
-                     VERSION_ID=${VERSION_ID%.*}
-                     __DOTNET_PKG=dotnet-dev-alpine.$VERSION_ID-x64
-                 fi
-             elif [ -e /etc/redhat-release ]; then
-                 redhatRelease=$(</etc/redhat-release)
-                 if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
-                     __DOTNET_PKG=dotnet-dev-rhel.6-x64
-                 fi
-             fi                        
-                       
-             ;;
-         *)
-             echo "Unsupported OS '$OSName' detected. Downloading linux-x64 tools."
-             OS=Linux
-             __DOTNET_PKG=dotnet-dev-linux-x64
-             ;;
-   esac
+     echo "Done initializing tools."
+     mkdir -p "$(dirname "$__BUILD_TOOLS_SEMAPHORE")" && touch $__BUILD_TOOLS_SEMAPHORE
+     exit 0
  fi
  
- if [ ! -e $__INIT_TOOLS_DONE_MARKER ]; then
-     __PATCH_CLI_NUGET_FRAMEWORKS=0
-     if [ -e $__TOOLRUNTIME_DIR ]; then rm -rf -- $__TOOLRUNTIME_DIR; fi
-     echo "Running: $__scriptpath/init-tools.sh" > $__init_tools_log
-     if [ ! -e $__DOTNET_PATH ]; then
-         mkdir -p "$__DOTNET_PATH"
-         if [ -n "$DOTNET_TOOLSET_DIR" ] && [ -d "$DOTNET_TOOLSET_DIR/$__DOTNET_TOOLS_VERSION" ]; then
-             echo "Copying $DOTNET_TOOLSET_DIR/$__DOTNET_TOOLS_VERSION to $__DOTNET_PATH" >> $__init_tools_log
-             cp -r $DOTNET_TOOLSET_DIR/$__DOTNET_TOOLS_VERSION/* $__DOTNET_PATH
-         elif [ -n "$DOTNET_TOOL_DIR" ] && [ -d "$DOTNET_TOOL_DIR" ]; then
-             echo "Copying $DOTNET_TOOL_DIR to $__DOTNET_PATH" >> $__init_tools_log
-             cp -r $DOTNET_TOOL_DIR/* $__DOTNET_PATH
-         else
-             echo "Installing dotnet cli..."
-             __DOTNET_LOCATION="https://dotnetcli.azureedge.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz"
-             # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
-             echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'" >> $__init_tools_log
-             which curl > /dev/null 2> /dev/null
-             if [ $? -ne 0 ]; then
-                 wget -q -O $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
-             else
-                 curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
-             fi
-             cd $__DOTNET_PATH
-             tar -xf $__DOTNET_PATH/dotnet.tar
-             cd $__scriptpath
-             __PATCH_CLI_NUGET_FRAMEWORKS=1
+ echo "Running: $__scriptpath/init-tools.sh" > $__init_tools_log
+ if [ ! -e $__DOTNET_PATH ]; then
+     if [ -z "$__DOTNET_PKG" ]; then
+         if [ "$(uname -m | grep "i[3456]86")" = "i686" ]; then
+             echo "Warning: build not supported on 32 bit Unix"
          fi
 -            Linux)
 -                __DOTNET_PKG=dotnet-dev-linux-x64
 -                OS=Linux
+         OSName=$(uname -s)
+         case $OSName in
+             Darwin)
+                 OS=OSX
+                 __DOTNET_PKG=dotnet-dev-osx-x64
+                 ulimit -n 2048
+                 ;;
 -                if [ -e /etc/redhat-release ]; then
 -                    redhatRelease=$(</etc/redhat-release)
 -                    if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
 -                        __DOTNET_PKG=dotnet-dev-rhel.6-x64
 -                    fi
 -                fi
 -
 -                ;;
++                      Linux)
++                              __DOTNET_PKG=dotnet-dev-linux-x64
++                              OS=Linux
++                              if [ -e /etc/os-release ]; then
++                                      source /etc/os-release
++                                      if [[ $ID == "alpine" ]]; then
++                                              # remove the last version digit
++                                              VERSION_ID=${VERSION_ID%.*}
++                                              __DOTNET_PKG=dotnet-dev-alpine.$VERSION_ID-x64
++                                      fi
++                              elif [ -e /etc/redhat-release ]; then
++                                      redhatRelease=$(</etc/redhat-release)
++                                      if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
++                                              __DOTNET_PKG=dotnet-dev-rhel.6-x64
++                                      fi
++                              fi                      
++                      
++                              ;;
+             *)
+                 echo "Unsupported OS '$OSName' detected. Downloading linux-x64 tools."
+                 OS=Linux
+                 __DOTNET_PKG=dotnet-dev-linux-x64
+                 ;;
+       esac
      fi
  
+     mkdir -p "$__DOTNET_PATH"
  
-     if [ -n "$BUILD_TOOLS_TOOLSET_DIR" ] && [ -d "$BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION" ]; then
-         echo "Copying $BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION to $__TOOLRUNTIME_DIR" >> $__init_tools_log
-         cp -r $BUILD_TOOLS_TOOLSET_DIR/$__BUILD_TOOLS_PACKAGE_VERSION/* $__TOOLRUNTIME_DIR
-     elif [ -n "$BUILD_TOOLS_TOOL_DIR" ] && [ -d "$BUILD_TOOLS_TOOL_DIR" ]; then
-         echo "Copying $BUILD_TOOLS_TOOL_DIR to $__TOOLRUNTIME_DIR" >> $__init_tools_log
-         cp -r $BUILD_TOOLS_TOOL_DIR/* $__TOOLRUNTIME_DIR
+     echo "Installing dotnet cli..."
+     __DOTNET_LOCATION="https://dotnetcli.azureedge.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.${__DOTNET_TOOLS_VERSION}.tar.gz"
+     # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
+     echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'" >> $__init_tools_log
+     which curl > /dev/null 2> /dev/null
+     if [ $? -ne 0 ]; then
+         wget -q -O $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
      else
-         if [ ! -e $__BUILD_TOOLS_PATH ]; then
-             echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..."
-             echo "Running: $__DOTNET_CMD restore \"$__INIT_TOOLS_RESTORE_PROJECT\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION" >> $__init_tools_log
-             $__DOTNET_CMD restore "$__INIT_TOOLS_RESTORE_PROJECT" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION >> $__init_tools_log
-             if [ ! -e "$__BUILD_TOOLS_PATH/init-tools.sh" ]; then echo "ERROR: Could not restore build tools correctly. See '$__init_tools_log' for more details."1>&2; fi
-         fi
-         echo "Initializing BuildTools..."
-         echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR" >> $__init_tools_log
-         # Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424
-         chmod +x $__BUILD_TOOLS_PATH/init-tools.sh
-         $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR >> $__init_tools_log
-         if [ "$?" != "0" ]; then
-             echo "ERROR: An error occured when trying to initialize the tools. Please check '$__init_tools_log' for more details."1>&2
-             exit 1
-         fi
+         curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
      fi
+     cd $__DOTNET_PATH
+     tar -xf $__DOTNET_PATH/dotnet.tar
  
-     echo "Making all .sh files executable under Tools."
-     # Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424
-     ls $__scriptpath/Tools/*.sh | xargs chmod +x
-     ls $__scriptpath/Tools/scripts/docker/*.sh | xargs chmod +x
+     cd $__scriptpath
+ fi
  
-     Tools/crossgen.sh $__scriptpath/Tools
+ if [ ! -e $__BUILD_TOOLS_PATH ]; then
+     echo "Restoring BuildTools version $__BUILD_TOOLS_PACKAGE_VERSION..."
+     echo "Running: $__DOTNET_CMD restore \"$__INIT_TOOLS_RESTORE_PROJECT\" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION" >> $__init_tools_log
+     $__DOTNET_CMD restore "$__INIT_TOOLS_RESTORE_PROJECT" --no-cache --packages $__PACKAGES_DIR --source $__BUILDTOOLS_SOURCE /p:BuildToolsPackageVersion=$__BUILD_TOOLS_PACKAGE_VERSION >> $__init_tools_log
+     if [ ! -e "$__BUILD_TOOLS_PATH/init-tools.sh" ]; then echo "ERROR: Could not restore build tools correctly. See '$__init_tools_log' for more details."1>&2; fi
+ fi
  
-     mkdir -p $__INIT_TOOLS_DONE_MARKER_DIR
-     touch $__INIT_TOOLS_DONE_MARKER
+ echo "Initializing BuildTools..."
+ echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR" >> $__init_tools_log
  
-     echo "Done initializing tools."
- else
-     echo "Tools are already initialized"
+ # Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424
+ chmod +x $__BUILD_TOOLS_PATH/init-tools.sh
+ $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR >> $__init_tools_log
+ if [ "$?" != "0" ]; then
+     echo "ERROR: An error occured when trying to initialize the tools. Please check '$__init_tools_log' for more details."1>&2
+     exit 1
  fi
+ echo "Making all .sh files executable under Tools."
+ # Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424
+ ls $__scriptpath/Tools/*.sh | xargs chmod +x
+ ls $__scriptpath/Tools/scripts/docker/*.sh | xargs chmod +x
+ Tools/crossgen.sh $__scriptpath/Tools
+ mkdir -p "$(dirname "$__BUILD_TOOLS_SEMAPHORE")" && touch $__BUILD_TOOLS_SEMAPHORE
+ echo "Done initializing tools."
  
    <Target Name="GenerateCombinedInstallers" DependsOnTargets="InitPackage;GenerateBundles" />
  
 -  <PropertyGroup>
 -    <BuildAllPackages>false</BuildAllPackages>
 -  </PropertyGroup>
 -
    <Target Name="GenerateNugetPackages" DependsOnTargets="InitPackage" Condition="'$(UsePrebuiltPortableBinariesForInstallers)' == 'false'">
      <ItemGroup>
+       <!-- The list of packages we are servicing -->
        <PackageProjects Include="$(ProjectDir)src\managed\Microsoft.DotNet.PlatformAbstractions\Microsoft.DotNet.PlatformAbstractions.csproj" />
        <PackageProjects Include="$(ProjectDir)src\managed\Microsoft.Extensions.DependencyModel\Microsoft.Extensions.DependencyModel.csproj" />
      </ItemGroup>
@@@ -4,12 -4,12 +4,12 @@@
    <PropertyGroup>
      <!-- we intentionally don't want to produce output -->
      <OutputPath>unused</OutputPath>
-     <!-- we don't want any analyzers by ResolveNuGetPackageAssets 
+     <!-- we don't want any analyzers by ResolveNuGetPackageAssets
           null-refs when this isn't set and an analyzer is in the packages -->
      <Language>unused</Language>
 -    <NuGetTargetMoniker>.NETCoreApp,Version=v2.0</NuGetTargetMoniker>
 -    <NuGetTargetMonikerShort>netcoreapp2.0</NuGetTargetMonikerShort>
 -    <PackageTargetFramework>netcoreapp2.0</PackageTargetFramework>
 +    <NuGetTargetMoniker>.NETCoreApp,Version=v2.1</NuGetTargetMoniker>
 +    <NuGetTargetMonikerShort>netcoreapp2.1</NuGetTargetMonikerShort>
 +    <PackageTargetFramework>netcoreapp2.1</PackageTargetFramework>
      <PrimaryPackage>Microsoft.Private.CoreFx.NETCoreApp</PrimaryPackage>
      <CrossGenOutputPath>$(CrossGenRootPath)/$(MSBuildProjectName)/$(NuGetRuntimeIdentifier)</CrossGenOutputPath>
      <ContainsPackageReferences>true</ContainsPackageReferences>
@@@ -4,12 -4,12 +4,12 @@@
    <PropertyGroup>
      <!-- we intentionally don't want to produce output -->
      <OutputPath>unused</OutputPath>
-     <!-- we don't want any analyzers by ResolveNuGetPackageAssets 
+     <!-- we don't want any analyzers by ResolveNuGetPackageAssets
           null-refs when this isn't set and an analyzer is in the packages -->
      <Language>unused</Language>
 -    <NuGetTargetMoniker>UAP,Version=v10.1</NuGetTargetMoniker>
 -    <NuGetTargetMonikerShort>uap10.1</NuGetTargetMonikerShort>
 -    <PackageTargetFramework>uap10.1</PackageTargetFramework>
 +    <NuGetTargetMoniker>$(UAPvNextTFMFull)</NuGetTargetMoniker>
 +    <NuGetTargetMonikerShort>$(UAPvNextTFM)</NuGetTargetMonikerShort>
 +    <PackageTargetFramework>$(UAPvNextTFM)</PackageTargetFramework>
      <PrimaryPackage>Microsoft.Private.CoreFx.UAP</PrimaryPackage>
      <ContainsPackageReferences>true</ContainsPackageReferences>
      <RestorePackages>true</RestorePackages>
@@@ -9,25 -12,8 +9,20 @@@
      <ChecksumsRelativePath>Runtime/$(ProductVersion)</ChecksumsRelativePath>
      <ChecksumExtension>.sha512</ChecksumExtension>
    </PropertyGroup>
-   
-   <PropertyGroup>
-     <ProductMoniker>$(DistroRid).$(SharedFrameworkNugetVersion)</ProductMoniker>
-     <HostResolverVersionMoniker>$(DistroRid).$(HostResolverVersion)</HostResolverVersionMoniker>
-   </PropertyGroup>
  
    <ItemGroup>
 +    <!-- IgnorableErrorMessages applies to the "ExectWithRetriesForNuGetPush" task.
 +          There's a very special failure scenario that we want to ignore.  That scenario is
 +          when NuGet hits a timeout on one "push" attempt, and then gets a "Forbidden" response
 +          because the package "already exists" on the next response.  This indicates that the
 +          timeout occurred, but the push was actually successful.
 +    -->
 +    <IgnorableErrorMessages Include="Overwriting existing packages is forbidden according to the package retention settings for this feed.">
 +      <ConditionalErrorMessage>Pushing took too long</ConditionalErrorMessage>
 +    </IgnorableErrorMessages>
 +  </ItemGroup>
 +  
 +  <ItemGroup>
      <CompressedFile Include="$(PackagesOutDir)**/*$(CompressedFileExtension)">
        <RelativeBlobPath>$(BinariesRelativePath)</RelativeBlobPath>
      </CompressedFile>
Simple merge
    
    <Target Name="PublishFinalOutput"
            Condition="'$(Finalize)' == 'true'"
-           DependsOnTargets="PublishCoreHostPackagesToFeed;FinalizeBuildInAzure;UpdatePublishedVersions" />
-           
-   <Target Name="ExcludeSymbolsPackagesFromPublishedVersions" BeforeTargets="UpdatePublishedVersions" >
+           DependsOnTargets="PublishCoreHostPackagesToFeed;FinalizeBuildInAzure;UpdateVersionsRepo" />
+   <!--
+     Target wrapping UpdatePublishedVersions: ensures that ShippedNuGetPackage items are created and
+     disables versions repo update if no auth token is defined. Otherwise, not specifying an auth
+     token would cause an error.
+   -->
+   <Target Name="UpdateVersionsRepo"
+           Condition="'$(GitHubAuthToken)' != ''"
+           DependsOnTargets="ExcludeSymbolsPackagesFromPublishedVersions;
+                             UpdatePublishedVersions" />
+   <Target Name="ExcludeSymbolsPackagesFromPublishedVersions">
      <ItemGroup>
 -      <PackagesToShip Include="$(BinDir)/ForPublishing/*.nupkg" Exclude="$(BinDir)/ForPublishing/*.symbols.nupkg" />
 +      <PackagesToShip Include="$(PublishDirectory)*.nupkg" Exclude="$(PublishDirectory)*.symbols.nupkg" />
        <PackagesToShip Remove="%(PackagesToShip.Identity)" Condition="$([System.String]::Copy('%(PackagesToShip.Identity)').Contains('latest'))" />
        <ShippedNuGetPackage Include="@(PackagesToShip)" />
      </ItemGroup>
    </Target>
  
    <Target Name="PublishCoreHostPackagesToFeed"
 -          DependsOnTargets="CheckIfAllBuildsHavePublished"
 +          DependsOnTargets="CheckIfAllBuildsHavePublished;DownloadCoreHostPackages;SignSymbolPackages;DoPushCoreHostPackagesToFeed"
-           Condition="'@(_MissingBlobNames)' == ''">
+           Condition="'@(_MissingBlobNames)' == '' AND '$(NuGetFeedUrl)' != ''">
 +    <Error Condition="'$(NuGetFeedUrl)' ==''" Text="Missing required property NuGetFeedUrl" />
      <Error Condition="'$(NuGetApiKey)' == ''" Text="Missing required property NuGetApiKey" />
      <Error Condition="'$(AzureAccessToken)' == ''" Text="Missing required property 'AzureAccessToken'" />
      <Error Condition="'$(AzureAccountName)' == ''" Text="Missing required property 'AzureAccountName'" />
        <NuGetPushSymbolsCommand>$(DotnetToolCommand) nuget push --source $(NuGetSymbolsFeedUrl) --api-key $(NuGetApiKey) --timeout $(NuGetPushTimeoutSeconds)</NuGetPushSymbolsCommand>
      </PropertyGroup>
  
 -      <!-- ToDo: look at moving this to an msbuild task so that we can include retry logic, parallelize it, and hide the api key -->
 -    <Exec Command="$(NuGetPushCommand) %(_DownloadedStandardPackages.Identity)" />
 +    <ExecWithRetriesForNuGetPush Command="$(NuGetPushCommand) %(_DownloadedStandardPackages.Identity)"
 +                                 IgnoredErrorMessagesWithConditional="@(IgnorableErrorMessages)" />
  
      <Message Condition="'@(_DownloadedSymbolsPackages)' != ''" Text="Pushing CoreHost symbols packages to $(NuGetSymbolsFeedUrl)" />
 -    <Exec Condition="'@(_DownloadedSymbolsPackages)' != ''" Command="$(NuGetPushSymbolsCommand) %(_DownloadedSymbolsPackages.Identity)" />
 +    <ExecWithRetriesForNuGetPush Condition="'@(_DownloadedSymbolsPackages)' != ''"
 +                                 Command="$(NuGetPushSymbolsCommand) %(_DownloadedSymbolsPackages.Identity)"
 +                                 IgnoredErrorMessagesWithConditional="@(IgnorableErrorMessages)" />
    </Target>
 -  
 +
    <Target Name="PublishDebToolPackageToFeed"
-           Condition="'$(PublishDebToolToFeed)' == 'true'">
-     <Error Condition="'$(CliNuGetFeedUrl)' ==''" Text="Missing required property CliNuGetFeedUrl" />
+           Condition="'$(PublishDebToolToFeed)' == 'true' AND '$(CliNuGetFeedUrl)' != ''">
      <Error Condition="'$(CliNuGetApiKey)' == ''" Text="Missing required property CliNuGetApiKey" />
      <ItemGroup>
        <DebToolPackages Include="$(PackagesOutDir)/dotnet-deb-tool.*.nupkg" />
@@@ -7,11 -7,11 +7,11 @@@
      <Message Text="Fake sign target.  Would sign: @(FilesToSign)" />
    </Target>
  
 -  <Import Project="Tools/MicroBuild.Core.props" />
 -  <Import Project="Tools/MicroBuild.Core.targets" />
 +  <Import Project="$(ToolsDir)MicroBuild.Core.props" />
 +  <Import Project="$(ToolsDir)MicroBuild.Core.targets" />
  
    <Target Name="SetSigningProperties">
-     <Error Condition="'$(TargetRid)' == ''" Text="Missing required property 'TargetRid'." />
+     <Error Condition="'$(OutputRid)' == ''" Text="Missing required property 'OutputRid'." />
      <Error Condition="'$(CertificateId)' == ''" Text="Missing required property 'CertificateId'." />
      <PropertyGroup>
        <!-- The OutDir and IntermediateOutputPath properties are required by MicroBuild. MicroBuild only
Simple merge
index 0000000,6f15ca8..6f15ca8
mode 000000,100755..100644
--- /dev/null
@@@ -3,9 -3,10 +3,10 @@@
    <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
    <ItemGroup>
      <Project Include="$(MSBuildThisFileDirectory)$(MSBuildProjectName).csproj">
 -      <AdditionalProperties>TargetGroup=netstandard1.5</AdditionalProperties>
 +      <AdditionalProperties>TargetGroup=netstandard1.3</AdditionalProperties>
      </Project>
-     <Project Include="$(MSBuildThisFileDirectory)$(MSBuildProjectName).csproj">
+     <Project Include="$(MSBuildThisFileDirectory)$(MSBuildProjectName).csproj"
+              Condition="'$(BuildCustomTasksForDesktop)' == 'true'">
        <AdditionalProperties>TargetGroup=net45</AdditionalProperties>
      </Project>
    </ItemGroup>
    </ItemGroup>
    <ItemGroup Condition="'$(TargetGroup)' != 'net45'">
      <Compile Include="netstandard/FileUtilities.netstandard.cs" />
-     <PackageReference Include="Microsoft.Build">
-       <Version>0.1.0-preview-00022</Version>
-     </PackageReference>
-     <PackageReference Include="Microsoft.Build.Framework">
-       <Version>0.1.0-preview-00022</Version>
-     </PackageReference>
-     <PackageReference Include="Microsoft.Build.Tasks.Core">
-       <Version>0.1.0-preview-00022</Version>
-     </PackageReference>
-     <PackageReference Include="Microsoft.Build.Utilities.Core">
-       <Version>0.1.0-preview-00022</Version>
-     </PackageReference>
 +
 +    <Reference Include="$(BuildToolsTaskCoreDir)Microsoft.DotNet.Build.CloudTestTasks.dll" />
 +    
+     <PackageReference Include="Microsoft.Build" Version="$(MicrosoftBuildPackageVersion)" />
+     <PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
+     <PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCorePackageVersion)" />
+     <PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" />
      <PackageReference Include="Microsoft.Tpl.Dataflow">
        <Version>4.5.24</Version>
        <IncludeAssets>None</IncludeAssets>