From 48b4d2a2e78798079f838079ec29366ccbc2f43e Mon Sep 17 00:00:00 2001
From: Medeni Baykal <433724+Haplois@users.noreply.github.com>
Date: Tue, 11 Jan 2022 15:23:33 +0100
Subject: [PATCH] Fixed manifest publishing
---
scripts/build.ps1 | 4 ++--
scripts/build/GenerateManifest.proj | 10 ++++++----
scripts/common.lib.ps1 | 3 ++-
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/scripts/build.ps1 b/scripts/build.ps1
index 56a5885e9d..259c6ba303 100644
--- a/scripts/build.ps1
+++ b/scripts/build.ps1
@@ -831,8 +831,7 @@ function Create-NugetPackages
$uap10Nuget = $testhostUapPackageDir
}
- Write-Verbose "$nugetExe pack $stagingDir\$file -OutputDirectory $packageOutputDir -Version $TPB_Version -Properties Version=$TPB_Version $additionalArgs"
- Invoke-Exe $nugetExe "pack $stagingDir\$file -OutputDirectory $packageOutputDir -Version $TPB_Version -Properties Version=$TPB_Version;JsonNetVersion=$JsonNetVersion;Runtime=$TPB_TargetRuntime;NetCoreTargetFramework=$TPB_TargetFrameworkCore20;FakesPackageDir=$FakesPackageDir;NetStandard10Framework=$TPB_TargetFrameworkNS10;NetStandard13Framework=$TPB_TargetFrameworkNS13;NetStandard20Framework=$TPB_TargetFrameworkNS20;Uap10Framework=$uap10Nuget;BranchName=$TPB_BRANCH;CommitId=$TPB_COMMIT $additionalArgs"
+ Invoke-Exe $nugetExe "pack $stagingDir\$file -OutputDirectory $packageOutputDir -Version $TPB_Version -Properties Version=$TPB_Version``;JsonNetVersion=$JsonNetVersion``;Runtime=$TPB_TargetRuntime``;NetCoreTargetFramework=$TPB_TargetFrameworkCore20``;FakesPackageDir=$FakesPackageDir``;NetStandard10Framework=$TPB_TargetFrameworkNS10``;NetStandard13Framework=$TPB_TargetFrameworkNS13``;NetStandard20Framework=$TPB_TargetFrameworkNS20``;Uap10Framework=$uap10Nuget``;BranchName=$TPB_BRANCH``;CommitId=$TPB_COMMIT $additionalArgs"
}
# Verifies that expected number of files gets shipped in nuget packages.
@@ -960,6 +959,7 @@ function Locate-MSBuildPath
Write-Verbose "found msbuild : '$($msbuildPath -join "','")'"
$msBuild = $msBuildPath | Select-Object -First 1
+
Write-Verbose "msbuildPath is : '$($msbuildPath -join "','")'"
if ($null -eq $msBuild -or 0 -eq $msBuild.Count) {
throw "MSBuild not found."
diff --git a/scripts/build/GenerateManifest.proj b/scripts/build/GenerateManifest.proj
index 1f62797d7b..6f80d79fb7 100644
--- a/scripts/build/GenerateManifest.proj
+++ b/scripts/build/GenerateManifest.proj
@@ -13,10 +13,12 @@
$(MicrosoftDotNetBuildTasksFeedFilePath)tools/net472/
$(MicrosoftDotNetBuildTasksFeedFilePath)tools/netcoreapp3.1/
- $(ArtifactsDir)\$(Configuration)\packages\
- $(PackagesPath)\
- $(PackagesPath)manifest\manifest.xml
- $(PackagesPath)*.nupkg
+ $(PackagesPath)
+ $(ArtifactsDir)\$(Configuration)\packages\
+ $(PackagesPathWithTrailingSlash)\
+
+ $(PackagesPathWithTrailingSlash)manifest\manifest.xml
+ $(PackagesPathWithTrailingSlash)*.nupkg
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
diff --git a/scripts/common.lib.ps1 b/scripts/common.lib.ps1
index 36a479c134..92de3c2f00 100644
--- a/scripts/common.lib.ps1
+++ b/scripts/common.lib.ps1
@@ -224,7 +224,8 @@ function Invoke-Exe {
[int[]] $IgnoreExitCode
)
Write-Verbose "Invoking: $Command $Arguments"
- & $Command ($Arguments -split ' ')
+ ([ScriptBlock]::Create("$Command $Arguments")).Invoke()
+
if ($IgnoreExitCode -notcontains $LASTEXITCODE) {
Set-ScriptFailedOnError -Command $Command -Arguments $Arguments
}