diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1 index 64fd2f8abec..68119de603e 100644 --- a/eng/common/sdk-task.ps1 +++ b/eng/common/sdk-task.ps1 @@ -22,7 +22,7 @@ $warnAsError = if ($noWarnAsError) { $false } else { $true } function Print-Usage() { Write-Host "Common settings:" - Write-Host " -task Name of Arcade task (name of a project in SdkTasks directory of the Arcade SDK package)" + Write-Host " -task Name of Arcade task (name of a project in toolset directory of the Arcade SDK package)" Write-Host " -restore Restore dependencies" Write-Host " -verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]" Write-Host " -help Print help and exit" diff --git a/eng/common/sdk-task.sh b/eng/common/sdk-task.sh index 3270f83fa9a..1cf71bb2aea 100755 --- a/eng/common/sdk-task.sh +++ b/eng/common/sdk-task.sh @@ -2,7 +2,7 @@ show_usage() { echo "Common settings:" - echo " --task Name of Arcade task (name of a project in SdkTasks directory of the Arcade SDK package)" + echo " --task Name of Arcade task (name of a project in toolset directory of the Arcade SDK package)" echo " --restore Restore dependencies" echo " --verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]" echo " --help Print help and exit" diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index b6787991769..6a0f33d18e1 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -476,7 +476,6 @@ function LocateVisualStudio([object]$vsRequirements = $null){ if (Get-Member -InputObject $GlobalJson.tools -Name 'vswhere') { $vswhereVersion = $GlobalJson.tools.vswhere } else { - # keep this in sync with the VSWhereVersion in DefaultVersions.props $vswhereVersion = '3.1.7' } @@ -611,7 +610,17 @@ function GetNuGetPackageCachePath() { # Returns a full path to an Arcade SDK task project file. function GetSdkTaskProject([string]$taskName) { - return Join-Path (Split-Path (InitializeToolset) -Parent) "SdkTasks\$taskName.proj" + $toolsetDir = Split-Path (InitializeToolset) -Parent + $proj = Join-Path $toolsetDir "$taskName.proj" + if (Test-Path $proj) { + return $proj + } + # TODO: Remove this fallback once all supported versions use the new layout. + $legacyProj = Join-Path $toolsetDir "SdkTasks\$taskName.proj" + if (Test-Path $legacyProj) { + return $legacyProj + } + throw "Unable to find $taskName.proj in toolset at: $toolsetDir" } function InitializeNativeTools() { @@ -648,13 +657,18 @@ function InitializeToolset() { $nugetCache = GetNuGetPackageCachePath $toolsetVersion = Read-ArcadeSdkVersion - $toolsetLocationFile = Join-Path $ToolsetDir "$toolsetVersion.txt" + $toolsetToolsDir = Join-Path $ToolsetDir $toolsetVersion - if (Test-Path $toolsetLocationFile) { - $path = Get-Content $toolsetLocationFile -TotalCount 1 - if (Test-Path $path) { - return $global:_InitializeToolset = $path - } + # Check if the toolset has already been extracted + $toolsetBuildProj = $null + $buildProjPath = Join-Path $toolsetToolsDir 'Build.proj' + + if (Test-Path $buildProjPath) { + $toolsetBuildProj = $buildProjPath + } + + if ($toolsetBuildProj -ne $null) { + return $global:_InitializeToolset = $toolsetBuildProj } if (-not $restore) { @@ -662,21 +676,35 @@ function InitializeToolset() { ExitWithExitCode 1 } - $buildTool = InitializeBuildTool + DotNet package download "Microsoft.DotNet.Arcade.Sdk@$toolsetVersion" --prerelease --output "$nugetCache" - $proj = Join-Path $ToolsetDir 'restore.proj' - $bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'ToolsetRestore.binlog') } else { '' } + $packageDir = Join-Path $nugetCache (Join-Path 'microsoft.dotnet.arcade.sdk' $toolsetVersion) + $packageToolsetDir = Join-Path $packageDir 'toolset' + $packageToolsDir = Join-Path $packageDir 'tools' + + # TODO: Remove the tools/ check once all supported versions have the toolset folder. + if (!(Test-Path $packageToolsetDir) -and !(Test-Path $packageToolsDir)) { + Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "Arcade SDK package does not contain a toolset or tools folder: $packageDir" + ExitWithExitCode 3 + } - '' | Set-Content $proj + New-Item -ItemType Directory -Path $toolsetToolsDir -Force | Out-Null - MSBuild-Core $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$toolsetLocationFile + # Copy toolset if present at the package root (new layout), otherwise fall back to tools + if (Test-Path $packageToolsetDir) { + Copy-Item -Path "$packageToolsetDir\*" -Destination $toolsetToolsDir -Recurse -Force + } else { + # TODO: Remove this fallback once all supported versions have the toolset folder. + Copy-Item -Path "$packageToolsDir\*" -Destination $toolsetToolsDir -Recurse -Force + } - $path = Get-Content $toolsetLocationFile -Encoding UTF8 -TotalCount 1 - if (!(Test-Path $path)) { - throw "Invalid toolset path: $path" + if (Test-Path $buildProjPath) { + $toolsetBuildProj = $buildProjPath + } else { + throw "Unable to find Build.proj in toolset at: $toolsetToolsDir" } - return $global:_InitializeToolset = $path + return $global:_InitializeToolset = $toolsetBuildProj } function ExitWithExitCode([int] $exitCode) { @@ -737,6 +765,40 @@ function MSBuild() { MSBuild-Core @args } +# +# Executes a dotnet command with arguments passed to the function. +# Terminates the script if the command fails. +# +function DotNet() { + $dotnetRoot = InitializeDotNetCli -install:$restore + $dotnetPath = Join-Path $dotnetRoot (GetExecutableFileName 'dotnet') + + $cmdArgs = "" + foreach ($arg in $args) { + if ($null -ne $arg -and $arg.Trim() -ne "") { + if ($arg.EndsWith('\')) { + $arg = $arg + "\" + } + $cmdArgs += " `"$arg`"" + } + } + + $env:ARCADE_BUILD_TOOL_COMMAND = "`"$dotnetPath`" $cmdArgs" + + $exitCode = Exec-Process $dotnetPath $cmdArgs + + if ($exitCode -ne 0) { + Write-Host "dotnet command failed with exit code $exitCode. Check errors above." -ForegroundColor Red + + if ($ci -and $env:SYSTEM_TEAMPROJECT -ne $null -and !$fromVMR) { + Write-PipelineSetResult -Result "Failed" -Message "dotnet command execution failed." + ExitWithExitCode 0 + } else { + ExitWithExitCode $exitCode + } + } +} + # # Executes msbuild (or 'dotnet msbuild') with arguments passed to the function. # The arguments are automatically quoted. diff --git a/eng/common/tools.sh b/eng/common/tools.sh index a6e0ed594fd..238cb4cef88 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -407,15 +407,18 @@ function InitializeToolset { ReadGlobalVersion "Microsoft.DotNet.Arcade.Sdk" local toolset_version=$_ReadGlobalVersion - local toolset_location_file="$toolset_dir/$toolset_version.txt" + local toolset_tools_dir="$toolset_dir/$toolset_version" - if [[ -a "$toolset_location_file" ]]; then - local path=`cat "$toolset_location_file"` - if [[ -a "$path" ]]; then - # return value - _InitializeToolset="$path" - return - fi + # Check if the toolset has already been extracted + local toolset_build_proj="" + if [[ -a "$toolset_tools_dir/Build.proj" ]]; then + toolset_build_proj="$toolset_tools_dir/Build.proj" + fi + + if [[ -n "$toolset_build_proj" ]]; then + # return value + _InitializeToolset="$toolset_build_proj" + return fi if [[ "$restore" != true ]]; then @@ -423,20 +426,30 @@ function InitializeToolset { ExitWithExitCode 2 fi - local proj="$toolset_dir/restore.proj" + DotNet package download "Microsoft.DotNet.Arcade.Sdk@$toolset_version" --prerelease --output "$_GetNuGetPackageCachePath" + + local package_dir="$_GetNuGetPackageCachePath/microsoft.dotnet.arcade.sdk/$toolset_version" - local bl="" - if [[ "$binary_log" == true ]]; then - bl="/bl:$log_dir/ToolsetRestore.binlog" + # TODO: Remove the tools/ check once all supported versions have the toolset folder. + if [[ ! -d "$package_dir/toolset" && ! -d "$package_dir/tools" ]]; then + Write-PipelineTelemetryError -category 'InitializeToolset' "Arcade SDK package does not contain a toolset or tools folder: $package_dir" + ExitWithExitCode 3 fi - echo '' > "$proj" - MSBuild-Core "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file" + mkdir -p "$toolset_tools_dir" - local toolset_build_proj=`cat "$toolset_location_file"` + # Copy toolset if present at the package root (new layout), otherwise fall back to tools + if [[ -d "$package_dir/toolset" ]]; then + cp -r "$package_dir/toolset/." "$toolset_tools_dir" + else + # TODO: Remove this fallback once all supported versions have the toolset folder. + cp -r "$package_dir/tools/." "$toolset_tools_dir" + fi - if [[ ! -a "$toolset_build_proj" ]]; then - Write-PipelineTelemetryError -category 'Build' "Invalid toolset path: $toolset_build_proj" + if [[ -a "$toolset_tools_dir/Build.proj" ]]; then + toolset_build_proj="$toolset_tools_dir/Build.proj" + else + Write-PipelineTelemetryError -category 'Build' "Unable to find Build.proj in toolset at: $toolset_tools_dir" ExitWithExitCode 3 fi @@ -458,6 +471,26 @@ function StopProcesses { return 0 } +function DotNet { + InitializeDotNetCli $restore + + local dotnet_path="$_InitializeDotNetCli/dotnet" + + export ARCADE_BUILD_TOOL_COMMAND="$dotnet_path $@" + + "$dotnet_path" "$@" || { + local exit_code=$? + echo "dotnet command failed with exit code $exit_code. Check errors above." + + if [[ "$ci" == true && -n ${SYSTEM_TEAMPROJECT:-} && "$from_vmr" != true ]]; then + Write-PipelineSetResult -result "Failed" -message "dotnet command execution failed." + ExitWithExitCode 0 + else + ExitWithExitCode $exit_code + fi + } +} + function MSBuild { local args=( "$@" ) if [[ "$pipelines_log" == true ]]; then @@ -555,8 +588,22 @@ function GetDarc { # Returns a full path to an Arcade SDK task project file. function GetSdkTaskProject { - taskName=$1 - echo "$(dirname $_InitializeToolset)/SdkTasks/$taskName.proj" + local taskName=$1 + local toolsetDir + toolsetDir="$(dirname "$_InitializeToolset")" + local proj="$toolsetDir/$taskName.proj" + if [[ -a "$proj" ]]; then + echo "$proj" + return + fi + # TODO: Remove this fallback once all supported versions use the new layout. + local legacyProj="$toolsetDir/SdkTasks/$taskName.proj" + if [[ -a "$legacyProj" ]]; then + echo "$legacyProj" + return + fi + Write-PipelineTelemetryError -category 'Build' "Unable to find $taskName.proj in toolset at: $toolsetDir" + ExitWithExitCode 3 } ResolvePath "${BASH_SOURCE[0]}" diff --git a/src/Microsoft.DotNet.Arcade.Sdk/Microsoft.DotNet.Arcade.Sdk.csproj b/src/Microsoft.DotNet.Arcade.Sdk/Microsoft.DotNet.Arcade.Sdk.csproj index 861028474b9..723615e8e1a 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/Microsoft.DotNet.Arcade.Sdk.csproj +++ b/src/Microsoft.DotNet.Arcade.Sdk/Microsoft.DotNet.Arcade.Sdk.csproj @@ -40,6 +40,9 @@ + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/sdk/Sdk.props b/src/Microsoft.DotNet.Arcade.Sdk/sdk/Sdk.props index 10e1fe67ea4..b560dbf5b65 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/sdk/Sdk.props +++ b/src/Microsoft.DotNet.Arcade.Sdk/sdk/Sdk.props @@ -1,16 +1,6 @@ - - - <_SuppressSdkImports>false - <_SuppressSdkImports Condition="'$(__ToolsetLocationOutputFile)' != ''">true - - - + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/sdk/Sdk.targets b/src/Microsoft.DotNet.Arcade.Sdk/sdk/Sdk.targets index 11708bccc85..a55e12a0efc 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/sdk/Sdk.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/sdk/Sdk.targets @@ -10,21 +10,10 @@ <_BeforeCommonTargetsHookUsed Condition="'$(_ArcadeBeforeCommonTargetsImported)' != 'true'">false - - + + - - - - - - - - - - + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildStep.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildStep.props deleted file mode 100644 index a48dd077e84..00000000000 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildStep.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildTasks.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildTasks.props index 9a51d5b4cb9..23a8e252ec2 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildTasks.props +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildTasks.props @@ -15,4 +15,23 @@ $(MSBuildThisFileDirectory)net\Microsoft.DotNet.Arcade.Sdk.dll + + + + + + + + + + + + + + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props index 8a17e952a46..4ea58d11f8e 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props @@ -95,8 +95,6 @@ $(ArcadeSdkVersion) 3.12.0 3.15.1 - - 3.1.7 1.0.0 $(ArcadeSdkVersion) $(ArcadeSdkVersion) @@ -105,6 +103,9 @@ 1.1.286 3.14.1-11027.2914512 5.0.2-dotnet.2811440 + + $(ArcadeSdkVersion) + $(ArcadeSdkVersion) diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Directory.Build.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/Directory.Build.props deleted file mode 100644 index baea506b124..00000000000 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Directory.Build.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - false - false - - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Empty.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/Empty.targets index fd18c0474aa..9d2c498e7bd 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Empty.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Empty.targets @@ -1,5 +1,5 @@ - + - - false + true - - - - + + + BeforeBuild; + CoreBuild; + AfterBuild + + + + + + + + + + + - + + + + + BeforePack; + CorePack; + AfterPack + + + + + + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/EmptyDisableRestore.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/EmptyDisableRestore.targets new file mode 100644 index 00000000000..9ece989244e --- /dev/null +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/EmptyDisableRestore.targets @@ -0,0 +1,16 @@ + + + + + + false + + + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/ExcludeFromBuild.BeforeCommonTargets.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/ExcludeFromBuild.BeforeCommonTargets.targets index 3e7006260e8..d196db8678a 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/ExcludeFromBuild.BeforeCommonTargets.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/ExcludeFromBuild.BeforeCommonTargets.targets @@ -46,7 +46,6 @@ avoid building tests in certain product build scenarios. --> - <_SuppressAllTargets>false <_SuppressAllTargets Condition="'$(DotNetBuildSourceOnly)' == 'true' and '$(ExcludeFromSourceOnlyBuild)' == 'true'">true <_SuppressAllTargets Condition="'$(DotNetBuild)' == 'true' and '$(ExcludeFromDotNetBuild)' == 'true'">true @@ -57,7 +56,7 @@ which will avoid importing the restore targets inside the .NET SDK. If the restore targets exist, then static graph restore will attempt tpo execute. --> true - $(MSBuildThisFileDirectory)NoRestore.targets + $(MSBuildThisFileDirectory)NoRestore.targets false diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/GenerateChecksums.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/GenerateChecksums.targets index b625b3e70e9..02089e3a6d1 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/GenerateChecksums.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/GenerateChecksums.targets @@ -1,8 +1,6 @@ - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/GenerateResxSource.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/GenerateResxSource.targets index e7f105c21d0..d031f0d797f 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/GenerateResxSource.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/GenerateResxSource.targets @@ -6,8 +6,6 @@ The source file is generated to intermediate output dir to avoid polluting the source tree. See https://github.com/dotnet/sdk/issues/94 that tracks productization of this code. --> - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/OptimizationData.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/OptimizationData.targets index 24ef2781aa1..d20874ec3e4 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/OptimizationData.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/OptimizationData.targets @@ -13,10 +13,6 @@ OptimizeAssembly Set of assemblies to apply Partial NGEN optimization data to. --> - - - - $(IntermediateOutputPath)$(TargetFileName).pcbm diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryInfo.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryInfo.targets index f3f1dc0a5d9..36233e7cd88 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryInfo.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryInfo.targets @@ -56,7 +56,6 @@ Condition="'$(DisableSourceLinkUrlTranslation)' == 'false'" DependsOnTargets="$(SourceControlManagerUrlTranslationTargets)" BeforeTargets="SourceControlManagerPublishTranslatedUrls"> - @@ -78,7 +77,6 @@ Generates and adds {PackageId}.SourceLink.targets file to the build directory of the source package. --> - $(BeforePack);_AddSourcePackageSourceLinkFile @@ -119,14 +117,31 @@ - - + + + + + + + + + <_LicenseExpression>$(PackageLicenseExpression) + <_LicenseExpression Condition="'$(_LicenseExpression)' == ''">$(PackageLicenseExpressionInternal) + + <_ExpectedLicensePath>$(MSBuildThisFileDirectory)Licenses\$(_LicenseExpression).txt + + + + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryValidation.proj b/src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryValidation.proj index 5efc4b438dd..b45d2f307ab 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryValidation.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/RepositoryValidation.proj @@ -8,9 +8,6 @@ - - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/Directory.Build.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/Directory.Build.props deleted file mode 100644 index a889329a529..00000000000 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/Directory.Build.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - - $([System.IO.Path]::GetFullPath('$(RepoRoot)/')) - - - - - - - - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/Versions.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/Versions.props deleted file mode 100644 index d99f8045360..00000000000 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/Versions.props +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - $(ArcadeSdkVersion) - $(ArcadeSdkVersion) - $(ArcadeSdkVersion) - $(ArcadeSdkVersion) - $(MicrosoftSymbolUploaderBuildTaskVersion) - - - - - $(RestoreAdditionalProjectSources); - https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json; - https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json; - https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json; - - - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj deleted file mode 100644 index c5ba4421054..00000000000 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - - - net472 - - 5 - .NETFramework - .NETFramework,Version=v4.7.2 - $(BaseIntermediateOutputPath) - - PackageReference - true - - - - true - Restore - - - - - $(RepoRoot)NuGet.config - $(RepoRoot)NuGet.Config - $(RepoRoot)nuget.config - - - - - - - - - - - <_ImportOrUseTooling Condition="'$(_ImportOrUseTooling)' == '' and '$(DotNetBuildSourceOnly)' != 'true'">true - $(Publish) - - - - - - - - - - - - - - - - - - - - - - - <_RepoToolManifest>$([MSBuild]::NormalizePath('$(RepoRoot)', '.config', 'dotnet-tools.json')) - - - - - - - - - --configfile "$(RestoreConfigFile)" - - - - - - - - - $(RepoRoot)eng/common/internal/Tools.csproj - $(RepoRoot)eng/common/internal/NuGet.config - - - - - - - - - - - - - - - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Version.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/Version.targets index fab5620c279..4b6b9e42679 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Version.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Version.targets @@ -8,8 +8,6 @@ SemanticVersioningV1 "true" if the Version needs to respect SemVer 1.0. Default is false, which means format following SemVer 2.0. --> - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.VsixBuild.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.VsixBuild.targets index 5a654f5e468..3c4a7e19972 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.VsixBuild.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.VsixBuild.targets @@ -19,8 +19,6 @@ Writes a stub file to component intermediate directory. --> - - - - $(NuGetPackageRoot)microsoft.dotnet.build.tasks.visualstudio\$(MicrosoftDotNetBuildTasksVisualStudioVersion)\tools\net\Microsoft.DotNet.Build.Tasks.VisualStudio.dll - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/AfterSigning.proj b/src/Microsoft.DotNet.Arcade.Sdk/toolset/AfterSigning.proj similarity index 54% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/AfterSigning.proj rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/AfterSigning.proj index be73c83cef3..74f91d51b5e 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/AfterSigning.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/AfterSigning.proj @@ -1,43 +1,5 @@ - - - - true - - - - - - - - - - BeforeBuild; - CoreBuild; - AfterBuild - - - - - - - - - - - - BeforePack; - CorePack; - AfterPack - - - - - - - - - + - - - - - true - - - - - - - - - - - + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj b/src/Microsoft.DotNet.Arcade.Sdk/toolset/Build.proj similarity index 97% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/Build.proj index 802e0962075..afb89423811 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/Build.proj @@ -1,5 +1,5 @@ - + - true @@ -49,9 +47,6 @@ - - - @@ -153,7 +148,6 @@ <_RestoreToolsProps Include="@(_CommonProps)"/> - <_RestoreToolsProps Include="BaseIntermediateOutputPath=$(ArtifactsToolsetDir)Common"/> <_RestoreToolsProps Include="ExcludeRestorePackageImports=true"/> <_RestoreToolsProps Include="_NuGetRestoreTargets=$(_NuGetRestoreTargets)"/> diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildReleasePackages.targets b/src/Microsoft.DotNet.Arcade.Sdk/toolset/BuildReleasePackages.targets similarity index 79% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/BuildReleasePackages.targets rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/BuildReleasePackages.targets index 048dcff3db1..31bfb572a10 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/BuildReleasePackages.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/BuildReleasePackages.targets @@ -1,15 +1,12 @@ - - <_NuGetRepackAssembly>$(NuGetPackageRoot)microsoft.dotnet.nugetrepack.tasks\$(MicrosoftDotnetNuGetRepackTasksVersion)\tools\net\Microsoft.DotNet.NuGetRepack.Tasks.dll - - - + + + - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/CreateBaselineUpdatePR.proj b/src/Microsoft.DotNet.Arcade.Sdk/toolset/CreateBaselineUpdatePR.proj similarity index 78% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/CreateBaselineUpdatePR.proj rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/CreateBaselineUpdatePR.proj index c3c1920baaa..30d5b7300c8 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/CreateBaselineUpdatePR.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/CreateBaselineUpdatePR.proj @@ -2,12 +2,11 @@ - $(BundledNETCoreAppTargetFramework) Publish - + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/toolset/Directory.Build.props b/src/Microsoft.DotNet.Arcade.Sdk/toolset/Directory.Build.props new file mode 100644 index 00000000000..964e74ae5f2 --- /dev/null +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/Directory.Build.props @@ -0,0 +1,21 @@ + + + + + toolset\$(MSBuildProjectName) + + + + + + $(BundledNETCoreAppTargetFramework) + + + true + + <_SuppressAllTargets>true + <_SuppressSdkImports>false + <_NoSuppressRestoreTarget>false + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/toolset/Directory.Build.targets b/src/Microsoft.DotNet.Arcade.Sdk/toolset/Directory.Build.targets new file mode 100644 index 00000000000..1b623e82d8f --- /dev/null +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/Directory.Build.targets @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/toolset/Directory.Packages.props b/src/Microsoft.DotNet.Arcade.Sdk/toolset/Directory.Packages.props new file mode 100644 index 00000000000..c86d56ee87e --- /dev/null +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/Directory.Packages.props @@ -0,0 +1,22 @@ + + + + + true + + $(NoWarn);NU1507 + + + + + + + + + + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/InstallDotNetCore.targets b/src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets similarity index 72% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/InstallDotNetCore.targets rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets index aba176e26b2..27bccaf4b26 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/InstallDotNetCore.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/InstallDotNetCore.targets @@ -1,17 +1,13 @@ - - - + <_DotNetInstallScript>$(RepositoryEngineeringDir)common\dotnet-install.cmd <_DotNetInstallScript Condition="'$(OS)' != 'Windows_NT'">$(RepositoryEngineeringDir)common\dotnet-install.sh - + - + - - - true - - - - - + + + - @@ -132,8 +125,6 @@ - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishArtifactsInManifest.proj b/src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishArtifactsInManifest.proj similarity index 98% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishArtifactsInManifest.proj rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishArtifactsInManifest.proj index 1c09e11e205..e551d8cf8f3 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishArtifactsInManifest.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishArtifactsInManifest.proj @@ -75,14 +75,16 @@ --> - $(BundledNETCoreAppTargetFramework) Publish false - + + + + @@ -158,12 +160,7 @@ StreamingPublishingMaxClients="$(StreamingPublishingMaxClients)" NonStreamingPublishingMaxClients="$(NonStreamingPublishingMaxClients)" FeedKeys="@(FeedKey)" - FeedOverrides="@(FeedOverride)" - /> + FeedOverrides="@(FeedOverride)" /> - - - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishBuildAssets.proj b/src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishBuildAssets.proj similarity index 83% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishBuildAssets.proj rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishBuildAssets.proj index 851fbaaae10..67f34a5607a 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishBuildAssets.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishBuildAssets.proj @@ -13,18 +13,11 @@ true - - - - - - - $(BundledNETCoreAppTargetFramework) Publish - + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishSignedAssets.proj b/src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishSignedAssets.proj similarity index 96% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishSignedAssets.proj rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishSignedAssets.proj index 64464f4785c..668da283373 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishSignedAssets.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishSignedAssets.proj @@ -1,10 +1,5 @@ - - - Publish - $(BundledNETCoreAppTargetFramework) - + + Publish + + + + + + - - - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishToSymbolServers.proj b/src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishToSymbolServers.proj similarity index 95% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishToSymbolServers.proj rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishToSymbolServers.proj index a3e199b3ae5..ae826422510 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/PublishToSymbolServers.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/PublishToSymbolServers.proj @@ -18,10 +18,13 @@ --> - $(BundledNETCoreAppTargetFramework) Publish + + + + @@ -39,7 +42,7 @@ 3650 @@ -111,8 +114,4 @@ TreatPdbConversionIssuesAsInfo="$(TreatPdbConversionIssuesAsInfo)"/> - - - - diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Sign.proj b/src/Microsoft.DotNet.Arcade.Sdk/toolset/Sign.proj similarity index 85% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/Sign.proj rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/Sign.proj index 8049677420e..65e98c6ec8a 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Sign.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/Sign.proj @@ -1,5 +1,5 @@ - + - - - true - + + + - - - - + + + + + - - - - - + + + + <_RepoToolManifest>$([MSBuild]::NormalizePath('$(RepoRoot)', '.config', 'dotnet-tools.json')) + + + true + Restore + + + + + + + + + + + + + + --configfile "$(RestoreConfigFile)" + + + + + + + + + $(RepoRoot)eng/common/internal/Tools.csproj + $(RepoRoot)eng/common/internal/NuGet.config + + + + + + + + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/TrackPrebuiltUsage.targets b/src/Microsoft.DotNet.Arcade.Sdk/toolset/TrackPrebuiltUsage.targets similarity index 87% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/TrackPrebuiltUsage.targets rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/TrackPrebuiltUsage.targets index fc4578574cd..cd835109501 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/TrackPrebuiltUsage.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/TrackPrebuiltUsage.targets @@ -1,10 +1,9 @@ - - $(NuGetPackageRoot)microsoft.dotnet.sourcebuild.tasks\$(MicrosoftDotNetSourceBuildTasksVersion)\build\ - - + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.AcquireOptimizationData.targets b/src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.AcquireOptimizationData.targets similarity index 93% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.AcquireOptimizationData.targets rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.AcquireOptimizationData.targets index 33704816096..4159bf8f19f 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.AcquireOptimizationData.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.AcquireOptimizationData.targets @@ -9,12 +9,10 @@ Otherwise, the most recent drop of name that matches 'OptimizationData/$(VisualStudioIbcRepositoryName)/$(VisualStudioIbcSourceBranchName)/*' is used. VisualStudioIbcDrop The explicit drop to use. Overrides VisualStudioIbcSourceBranchName and VisualStudioIbcDropId --> - - - <_VisualStudioBuildTasksAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.visualstudio\$(MicrosoftDotNetBuildTasksVisualStudioVersion)\tools\net\Microsoft.DotNet.Build.Tasks.VisualStudio.dll - - - + + + + true diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.BuildIbcTrainingInputs.targets b/src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.BuildIbcTrainingInputs.targets similarity index 68% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.BuildIbcTrainingInputs.targets rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.BuildIbcTrainingInputs.targets index 39949cff687..cbdfb7189e0 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.BuildIbcTrainingInputs.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.BuildIbcTrainingInputs.targets @@ -6,13 +6,10 @@ RepositoryName Current repository name (e.g. 'dotnet/roslyn'). VisualStudioDropName Product drop name, e.g. 'Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)' --> - - - <_VisualStudioBuildTasksAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.visualstudio\$(MicrosoftDotNetBuildTasksVisualStudioVersion)\tools\net\Microsoft.DotNet.Build.Tasks.VisualStudio.dll - - - + + + - + - - - - <_VisualStudioBuildTasksAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.visualstudio\$(MicrosoftDotNetBuildTasksVisualStudioVersion)\tools\net\Microsoft.DotNet.Build.Tasks.VisualStudio.dll - - - + + + <_OutputFilePath>$(VisualStudioSetupInsertionPath)OptProf\Training.runsettings diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/VisualStudio.IbcTraining.runsettings b/src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.IbcTraining.runsettings similarity index 100% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/SdkTasks/VisualStudio.IbcTraining.runsettings rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.IbcTraining.runsettings diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.InsertionManifests.targets b/src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.InsertionManifests.targets similarity index 99% rename from src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.InsertionManifests.targets rename to src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.InsertionManifests.targets index e79964b9cd8..7c548d8d5b9 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/VisualStudio.InsertionManifests.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/toolset/VisualStudio.InsertionManifests.targets @@ -1,14 +1,15 @@ + + false + + <_StubFiles Include="$(VisualStudioSetupIntermediateOutputPath)**\*.stub"/> <_StubDirs Include="@(_StubFiles->'%(RecursiveDir)')"/> - - false - + + + + $(MSBuildThisFileDirectory)..\tools\net\Microsoft.DotNet.Build.Tasks.VisualStudio.dll + + + + + + + + + + + diff --git a/src/Microsoft.DotNet.NuGetRepack/tasks/build/Microsoft.DotNet.NuGetRepack.Tasks.props b/src/Microsoft.DotNet.NuGetRepack/tasks/build/Microsoft.DotNet.NuGetRepack.Tasks.props new file mode 100644 index 00000000000..45e612f79d3 --- /dev/null +++ b/src/Microsoft.DotNet.NuGetRepack/tasks/build/Microsoft.DotNet.NuGetRepack.Tasks.props @@ -0,0 +1,11 @@ + + + + + $(MSBuildThisFileDirectory)..\tools\net\Microsoft.DotNet.NuGetRepack.Tasks.dll + + + + + +