Fix the commit path message

上级 ecf0f584
......@@ -354,7 +354,7 @@ function Build-InsertionItems() {
function Build-NuGetPackages() {
function Pack-All([string]$packageKind) {
function Pack-All([string]$packageKind, $extraArgs) {
$packDir = Join-Path $nugetOutDir $packageKind
Create-Directory $packDir
......@@ -364,23 +364,30 @@ function Build-NuGetPackages() {
foreach ($item in Get-ChildItem *.nuspec) {
$name = Split-Path -leaf $item
Write-Host "`tPacking $name"
Exec-Command $dotnet "pack -nologo --no-build NuGetProjectPackUtil.csproj /p:EmptyDir=$emptyDir /p:NugetPackageKind=$packageKind /p:NuspecFile=$item /p:NuspecBasePath=$configDir -o $packDir" | Out-Null
Exec-Command $dotnet "pack -nologo --no-build NuGetProjectPackUtil.csproj $extraArgs /p:EmptyDir=$emptyDir /p:NugetPackageKind=$packageKind /p:NuspecFile=$item /p:NuspecBasePath=$configDir -o $packDir" | Out-Null
}
}
Push-Location (Join-Path $repoDir "src\NuGet")
try {
$nugetOutDir = Join-Path $configDir "NuGet"
$extraArgs = ""
Create-Directory $nugetOutDir
if ($restore) {
Exec-Command $dotnet "restore NuGetProjectPackUtil.csproj"
}
if ($official) {
$extraArgs += " /p:UseRealCommit=true"
}
# Empty directory for packing explicit empty items in the nuspec
$emptyDir = Join-Path ([IO.Path]::GetTempPath()) ([IO.Path]::GetRandomFileName())
Create-Directory $emptyDir
New-Item -Path (Join-Path $emptyDir "_._") -Type File | Out-Null
$extraArgs += " /p:EmptyDir:$emptyDir"
Pack-All "PreRelease"
if ($packAll) {
......
......@@ -14,6 +14,10 @@
<_Version Condition="'$(NuGetPackageKind)' == 'release'">$(NuGetReleaseVersion)</_Version>
<_Version Condition="'$(NuGetPackageKind)' == 'prerelease'">$(NuGetPreReleaseVersion)</_Version>
<_Version Condition="'$(NuGetPackageKind)' == 'perbuildprerelease'">$(NuGetPerBuildPreReleaseVersion)</_Version>
<_CommitPathMessage>This an unofficial build from a developer's machine</_CommitPathMessage>
<_CommitPathMessage Condition="'$(UseRealCommit)' == 'true'">This package was built from the source at https://github.com/dotnet/roslyn/commit/$(GitHeadSha)</_CommitPathMessage>
<TargetFramework>netcoreapp2.0</TargetFramework>
<DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>
<IncludeBuildOutput>false</IncludeBuildOutput>
......@@ -27,6 +31,7 @@
<NuspecProperties>$(NuspecProperties);additionalFilesPath=$(RepoRoot)build/NuGetAdditionalFiles</NuspecProperties>
<NuspecProperties>$(NuspecProperties);srcDirPath=$(RepoRoot)\src</NuspecProperties>
<NuspecProperties>$(NuspecProperties);emptyDirPath=$(EmptyDir)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);commitPathMessage=$(_CommitPathMessage)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);tags=Roslyn CodeAnalysis Compiler CSharp VB VisualBasic Parser Scanner Lexer Emit CodeGeneration Metadata IL Compilation Scripting Syntax Semantics</NuspecProperties>
<!-- The set of NuGet packages whose versions we need in the NuSpec file -->
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册