提交 60a80062 编写于 作者: J Jared Parsons

Use NuGet.exe for packing

The dotnet pack command can't handle nuspec files (or at least I can't
find the appropriate documentation for it). As such contining to use it
for creating NuGet packages for now.
上级 c28ae213
......@@ -107,6 +107,32 @@ function Exec-Script([string]$script, [string]$scriptArgs = "") {
Exec-Command "powershell" "-noprofile -executionPolicy RemoteSigned -file `"$script`" $scriptArgs"
}
# Ensure that NuGet is installed and return the path to the
# executable to use.
function Ensure-NuGet() {
$nugetVersion = Get-ToolVersion "nugetExe"
$toolsDir = Join-Path $binariesDir "Tools"
Create-Directory $toolsDir
$destFile = Join-Path $toolsDir "NuGet.exe"
$versionFile = Join-Path $toolsDir "NuGet.exe.version"
# Check and see if we already have a NuGet.exe which exists and is the correct
# version.
if ((Test-Path $destFile) -and (Test-Path $versionFile)) {
$scratchVersion = Get-Content $versionFile
if ($scratchVersion -eq $nugetVersion) {
return $destFile
}
}
Write-Host "Downloading NuGet.exe"
$webClient = New-Object -TypeName "System.Net.WebClient"
$webClient.DownloadFile("https://dist.nuget.org/win-x86-commandline/v$nugetVersion/NuGet.exe", $destFile)
$nugetVersion | Out-File $versionFile
return $destFile
}
# Ensure the proper SDK in installed in our %PATH%. This is how MSBuild locates the
# SDK. Returns the location to the dotnet exe
function Ensure-DotnetSdk() {
......
......@@ -179,7 +179,9 @@ function Make-BootstrapBuild() {
}
function Build-Artifacts() {
Run-MSBuild "Roslyn.sln" "/p:DeployExtension=false"
if ($build) {
Run-MSBuild "Roslyn.sln" "/p:DeployExtension=false"
}
if ($buildAll) {
Build-ExtraSignArtifacts
......@@ -281,6 +283,7 @@ function Build-NuGetPackages() {
$buildArgs = '/p:SkipReleaseVersion=true /p:SkipPreReleaseVersion=true'
}
Ensure-NuGet | Out-Null
Run-MSBuild "src\NuGet\NuGet.proj" $buildArgs
}
......@@ -625,7 +628,7 @@ try {
$bootstrapDir = Make-BootstrapBuild
}
if ($build) {
if ($build -or $pack) {
Build-Artifacts
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册