未验证 提交 8b688494 编写于 作者: J Jared Parsons 提交者: GitHub

Merge pull request #26099 from jaredpar/fix-pack

Move to dotnet pack
......@@ -142,6 +142,8 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "BasicAnalyzerDriver", "src\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILAsm", "src\Tools\ILAsm\ILAsm.csproj", "{46B3E63A-C462-4133-9F27-3B85DA5E7D37}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NuGetProjectPackUtil", "src\NuGet\NuGetProjectPackUtil.csproj", "{B2B261E8-56EC-45DC-8AB8-A491A065EFD4}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Compilers\Core\AnalyzerDriver\AnalyzerDriver.projitems*{1ee8cad3-55f9-4d91-96b2-084641da9a6c}*SharedItemsImports = 4
......@@ -385,6 +387,10 @@ Global
{46B3E63A-C462-4133-9F27-3B85DA5E7D37}.Debug|Any CPU.Build.0 = Debug|Any CPU
{46B3E63A-C462-4133-9F27-3B85DA5E7D37}.Release|Any CPU.ActiveCfg = Release|Any CPU
{46B3E63A-C462-4133-9F27-3B85DA5E7D37}.Release|Any CPU.Build.0 = Release|Any CPU
{B2B261E8-56EC-45DC-8AB8-A491A065EFD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2B261E8-56EC-45DC-8AB8-A491A065EFD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2B261E8-56EC-45DC-8AB8-A491A065EFD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2B261E8-56EC-45DC-8AB8-A491A065EFD4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -450,6 +456,7 @@ Global
{54E08BF5-F819-404F-A18D-0AB9EA81EA04} = {32A48625-F0AD-419D-828B-A50BDABA38EA}
{E8F0BAA5-7327-43D1-9A51-644E81AE55F1} = {C65C6143-BED3-46E6-869E-9F0BE6E84C37}
{46B3E63A-C462-4133-9F27-3B85DA5E7D37} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
{B2B261E8-56EC-45DC-8AB8-A491A065EFD4} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6F599E08-A9EA-4FAA-897F-5D824B0210E6}
......
......@@ -361,6 +361,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevDivPackagesDebugger", "s
EndProject
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "DevDivInsertionFiles", "src\Setup\DevDivInsertionFiles\DevDivInsertionFiles.vbproj", "{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NuGetProjectPackUtil", "src\NuGet\NuGetProjectPackUtil.csproj", "{B2B261E8-56EC-45DC-8AB8-A491A065EFD4}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4
......@@ -962,6 +964,10 @@ Global
{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67}.Release|Any CPU.Build.0 = Release|Any CPU
{B2B261E8-56EC-45DC-8AB8-A491A065EFD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2B261E8-56EC-45DC-8AB8-A491A065EFD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2B261E8-56EC-45DC-8AB8-A491A065EFD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2B261E8-56EC-45DC-8AB8-A491A065EFD4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......@@ -1133,6 +1139,7 @@ Global
{49E7C367-181B-499C-AC2E-8E17C81418D6} = {C2D1346B-9665-4150-B644-075CF1636BAA}
{18BDB5D5-340B-4834-B4FC-0327729A4A26} = {C2D1346B-9665-4150-B644-075CF1636BAA}
{5FE910A9-E7C9-40E1-AAF1-6C6C7DD61B67} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
{B2B261E8-56EC-45DC-8AB8-A491A065EFD4} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29}
......
......@@ -141,7 +141,7 @@ then
rm -rf ${bootstrap_path}
mkdir -p ${bootstrap_path}
dotnet pack src/NuGet/Bootstrap.csproj /p:NuspecBasePath=${binaries_path}/Debug -o ${bootstrap_path}
dotnet pack -nologo src/NuGet/NuGetProjectPackUtil.csproj -p:NuSpecFile=Microsoft.NETCore.Compilers.nuspec -p:NuGetPackageKind=Bootstrap -p:NuspecBasePath=${binaries_path}/Debug -o ${bootstrap_path}
mkdir -p ${bootstrap_path}/microsoft.netcore.compilers
unzip ${bootstrap_path}/Microsoft.NETCore.Compilers.42.42.42.42-bootstrap.nupkg -d ${bootstrap_path}/microsoft.netcore.compilers/42.42.42.42
chmod -R 755 ${bootstrap_path}/microsoft.netcore.compilers
......
......@@ -9,7 +9,6 @@
<PropertyGroup>
<dotnetRuntimeVersion>2.0.0</dotnetRuntimeVersion>
<dotnetSdkVersion>2.1.300-preview2-008324</dotnetSdkVersion>
<nugetExeVersion>4.3.0</nugetExeVersion>
<monoVersion>5.8.0.88</monoVersion>
<vsMinimumVersion>15.3</vsMinimumVersion>
</PropertyGroup>
......
@echo off
REM This is a script that will set environment information about where to find
REM NuGet.exe, it's version and ensure that it's present on the enlistment.
set NuGetExeFolder=%~dp0..\..\Binaries\Tools
set NuGetExe=%NuGetExeFolder%\NuGet.exe
set NuGetAdditionalCommandLineArgs=-verbosity quiet -configfile "%NuGetExeFolder%\nuget.config" -Project2ProjectTimeOut 1200
set-strictmode -version 2.0
$ErrorActionPreference="Stop"
& CMD /c "$PSScriptRoot\LoadNuGetInfo.cmd && set" | .{process{
if ($_ -match '^(NuGet[^=]+)=(.*)') {
Set-Variable $matches[1] $matches[2]
}
}}
......@@ -107,32 +107,6 @@ 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() {
......
......@@ -26,6 +26,7 @@ param (
[switch]$bootstrap = $false,
[switch]$sign = $false,
[switch]$pack = $false,
[switch]$packAll = $false,
[switch]$binaryLog = $false,
[switch]$noAnalyzers = $false,
[string]$signType = "",
......@@ -110,6 +111,9 @@ function Process-Arguments() {
exit 1
}
$script:pack = $pack -or $packAll
$script:packAll = $packAll -or ($pack -and $official)
if ($buildCoreClr) {
$script:build = $true
}
......@@ -214,13 +218,7 @@ function Make-BootstrapBuild() {
Run-MSBuild $projectFilePath "/t:Publish /p:TargetFramework=netcoreapp2.0 $bootstrapArgs" -logFileName $logFileName -useDotnetBuild
}
# The csi executable is only supported on desktop (even though we do multi-target it to
# netcoreapp2.). Need to build the desktop version here in order to build our NuGet
# packages below.
Run-MSBuild "src/Interactive/csi/csi.csproj" -logFileName "BootstrapCsi" -useDotnetBuild
Ensure-NuGet | Out-Null
Exec-Console "$configDir\Exes\csi\net46\csi.exe" "$repoDir\src\NuGet\BuildNuGets.csx $configDir 42.42.42.42-bootstrap $dir `"<developer build>`" Microsoft.NETCore.Compilers.nuspec"
Pack-One "Microsoft.NetCore.Compilers.nuspec" "Bootstrap" $dir
Unzip-File "$dir\Microsoft.NETCore.Compilers.42.42.42.42-bootstrap.nupkg" "$dir\Microsoft.NETCore.Compilers\42.42.42.42"
Write-Host "Cleaning Bootstrap compiler artifacts"
......@@ -232,8 +230,7 @@ function Make-BootstrapBuild() {
Remove-Item -re $dir -ErrorAction SilentlyContinue
Create-Directory $dir
Ensure-NuGet | Out-Null
Exec-Console "$configDir\Exes\csi\net46\csi.exe" "$repoDir\src\NuGet\BuildNuGets.csx $configDir 42.42.42.42-bootstrap $dir `"<developer build>`" Microsoft.Net.Compilers.nuspec"
Pack-One "Microsoft.Net.Compilers.nuspec" "Bootstrap" $dir
Unzip-File "$dir\Microsoft.Net.Compilers.42.42.42.42-bootstrap.nupkg" "$dir\Microsoft.Net.Compilers\42.42.42.42"
Write-Host "Cleaning Bootstrap compiler artifacts"
......@@ -274,7 +271,6 @@ function Build-Artifacts() {
# finish building these before we can run signing.
function Build-ExtraSignArtifacts() {
Ensure-NuGet | Out-Null
Push-Location (Join-Path $repoDir "src\Setup")
try {
# Publish the CoreClr projects (CscCore and VbcCore) and dependencies for later NuGet packaging.
......@@ -337,25 +333,86 @@ function Build-InsertionItems() {
$extraArgs = " /p:FinalizeValidate=false /p:ManifestPublishUrl=https://vsdrop.corp.microsoft.com/file/v1/Products/DevDiv/dotnet/roslyn/master/20160729.6"
}
Run-MSBuild "DevDivPackages\Roslyn.proj" -logFileName "RoslynPackagesProj"
$insertionDir = Join-Path $configDir "DevDivInsertionFiles"
$vsToolsDir = Join-Path $insertionDir "VS.Tools.Roslyn"
$packageOutDir = Join-Path $configDir "DevDivPackages\Roslyn"
$packArgs = "/p:NoPackageAnalysis=true"
Create-Directory $packageOutDir
Pack-One (Join-Path $insertionDir "VS.ExternalAPIs.Roslyn.nuspec") "PerBuildPreRelease" $packageOutDir $packArgs
Pack-One (Join-Path $vsToolsDir "VS.Tools.Roslyn.nuspec") "PerBuildPreRelease" $packageOutDir $packArgs -basePath $vsToolsDir
$netfx20Dir = Join-Path $repoDir "src\Dependencies\Microsoft.NetFX20"
Pack-One (Join-Path $netfx20Dir "Microsoft.NetFX20.nuspec") "PerBuildPreRelease" -packageOutDir (Join-Path $configDir "NuGet\NetFX20") -basePath $netfx20Dir -extraArgs "$packArgs /p:CurrentVersion=4.3.0"
Run-MSBuild "DevDivVsix\PortableFacades\PortableFacades.vsmanproj" -buildArgs $extraArgs
Run-MSBuild "DevDivVsix\CompilersPackage\Microsoft.CodeAnalysis.Compilers.vsmanproj" -buildArgs $extraArgs
Run-MSBuild "DevDivVsix\MicrosoftCodeAnalysisLanguageServices\Microsoft.CodeAnalysis.LanguageServices.vsmanproj" -buildArgs "$extraArgs"
Run-MSBuild "..\Dependencies\Microsoft.NetFX20\Microsoft.NetFX20.nuget.proj"
}
finally {
Pop-Location
}
}
function Pack-One([string]$nuspecFilePath, [string]$packageKind, [string]$packageOutDir = "", [string]$extraArgs = "", [string]$basePath = "", [switch]$useConsole = $true) {
$nugetDir = Join-Path $repoDir "src\Nuget"
if ($packageOutDir -eq "") {
$packageOutDir = Join-Path $configDir "NuGet\$packageKind"
}
if ($basePath -eq "") {
$basePath = $configDir
}
if (-not ([IO.Path]::IsPathRooted($nuspecFilePath))) {
$nuspecFilePath = Join-Path $nugetDir $nuspecFilePath
}
Create-Directory $packageOutDir
$nuspecFileName = Split-Path -leaf $nuspecFilePath
$projectFilePath = Join-Path $nugetDir "NuGetProjectPackUtil.csproj"
$packArgs = "pack -nologo --no-build $projectFilePath $extraArgs /p:NugetPackageKind=$packageKind /p:NuspecFile=$nuspecFilePath /p:NuspecBasePath=$basePath -o $packageOutDir"
if ($useConsole) {
Exec-Console $dotnet $packArgs
}
else {
Exec-Command $dotnet $packArgs
}
}
function Build-NuGetPackages() {
$buildArgs = ""
if (-not $official) {
$buildArgs = '/p:SkipReleaseVersion=true /p:SkipPreReleaseVersion=true'
function Pack-All([string]$packageKind, $extraArgs) {
Write-Host "Packing for $packageKind"
foreach ($item in Get-ChildItem *.nuspec) {
$name = Split-Path -leaf $item
Pack-One $name $packageKind -extraArgs $extraArgs
}
}
Ensure-NuGet | Out-Null
Run-MSBuild "src\NuGet\NuGet.proj" $buildArgs
Push-Location (Join-Path $repoDir "src\NuGet")
try {
$extraArgs = ""
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" $extraArgs
if ($packAll) {
Pack-All "Release" $extraArgs
Pack-All "PerBuildPreRelease" $extraArgs
}
}
finally {
Pop-Location
}
}
function Build-DeployToSymStore() {
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Version.targets" />
<Import Project="..\..\..\build\Targets\Settings.props" />
<ItemGroup Label="Redist">
<NuSpec Include="Microsoft.NetFX20.nuspec" />
</ItemGroup>
<Target Name="Build" Inputs="@(NuSpec)" Outputs="@(NuSpec -> NuGet\$(NuGetVersionType)\%(Identity).$(NuGetVersion).nupkg">
<PropertyGroup>
<NuGetArguments>-prop currentVersion="$(NuGetVersion)"</NuGetArguments>
<NuGetOutDir>$(OutDir)NuGet\$(NuGetVersionType)</NuGetOutDir>
</PropertyGroup>
<!-- clean our output directory -->
<MakeDir Directories="$(NuGetOutDir)" Condition="!Exists('$(NuGetOutDir)')" />
<!-- copy any extra content files (like EULAs) that we need to include -->
<Copy SourceFiles="@(Content)" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
<!-- package! -->
<Exec Command="..\..\..\Binaries\Tools\NuGet Pack %(NuSpec.Identity) -OutputDirectory $(NuGetOutDir) $(NuGetArguments)" />
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(OutDir)NuGet" />
</Target>
</Project>
......@@ -10,7 +10,7 @@ Supported Platforms:
</description>
<language>en-US</language>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$currentVersion$</version>
<version>$version$</version>
<authors>Microsoft</authors>
<licenseUrl>http://go.microsoft.com/fwlink/?LinkId=394369</licenseUrl>
<projectUrl>http://msdn.com/roslyn</projectUrl>
......
<Project Sdk="Microsoft.NET.Sdk">
<!--
This project file is used to create the Microsoft.NetCore.Compilers NuPkg on
Unix platforms during our bootstrap phase. This is a very temporary solution. Longer
term we are moving all of our packaging code to use `dotnet pack` at which point
this will simply be folded into that work.
https://github.com/dotnet/roslyn/issues/25439 -->
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<NuspecFile>Microsoft.NETCore.Compilers.nuspec</NuspecFile>
<DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>
<NuspecProperties>$(NuspecProperties);version=42.42.42.42-bootstrap</NuspecProperties>
<NuspecProperties>$(NuspecProperties);authors=Microsoft</NuspecProperties>
<NuspecProperties>$(NuspecProperties);licenseUrl=http://go.microsoft.com/fwlink/?LinkId=529443</NuspecProperties>
<NuspecProperties>$(NuspecProperties);projectUrl=https://github.com/dotnet/roslyn</NuspecProperties>
<NuspecProperties>$(NuspecProperties);additionalFilesPath=$(RepoRoot)build/NuGetAdditionalFiles</NuspecProperties>
</PropertyGroup>
</Project>
#r "System.Xml.XDocument.dll"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml.Linq;
string usage = @"usage: BuildNuGets.csx <binaries-dir> <build-version> <output-directory> <git sha> [<filter>]";
if (Args.Count < 4 || Args.Count > 5)
{
Console.WriteLine(usage);
Environment.Exit(1);
}
var SolutionRoot = Path.GetFullPath(Path.Combine(ScriptRoot(), "..", ".."));
var ToolsetPath = Path.Combine(SolutionRoot, "Binaries", "toolset");
string ScriptRoot([CallerFilePath]string path = "") => Path.GetDirectoryName(path);
#region Config Variables
// Strip trailing '\' characters because if the path is later passed on the
// command line when surrounded by quotes (in case the path has spaces) some
// utilities will consider the '\"' as an escape sequence for the end quote
var BinDir = Path.GetFullPath(Args[0]).TrimEnd('\\');
var BuildVersion = Args[1].Trim();
var BuildingReleaseNugets = IsReleaseVersion(BuildVersion);
var NuspecDirPath = Path.Combine(SolutionRoot, "src/NuGet");
var OutDir = Path.GetFullPath(Args[2]).TrimEnd('\\');
var CommitSha = Args[3];
var CommitIsDeveloperBuild = CommitSha == "<developer build>";
if (!CommitIsDeveloperBuild && !Regex.IsMatch(CommitSha, "[A-Fa-f0-9]+"))
{
Console.WriteLine("Invalid Git sha value: expected <developer build> or a valid sha");
Environment.Exit(1);
}
var CommitPathMessage = CommitIsDeveloperBuild
? "This an unofficial build from a developer's machine"
: $"This package was built from the source at https://github.com/dotnet/roslyn/commit/{CommitSha}";
var NuspecNameFilter = Args.Count > 4 ? Args[4] : null;
var LicenseUrlRedist = @"http://go.microsoft.com/fwlink/?LinkId=529443";
var LicenseUrlNonRedist = @"http://go.microsoft.com/fwlink/?LinkId=529444";
var LicenseUrlTest = @"http://go.microsoft.com/fwlink/?LinkId=529445";
var LicenseUrlSource = @"https://github.com/dotnet/roslyn/blob/master/License.txt";
var Authors = @"Microsoft";
var ProjectURL = @"http://msdn.com/roslyn";
var Tags = @"Roslyn CodeAnalysis Compiler CSharp VB VisualBasic Parser Scanner Lexer Emit CodeGeneration Metadata IL Compilation Scripting Syntax Semantics";
// Read preceding variables from MSBuild file
var packagesDoc = XDocument.Load(Path.Combine(SolutionRoot, "build/Targets/Packages.props"));
var fixedPackagesDoc = XDocument.Load(Path.Combine(SolutionRoot, "build/Targets/FixedPackages.props"));
XNamespace ns = @"http://schemas.microsoft.com/developer/msbuild/2003";
var dependencyVersions = from e in packagesDoc.Root.Descendants().Concat(fixedPackagesDoc.Root.Descendants())
where e.Name.LocalName.EndsWith("Version")
select new { VariableName = e.Name.LocalName, Value=e.Value };
string GetExistingPackageVersion(string name)
{
if (!Directory.Exists(OutDir))
{
return null;
}
foreach (var file in Directory.GetFiles(OutDir, "*.nupkg"))
{
string packageNameAndVersion = Path.GetFileNameWithoutExtension(file);
string packageName = string.Join(".", packageNameAndVersion.Split('.').TakeWhile(s => !char.IsNumber(s[0])));
if (packageName == name)
{
return packageNameAndVersion.Substring(packageName.Length + 1);
}
}
return null;
}
var IsCoreBuild = File.Exists(Path.Combine(ToolsetPath, "corerun"));
#endregion
var NuGetAdditionalFilesPath = Path.Combine(SolutionRoot, "build/NuGetAdditionalFiles");
var SrcDirPath = Path.Combine(SolutionRoot, "src");
string[] RedistPackageNames = {
"Microsoft.CodeAnalysis",
"Microsoft.CodeAnalysis.Build.Tasks",
"Microsoft.CodeAnalysis.Common",
"Microsoft.CodeAnalysis.Compilers",
"Microsoft.CodeAnalysis.CSharp.Features",
"Microsoft.CodeAnalysis.CSharp",
"Microsoft.CodeAnalysis.CSharp.CodeStyle",
"Microsoft.CodeAnalysis.CSharp.Scripting",
"Microsoft.CodeAnalysis.CSharp.Workspaces",
"Microsoft.CodeAnalysis.EditorFeatures",
"Microsoft.CodeAnalysis.EditorFeatures.Text",
"Microsoft.CodeAnalysis.Features",
"Microsoft.CodeAnalysis.Remote.ServiceHub",
"Microsoft.CodeAnalysis.Remote.Workspaces",
"Microsoft.CodeAnalysis.Scripting.Common",
"Microsoft.CodeAnalysis.Scripting",
"Microsoft.CodeAnalysis.VisualBasic.Features",
"Microsoft.CodeAnalysis.VisualBasic",
"Microsoft.CodeAnalysis.VisualBasic.CodeStyle",
"Microsoft.CodeAnalysis.VisualBasic.Scripting",
"Microsoft.CodeAnalysis.VisualBasic.Workspaces",
"Microsoft.CodeAnalysis.Workspaces.Common",
"Microsoft.VisualStudio.LanguageServices",
};
string[] SourcePackageNames = {
"Microsoft.CodeAnalysis.PooledObjects",
"Microsoft.CodeAnalysis.Debugging",
};
string[] NonRedistPackageNames = {
"Microsoft.CodeAnalysis.Remote.Razor.ServiceHub",
"Microsoft.Net.Compilers",
"Microsoft.Net.Compilers.netcore",
"Microsoft.Net.CSharp.Interactive.netcore",
"Microsoft.NETCore.Compilers",
"Microsoft.VisualStudio.IntegrationTest.Utilities",
"Microsoft.VisualStudio.LanguageServices.Razor.RemoteClient",
// Right now there is no public surface area in this assembly, and the expectation is it will be able to go away
// as the editor continues to refactor its surface area better.
"Microsoft.CodeAnalysis.EditorFeatures.Wpf"
};
string[] TestPackageNames = {
};
// The following packages will only be published on myget not on nuget
// Packages listed here must also appear in RedistPackageNames (above)
// or they will not be published anywhere at all
var PreReleaseOnlyPackages = new HashSet<string>
{
// Contains the compiler build task, but Microsoft.NET.Compilers
// should be preferred. Used to construct a standalone compiler for
// dotnet CLI.
"Microsoft.CodeAnalysis.Build.Tasks",
"Microsoft.CodeAnalysis.CSharp.CodeStyle",
"Microsoft.CodeAnalysis.VisualBasic.CodeStyle",
"Microsoft.CodeAnalysis.VisualBasic.Scripting",
// Only contains exes. Only used for insertion into dotnet CLI
"Microsoft.Net.Compilers.netcore",
// C# Interactive on CoreCLR is pre-release
"Microsoft.Net.CSharp.Interactive.netcore",
"Microsoft.CodeAnalysis.Remote.Razor.ServiceHub",
"Microsoft.CodeAnalysis.Remote.ServiceHub",
"Microsoft.CodeAnalysis.Remote.Workspaces",
// Only used in Roslyn testing code
"Microsoft.CodeAnalysis.Test.Resources.Proprietary",
"Microsoft.VisualStudio.IntegrationTest.Utilities",
"Microsoft.VisualStudio.LanguageServices.Razor.RemoteClient",
"Microsoft.CodeAnalysis.PooledObjects",
"Microsoft.CodeAnalysis.Debugging",
};
// The assets for these packages are not produced when building on Unix
// and we don't want to attempt to package them when building packages.
var PackagesNotBuiltOnCore = new HashSet<string>
{
"Microsoft.CodeAnalysis.CSharp.Features",
"Microsoft.CodeAnalysis.EditorFeatures",
"Microsoft.CodeAnalysis.EditorFeatures.Text",
"Microsoft.CodeAnalysis.Features",
"Microsoft.CodeAnalysis.Remote.Razor.ServiceHub",
"Microsoft.CodeAnalysis.Remote.ServiceHub",
"Microsoft.CodeAnalysis.Remote.Workspaces",
"Microsoft.CodeAnalysis.VisualBasic.Features",
"Microsoft.CodeAnalysis.Workspaces.Common",
"Microsoft.Net.Compilers",
"Microsoft.VisualStudio.IntegrationTest.Utilities",
"Microsoft.VisualStudio.LanguageServices",
"Microsoft.VisualStudio.LanguageServices.Razor.RemoteClient",
"Roslyn.VisualStudio.Test.Utilities",
};
// Create an empty directory to be used in NuGet pack
var emptyDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
var dirInfo = Directory.CreateDirectory(emptyDir);
File.Create(Path.Combine(emptyDir, "_._")).Close();
var errors = new List<string>();
void ReportError(string message)
{
errors.Add(message);
PrintError(message);
}
void PrintError(string message)
{
var color = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Red;
Console.Error.WriteLine(message);
Console.ForegroundColor = color;
}
string GetPackageVersion(string packageName)
{
// HACK: since Microsoft.Net.Compilers 2.0.0 was uploaded by accident and later deleted, we must bump the minor.
// We will do this to both the regular Microsoft.Net.Compilers package and also the netcore package to keep them
// in sync.
if (BuildVersion.StartsWith("2.0.") && packageName.StartsWith("Microsoft.Net.Compilers", StringComparison.OrdinalIgnoreCase))
{
string[] buildVersionParts = BuildVersion.Split('-');
string[] buildVersionBaseParts = buildVersionParts[0].Split('.');
buildVersionBaseParts[buildVersionBaseParts.Length - 1] =
(int.Parse(buildVersionBaseParts[buildVersionBaseParts.Length - 1]) + 1).ToString();
buildVersionParts[0] = string.Join(".", buildVersionBaseParts);
return string.Join("-", buildVersionParts);
}
return BuildVersion;
}
int PackFiles(string[] nuspecFiles, string licenseUrl)
{
var commonProperties = new Dictionary<string, string>()
{
{ "licenseUrl", licenseUrl },
{ "version", BuildVersion },
{ "authors", Authors },
{ "projectURL", ProjectURL },
{ "tags", Tags },
{ "emptyDirPath", emptyDir },
{ "additionalFilesPath", NuGetAdditionalFilesPath },
{ "commitPathMessage", CommitPathMessage },
{ "srcDirPath", SrcDirPath }
};
foreach (var dependencyVersion in dependencyVersions)
{
commonProperties[dependencyVersion.VariableName] = dependencyVersion.Value;
}
string commonArgs;
if (!IsCoreBuild)
{
// The -NoPackageAnalysis argument is to work around the following issue. The warning output of
// NuGet gets promoted to an error by MSBuild /warnaserror
// https://github.com/dotnet/roslyn/issues/18152
commonArgs = $"-BasePath \"{BinDir}\" " +
$"-OutputDirectory \"{OutDir}\" " +
$"-NoPackageAnalysis " +
string.Join(" ", commonProperties.Select(p => $"-prop {p.Key}=\"{p.Value}\""));
}
else
{
commonArgs = $"--base-path \"{BinDir}\" " +
$"--output-directory \"{OutDir}\" " +
$"--properties \"{string.Join(";", commonProperties.Select(p => $"{p.Key}={p.Value}"))}\"";
}
int exit = 0;
foreach (var file in nuspecFiles)
{
if (NuspecNameFilter != null && !file.Contains(NuspecNameFilter))
{
continue;
}
var p = new Process();
if (!IsCoreBuild)
{
string packageArgs = commonArgs.Replace($"-prop version=\"{BuildVersion}\"", $"-prop version=\"{GetPackageVersion(Path.GetFileNameWithoutExtension(file))}\"");
p.StartInfo.FileName = Path.GetFullPath(Path.Combine(SolutionRoot, @"Binaries\Tools\nuget.exe"));
p.StartInfo.Arguments = $@"pack {file} {packageArgs}";
}
else
{
p.StartInfo.FileName = Path.Combine(ToolsetPath, "corerun");
p.StartInfo.Arguments = $@"{Path.Combine(ToolsetPath, "NuGet.CommandLine.XPlat.dll")} pack {file} {commonArgs}";
}
p.StartInfo.UseShellExecute = false;
Console.WriteLine($"Packing {file}");
p.Start();
p.WaitForExit();
var currentExit = p.ExitCode;
if (currentExit != 0)
{
Console.WriteLine($"nuget pack {p.StartInfo.Arguments}");
ReportError($"Pack operation failed with {currentExit}");
}
// We want to try and generate all nugets and log any errors encountered along the way.
// We also want to fail the build in case of all encountered errors except the prerelease package dependency error above.
exit = (exit == 0) ? currentExit : exit;
}
return exit;
}
XElement MakePackageElement(string packageName, string version)
{
return new XElement("package", new XAttribute("id", packageName), new XAttribute("version", version));
}
IEnumerable<XElement> MakeRoslynPackageElements(string[] roslynPackageNames)
{
return roslynPackageNames.Select(packageName => MakePackageElement(packageName, GetPackageVersion(packageName)));
}
void GeneratePublishingConfig(string fileName, IEnumerable<XElement> packages)
{
var doc = new XDocument(new XElement("packages", packages.ToArray()));
using (FileStream fs = File.OpenWrite(Path.Combine(OutDir, fileName)))
{
doc.Save(fs);
}
}
void GeneratePublishingConfig(string[] roslynPackageNames)
{
var packages = MakeRoslynPackageElements(roslynPackageNames);
if (BuildingReleaseNugets)
{
// nuget:
GeneratePublishingConfig("nuget_org-packages.config", packages);
}
else
{
// myget:
GeneratePublishingConfig("myget_org-packages.config", packages);
}
}
string[] GetRoslynPackageNames(string[] packages)
{
IEnumerable<string> packageNames = packages;
if (BuildingReleaseNugets)
{
packageNames = packageNames.Where(pn => !PreReleaseOnlyPackages.Contains(pn));
}
if (IsCoreBuild)
{
packageNames = packageNames.Where(pn => !PackagesNotBuiltOnCore.Contains(pn));
}
return packageNames.ToArray();
}
int DoWork(string[] packageNames, string licenseUrl)
{
var roslynPackageNames = GetRoslynPackageNames(packageNames);
string[] roslynNuspecFiles = roslynPackageNames.Select(f => Path.Combine(NuspecDirPath, f + ".nuspec")).ToArray();
return PackFiles(roslynNuspecFiles, licenseUrl);
}
bool IsReleaseVersion(string version) => !version.Contains('-');
Directory.CreateDirectory(OutDir);
var ErrorLogFile = Path.Combine(OutDir, "skipped_packages.txt");
try
{
if (File.Exists(ErrorLogFile)) File.Delete(ErrorLogFile);
}
catch
{
// Ignore errors
}
int exit = DoWork(RedistPackageNames, LicenseUrlRedist);
exit |= DoWork(NonRedistPackageNames, LicenseUrlNonRedist);
exit |= DoWork(TestPackageNames, LicenseUrlTest);
exit |= DoWork(SourcePackageNames, LicenseUrlSource);
var allPackageNames = RedistPackageNames.Concat(NonRedistPackageNames).Concat(TestPackageNames).Concat(SourcePackageNames).ToArray();
var roslynPackageNames = GetRoslynPackageNames(allPackageNames);
GeneratePublishingConfig(roslynPackageNames);
try
{
dirInfo.Delete(recursive: true);
}
catch
{
// Ignore errors
}
foreach (var error in errors)
{
PrintError(error);
}
Environment.Exit(exit);
......@@ -35,7 +35,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -19,7 +19,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -21,7 +21,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -16,7 +16,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -21,7 +21,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -20,7 +20,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -62,7 +62,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -23,7 +23,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlNonRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -16,7 +16,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlSource$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -23,7 +23,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -23,7 +23,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlNonRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -24,7 +24,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -20,7 +20,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -16,7 +16,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlSource$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -23,7 +23,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlNonRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -24,7 +24,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -26,7 +26,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -18,7 +18,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -21,7 +21,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -19,7 +19,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -21,7 +21,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -17,7 +17,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -21,7 +21,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -20,7 +20,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -33,7 +33,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -28,7 +28,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -16,7 +16,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlNonRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<tags>$tags$</tags>
<serviceable>true</serviceable>
......
......@@ -19,7 +19,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlNonRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<tags>$tags$</tags>
<dependencies>
......
......@@ -16,7 +16,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlNonRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<tags>$tags$</tags>
<serviceable>true</serviceable>
......
......@@ -19,7 +19,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlNonRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -16,7 +16,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlNonRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -23,7 +23,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlNonRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
......@@ -23,7 +23,7 @@
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<version>$version$</version>
<authors>$authors$</authors>
<licenseUrl>$licenseUrl$</licenseUrl>
<licenseUrl>$licenseUrlNonRedist$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<releaseNotes>$releaseNotes$</releaseNotes>
<tags>$tags$</tags>
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\build\Targets\Settings.props" />
<Target Name="Build">
<!-- NuGetPerBuildPreReleaseVersion -->
<Exec Command="$(OutputPath)Exes\csi\net46\csi.exe $(MSBuildThisFileDirectory)BuildNuGets.csx $(OutputPath) $(NuGetPerBuildPreReleaseVersion) $(OutputPath)NuGet\PerBuildPreRelease &quot;$(CommitHashDisplay)&quot;" Condition="'$(SkipBuildPreReleaseVersion)' != 'true'" />
<!-- NuGetPreReleaseVersion -->
<Exec Command="$(OutputPath)Exes\csi\net46\csi.exe $(MSBuildThisFileDirectory)BuildNuGets.csx $(OutputPath) $(NuGetPreReleaseVersion) $(OutputPath)NuGet\PreRelease &quot;$(CommitHashDisplay)&quot;" Condition="'$(SkipPreReleaseVersion)' != 'true'" />
<!-- NuGetReleaseVersion -->
<Exec Command="$(OutputPath)Exes\csi\net46\csi.exe $(MSBuildThisFileDirectory)BuildNuGets.csx $(OutputPath) $(NuGetReleaseVersion) $(OutputPath)NuGet\Release &quot;$(CommitHashDisplay)&quot;" Condition="'$(SkipReleaseVersion)' != 'true'" />
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(OutputPath)NuGet" />
</Target>
<Target Name="Rebuild" DependsOnTargets="Clean;Build">
</Target>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<!--
This project file is used to create the Microsoft.NetCore.Compilers NuPkg on
Unix platforms during our bootstrap phase. This is a very temporary solution. Longer
term we are moving all of our packaging code to use `dotnet pack` at which point
this will simply be folded into that work.
https://github.com/dotnet/roslyn/issues/25439
https://github.com/NuGet/Home/issues/4254
-->
<PropertyGroup>
<_Version></_Version>
<_Version Condition="'$(NuGetPackageKind)' == 'release'">$(NuGetReleaseVersion)</_Version>
<_Version Condition="'$(NuGetPackageKind)' == 'prerelease'">$(NuGetPreReleaseVersion)</_Version>
<_Version Condition="'$(NuGetPackageKind)' == 'perbuildprerelease'">$(NuGetPerBuildPreReleaseVersion)</_Version>
<_Version Condition="'$(NuGetPackageKind)' == 'bootstrap'">42.42.42.42-bootstrap</_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>
<OutputType>Library</OutputType>
<IncludeBuildOutput>false</IncludeBuildOutput>
<NuspecFile></NuspecFile>
<NuspecProperties>$(NuspecProperties);version=$(_Version)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);authors=Microsoft</NuspecProperties>
<NuspecProperties>$(NuspecProperties);licenseUrlRedist=http://go.microsoft.com/fwlink/?LinkId=529443</NuspecProperties>
<NuspecProperties>$(NuspecProperties);licenseUrlNonRedist=http://go.microsoft.com/fwlink/?LinkId=529444</NuspecProperties>
<NuspecProperties>$(NuspecProperties);licenseUrlSource=https://github.com/dotnet/roslyn/blob/master/License.txt</NuspecProperties>
<NuspecProperties>$(NuspecProperties);projectUrl=https://github.com/dotnet/roslyn</NuspecProperties>
<NuspecProperties>$(NuspecProperties);additionalFilesPath=$(RepoRoot)build/NuGetAdditionalFiles</NuspecProperties>
<NuspecProperties>$(NuspecProperties);srcDirPath=$(RepoRoot)\src</NuspecProperties>
<NuspecProperties Condition="'$(EmptyDir)' != ''">$(NuspecProperties);emptyDirPath=$(EmptyDir)</NuspecProperties>
<NuspecProperties Condition="'$(CurrentVersion)' != ''">$(NuspecProperties);currentVersion=$(CurrentVersion)</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 -->
<NuspecProperties>$(NuspecProperties);MicrosoftBuildFixedVersion=$(MicrosoftBuildFixedVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);MicrosoftBuildTasksCoreFixedVersion=$(MicrosoftBuildTasksCoreFixedVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);MicrosoftCSharpVersion=$(MicrosoftCSharpVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);MicrosoftCodeAnalysisAnalyzersVersion=$(MicrosoftCodeAnalysisAnalyzersVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);MicrosoftCodeAnalysisElfieVersion=$(MicrosoftCodeAnalysisElfieVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);MicrosoftVisualBasicVersion=$(MicrosoftVisualBasicVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);MicrosoftVisualStudioSetupConfigurationInteropVersion=$(MicrosoftVisualStudioSetupConfigurationInteropVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemAppContextVersion=$(SystemAppContextVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemCollectionsVersion=$(SystemCollectionsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemCollectionsConcurrentVersion=$(SystemCollectionsConcurrentVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemCollectionsImmutableVersion=$(SystemCollectionsImmutableVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemCompositionVersion=$(SystemCompositionVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemConsoleVersion=$(SystemConsoleVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemDiagnosticsContractsVersion=$(SystemDiagnosticsContractsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemDiagnosticsDebugVersion=$(SystemDiagnosticsDebugVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemDiagnosticsFileVersionInfoVersion=$(SystemDiagnosticsFileVersionInfoVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemDiagnosticsProcessVersion=$(SystemDiagnosticsProcessVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemDiagnosticsStackTraceVersion=$(SystemDiagnosticsStackTraceVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemDiagnosticsToolsVersion=$(SystemDiagnosticsToolsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemDynamicRuntimeVersion=$(SystemDynamicRuntimeVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemGlobalizationVersion=$(SystemGlobalizationVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemIOVersion=$(SystemIOVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemIOCompressionVersion=$(SystemIOCompressionVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemIOFileSystemVersion=$(SystemIOFileSystemVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemIOFileSystemPrimitivesVersion=$(SystemIOFileSystemPrimitivesVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemIOPipesAccessControlVersion=$(SystemIOPipesAccessControlVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemLinqVersion=$(SystemLinqVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemLinqExpressionsVersion=$(SystemLinqExpressionsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemLinqParallelVersion=$(SystemLinqParallelVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemNetSocketsVersion=$(SystemNetSocketsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemObjectModelVersion=$(SystemObjectModelVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemReflectionVersion=$(SystemReflectionVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemReflectionExtensionsVersion=$(SystemReflectionExtensionsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemReflectionMetadataVersion=$(SystemReflectionMetadataVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemResourcesResourceManagerVersion=$(SystemResourcesResourceManagerVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemRuntimeVersion=$(SystemRuntimeVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemRuntimeExtensionsVersion=$(SystemRuntimeExtensionsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemRuntimeLoaderVersion=$(SystemRuntimeLoaderVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemRuntimeInteropServicesVersion=$(SystemRuntimeInteropServicesVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemRuntimeNumericsVersion=$(SystemRuntimeNumericsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemSecurityAccessControlVersion=$(SystemSecurityAccessControlVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemSecurityCryptographyAlgorithmsVersion=$(SystemSecurityCryptographyAlgorithmsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemSecurityCryptographyEncodingVersion=$(SystemSecurityCryptographyEncodingVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemSecurityCryptographyX509CertificatesVersion=$(SystemSecurityCryptographyX509CertificatesVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemTextEncodingVersion=$(SystemTextEncodingVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemTextEncodingCodePagesVersion=$(SystemTextEncodingCodePagesVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemTextEncodingExtensionsVersion=$(SystemTextEncodingExtensionsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemTextRegularExpressionsVersion=$(SystemTextRegularExpressionsVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemThreadingVersion=$(SystemThreadingVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemThreadingTasksVersion=$(SystemThreadingTasksVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemThreadingTasksParallelVersion=$(SystemThreadingTasksParallelVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemThreadingThreadVersion=$(SystemThreadingThreadVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemValueTupleVersion=$(SystemValueTupleVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemXmlReaderWriterVersion=$(SystemXmlReaderWriterVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemXmlXDocumentVersion=$(SystemXmlXDocumentVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemXmlXmlDocumentVersion=$(SystemXmlXmlDocumentVersion)</NuspecProperties>
<NuspecProperties>$(NuspecProperties);SystemXmlXPathXDocumentVersion=$(SystemXmlXPathXDocumentVersion)</NuspecProperties>
</PropertyGroup>
</Project>
@echo on
@setlocal
set PACK_FILENAME=%1
set PACK_VERSION=%2
set BASE_DIR=%3
set OUT_DIR=%4
REM Get the information about NuGet.exe
call "%~dp0..\..\..\build\scripts\LoadNuGetInfo.cmd"
call %NugetExe% pack %PACK_FILENAME% -Version %PACK_VERSION% -BasePath %BASE_DIR% -OutputDirectory %OUT_DIR% -NoPackageAnalysis
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\build\Targets\Settings.props" />
<PropertyGroup>
<InsertionFilesDir>$(OutputPath)\DevDivInsertionFiles</InsertionFilesDir>
<VsToolsetDir>$(InsertionFilesDir)\VS.Tools.Roslyn</VsToolsetDir>
<PackagesOutDir>$(OutputPath)\DevDivPackages\Roslyn</PackagesOutDir>
</PropertyGroup>
<ItemGroup>
<NuSpec Include="$(InsertionFilesDir)\VS.ExternalAPIs.Roslyn.nuspec">
<Version>$(NuGetPerBuildPreReleaseVersion)</Version>
<!-- TFS build number isn't set on CI server -->
<Version Condition="'$(NuGetPerBuildPreReleaseVersion)' == ''">$(NuGetReleaseVersion)-cibuild</Version>
<BaseDir>$(OutputPath)</BaseDir>
</NuSpec>
<NuSpec Include="$(VsToolsetDir)\VS.Tools.Roslyn.nuspec">
<Version>$(NuGetPerBuildPreReleaseVersion)</Version>
<!-- TFS build number isn't set on CI server -->
<Version Condition="'$(NuGetPerBuildPreReleaseVersion)' == ''">$(NuGetReleaseVersion)-cibuild</Version>
<BaseDir>$(VsToolsetDir)</BaseDir>
</NuSpec>
</ItemGroup>
<Target Name="Build" Inputs="@(NuSpec)" Outputs="@(NuSpec -> $(PackagesOutDir)\%(Filename)%(Extension).%(Version).nupkg">
<MakeDir Directories="$(PackagesOutDir)" Condition="!Exists('$(PackagesOutDir)')" />
<!-- nuget doesn't set exitcode when the value of an arg is invalid -->
<Exec Command="Pack.cmd %(NuSpec.FullPath) %(NuSpec.Version) %(NuSpec.BaseDir) $(PackagesOutDir)"
CustomErrorRegularExpression="pack: invalid arguments" />
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(PackagesOutDir)" />
</Target>
</Project>
......@@ -39,10 +39,9 @@ function Publish-NuGet([string]$packageDir, [string]$uploadUrl) {
Push-Location $packageDir
try {
Write-Host "Publishing $(Split-Path -leaf $packageDir) to $uploadUrl"
$packages = [xml](Get-Content "$packageDir\myget_org-packages.config")
$apiKey = Get-PublishKey $uploadUrl
foreach ($package in $packages.packages.package) {
$nupkg = $package.id + "." + $package.version + ".nupkg"
foreach ($package in *.nupkg) {
$nupkg = Split-Path -Leaf $package
Write-Host " Publishing $nupkg"
if (-not (Test-Path $nupkg)) {
throw "$nupkg does not exist"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册