This commit is contained in:
Tomas Matousek 2017-05-20 19:11:48 -07:00
Родитель 3cae698b6d
Коммит bd4a4150f8
87 изменённых файлов: 347 добавлений и 1400 удалений

71
.gitignore поставляемый
Просмотреть файл

@ -15,26 +15,11 @@
x64/
[Bb]in/
[Oo]bj/
.dotnet/
.tools/
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/
# NuGet restore semaphore
build/ToolsetPackages/toolsetpackages.semaphore
# NuGet
nuget.exe
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
UnitTestResults.html
# NuGet V3 artifacts
*-packages.config
*.nuget.props
*.nuget.targets
project.lock.json
# Per-user project properties
launchSettings.json
*_i.c
*_p.c
@ -60,9 +45,6 @@ project.lock.json
*.log
*.scc
# Visual Studio cache files
*.sln.ide/
# Visual C++ cache files
ipch/
*.aps
@ -94,35 +76,6 @@ _TeamCity*
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
# NuGet Packages Directory
packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
@ -135,26 +88,10 @@ ClientBin/
*.pfx
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
# =========================
# Windows detritus
# =========================

Просмотреть файл

@ -1,3 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass .\build\Scripts\Windows\Build.ps1 %*
powershell -ExecutionPolicy ByPass %~dp0build\Build.ps1 -restore -build %*
exit /b %ErrorLevel%

3
CIBuild.cmd Normal file
Просмотреть файл

@ -0,0 +1,3 @@
@echo off
powershell -ExecutionPolicy ByPass %~dp0build\Build.ps1 -restore -build -test -sign -pack -ci %*
exit /b %ErrorLevel%

21
Directory.Build.props Normal file
Просмотреть файл

@ -0,0 +1,21 @@
<!-- 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>
<Import Project="build\NuGet.props"/>
<Import Project="build\Versions.props"/>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\'))</RepoRoot>
<SignToolDataPath>$(RepoRoot)build\SignToolData.json</SignToolDataPath>
<VersionsPropsPath>$(RepoRoot)build\Versions.props</VersionsPropsPath>
<RepoToolsetDir>$(NuGetPackageRoot)RoslynTools.Microsoft.RepoToolset\$(RoslynToolsMicrosoftRepoToolsetVersion)\tools\</RepoToolsetDir>
<RepositoryUrl>https://github.com/dotnet/symreader</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
<!-- SourceLink: Generate source link when building in microbuild. -->
<SourceLinkCreate Condition="'$(BUILD_BUILDNUMBER)' != ''">true</SourceLinkCreate>
<SourceLinkRepo>$(RepoRoot)</SourceLinkRepo>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1 +1,3 @@
@call %~dp0build.cmd -skipBuild -skipTest %*
@echo off
powershell -ExecutionPolicy ByPass %~dp0build\Build.ps1 -restore %*
exit /b %ErrorLevel%

Просмотреть файл

@ -1,39 +1,26 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26021.0
VisualStudioVersion = 15.0.26510.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.DiaSymReader", "src\Microsoft.DiaSymReader\Shared\Microsoft.DiaSymReader.shproj", "{F9127F0F-95C8-4576-8081-96E004C1652F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DiaSymReader.UnitTests", "src\Microsoft.DiaSymReader.Tests\Microsoft.DiaSymReader.UnitTests.csproj", "{D9CAEB67-A062-4874-96E9-51BAF1373EBB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DiaSymReader.NetFX20", "src\Microsoft.DiaSymReader\NetFX20\Microsoft.DiaSymReader.NetFX20.csproj", "{FA2C8969-BD1F-457A-A6E3-CA772135FF73}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DiaSymReader.Portable", "src\Microsoft.DiaSymReader\Portable\Microsoft.DiaSymReader.Portable.csproj", "{316FD2AD-8514-41BD-98D5-61A821F3320E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DiaSymReader.UnitTests", "src\Microsoft.DiaSymReader.Tests\Microsoft.DiaSymReader.UnitTests.csproj", "{D9CAEB67-A062-4874-96E9-51BAF1373EBB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DiaSymReader", "src\Microsoft.DiaSymReader\Microsoft.DiaSymReader.csproj", "{13BB18F6-0FD5-42EF-A67A-A3B1E27F2ED0}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Microsoft.DiaSymReader\Shared\Microsoft.DiaSymReader.projitems*{316fd2ad-8514-41bd-98d5-61a821f3320e}*SharedItemsImports = 4
src\Microsoft.DiaSymReader\Shared\Microsoft.DiaSymReader.projitems*{f9127f0f-95c8-4576-8081-96e004c1652f}*SharedItemsImports = 13
src\Microsoft.DiaSymReader\Shared\Microsoft.DiaSymReader.projitems*{fa2c8969-bd1f-457a-a6e3-ca772135ff73}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FA2C8969-BD1F-457A-A6E3-CA772135FF73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA2C8969-BD1F-457A-A6E3-CA772135FF73}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA2C8969-BD1F-457A-A6E3-CA772135FF73}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA2C8969-BD1F-457A-A6E3-CA772135FF73}.Release|Any CPU.Build.0 = Release|Any CPU
{316FD2AD-8514-41BD-98D5-61A821F3320E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{316FD2AD-8514-41BD-98D5-61A821F3320E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{316FD2AD-8514-41BD-98D5-61A821F3320E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{316FD2AD-8514-41BD-98D5-61A821F3320E}.Release|Any CPU.Build.0 = Release|Any CPU
{D9CAEB67-A062-4874-96E9-51BAF1373EBB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9CAEB67-A062-4874-96E9-51BAF1373EBB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9CAEB67-A062-4874-96E9-51BAF1373EBB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9CAEB67-A062-4874-96E9-51BAF1373EBB}.Release|Any CPU.Build.0 = Release|Any CPU
{13BB18F6-0FD5-42EF-A67A-A3B1E27F2ED0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13BB18F6-0FD5-42EF-A67A-A3B1E27F2ED0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13BB18F6-0FD5-42EF-A67A-A3B1E27F2ED0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13BB18F6-0FD5-42EF-A67A-A3B1E27F2ED0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Просмотреть файл

@ -1 +1,3 @@
@call %~dp0build.cmd -skipRestore -skipBuild %*
@echo off
powershell -ExecutionPolicy ByPass %~dp0build\Build.ps1 -test %*
exit /b %ErrorLevel%

10
build/NuGet.props Normal file
Просмотреть файл

@ -0,0 +1,10 @@
<!-- 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>
<PropertyGroup>
<!-- Respect environment variable for the NuGet Packages Root if set; otherwise, use the current default location -->
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">$(NUGET_PACKAGES)</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' AND '$(OS)' == 'Windows_NT'">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' AND '$(OS)' != 'Windows_NT'">$([System.Environment]::GetFolderPath(SpecialFolder.Personal))\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageRoot Condition="!HasTrailingSlash('$(NuGetPackageRoot)')">$(NuGetPackageRoot)\</NuGetPackageRoot>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,107 +0,0 @@
#r "System.Xml.Linq"
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.Xml.Linq;
var errors = new List<string>();
void ReportError(string message)
{
var color = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(message);
Console.ForegroundColor = color;
}
void ReportSuccess(string message)
{
var color = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine(message);
Console.ForegroundColor = color;
}
string usage = @"usage: pack.csx <version> <nuspec-dir> <binaries-dir> <output-directory>";
if (Args.Count() != 4)
{
Console.WriteLine(usage);
Environment.Exit(1);
}
var SolutionRoot = Path.GetFullPath(Path.Combine(ScriptRoot(), "../../"));
string ScriptRoot([CallerFilePath]string path = "") => Path.GetDirectoryName(path);
// 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 BuildVersion = Args[0].Trim();
var NuSpecDir = Path.GetFullPath(Args[1].Trim());
var BinDir = Path.GetFullPath(Path.GetFullPath(Args[2]).Trim().TrimEnd('\\'));
var OutDir = Path.GetFullPath(Path.GetFullPath(Args[3]).Trim().TrimEnd('\\'));
var doc = XDocument.Load(Path.Combine(SolutionRoot, "build/Targets/Dependencies.props"));
XNamespace ns = @"http://schemas.microsoft.com/developer/msbuild/2003";
var dependencyVersions = from e in doc.Root.Descendants()
where e.Name.LocalName.EndsWith("Version")
select new { VariableName = e.Name.LocalName, Value = e.Value };
var commonArgs =
$"-OutputDirectory \"{OutDir}\" " +
$"-prop version=\"{BuildVersion}\" " +
string.Join(" ", dependencyVersions.Select(d => $"-prop {d.VariableName}=\"{d.Value}\""));
Directory.CreateDirectory(OutDir);
int exitCode = 0;
foreach (var nuspec in Directory.EnumerateFiles(NuSpecDir, "*.nuspec", SearchOption.TopDirectoryOnly))
{
var libraryName = Path.GetFileNameWithoutExtension(nuspec);
var nugetArgs =
$"pack \"{nuspec}\" " +
$"-BasePath \"{Path.Combine(BinDir, libraryName)}\" " +
commonArgs;
var nugetExePath = Path.GetFullPath(Path.Combine(SolutionRoot, "nuget.exe"));
var p = new Process();
p.StartInfo.FileName = nugetExePath;
p.StartInfo.Arguments = nugetArgs;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardOutput = true;
Console.WriteLine($"{Environment.NewLine}Running: nuget.exe {nugetArgs}");
p.Start();
p.WaitForExit();
if (p.ExitCode != 0)
{
exitCode = p.ExitCode;
var message = $"{nuspec}: error: {p.StandardError.ReadToEnd()}";
errors.Add(message);
ReportError(message);
}
else
{
ReportSuccess(p.StandardOutput.ReadToEnd());
}
}
foreach (var error in errors)
{
ReportError(error);
}
return exitCode;

Просмотреть файл

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<OutDirName>Nuget</OutDirName>
</PropertyGroup>
<ImportGroup>
<Import Project="..\Targets\Settings.targets" />
</ImportGroup>
<Target Name="Build">
<Exec Command='"$(ToolsetCompilerPackageDir)\tools\csi.exe" "$(MSBuildProjectDirectory)\pack.csx" "$(NuGetVersion)" "$(MSBuildProjectDirectory)\..\..\src\NuGet" "$(OutDirBase)" "$(OutDir)"' />
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(OutDir)" />
</Target>
</Project>

Просмотреть файл

@ -4,14 +4,14 @@
"certificate": "MicrosoftSHA1Win8WinBlue",
"strongName": "MsSharedLib72",
"values": [
"Microsoft.DiaSymReader/NetFX20/Microsoft.DiaSymReader.dll"
"Microsoft.DiaSymReader/net20/Microsoft.DiaSymReader.dll"
]
},
{
"certificate": "WindowsPhone623",
"strongName": "MsSharedLib72",
"values": [
"Microsoft.DiaSymReader/Portable/Microsoft.DiaSymReader.dll"
"Microsoft.DiaSymReader/netstandard1.1/Microsoft.DiaSymReader.dll"
]
}
]

Двоичные данные
build/Signing/35MSSharedLib1024.snk

Двоичный файл не отображается.

Просмотреть файл

@ -1,51 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!-- ====================================================================================
Strong Name Signing Settings
==================================================================================== -->
<PropertyGroup>
<ShouldSignBuild Condition="'$(RealSignBuild)' == 'true' OR '$(SignType)' == 'real'">true</ShouldSignBuild>
</PropertyGroup>
<Choose>
<When Condition="'$(SignAssembly)' == 'true'">
<Choose>
<When Condition="'$(ShouldSignBuild)' == 'true' OR '$(BuildingProject)' == 'false'">
<!-- We are either real-signing or doing a design build, so we need to delay sign -->
<PropertyGroup>
<DelaySign>true</DelaySign>
<PublicSign>false</PublicSign>
</PropertyGroup>
</When>
<Otherwise>
<!-- We are not real-signing or doing a design build, so we need to public sign -->
<PropertyGroup>
<DelaySign>false</DelaySign>
<PublicSign>true</PublicSign>
</PropertyGroup>
</Otherwise>
</Choose>
<!-- Binaries are delay or public-signed with the MS key; later, the signing system will finish the strong-name signing. -->
<PropertyGroup >
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
<PublicKey>0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9</PublicKey>
<PublicKeyToken>31BF3856AD364E35</PublicKeyToken>
</PropertyGroup>
</When>
</Choose>
<!-- ====================================================================================
Build Flag Verification
==================================================================================== -->
<PropertyGroup>
<PrepareForBuildDependsOn>$(PrepareForBuildDependsOn);VerifyBuildFlags</PrepareForBuildDependsOn>
</PropertyGroup>
<Target Name="VerifyBuildFlags">
<Error Condition="('$(RealSignBuild)' == 'true' OR '$(SignType)' == 'real') AND '$(BuildVersion)' == '42.42.42.42'"
Text="Must specify a build version in order to real sign a build." />
</Target>
</Project>

Просмотреть файл

@ -1,13 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MicroBuildCoreVersion>0.2.0</MicroBuildCoreVersion>
<RoslynToolsMicrosoftSignToolVersion>0.2.0-beta</RoslynToolsMicrosoftSignToolVersion>
<ToolsetCompilerPackageVersion>2.0.0-beta3-60616-03</ToolsetCompilerPackageVersion>
<XUnitConsoleRunnerPackageVersion>2.1.0</XUnitConsoleRunnerPackageVersion>
<!-- CoreFX -->
<SystemDiagnosticsDebugVersion>4.0.11</SystemDiagnosticsDebugVersion>
<SystemRuntimeVersion>4.1.0</SystemRuntimeVersion>
<SystemRuntimeInteropServicesVersion>4.1.0</SystemRuntimeInteropServicesVersion>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,10 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!-- This file is imported by all projects at the end of the project files -->
<Import Project="..\Signing\StrongName.targets"/>
<Import Project="..\Toolset\DefaultImports.targets"/>
<Import Project="..\Toolset\GenerateAssemblyInfo.targets" />
<Import Project="..\Toolset\GenerateInternalsVisibleTo.targets" />
</Project>

Просмотреть файл

@ -1,15 +0,0 @@
<Project DefaultTargets="Build" InitialTargets="RestoreToolsetCheck" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Import Project="Version.props" />
<Import Project="Dependencies.props" />
<Import Project="..\Toolset\DefaultSettings.targets" />
<PropertyGroup>
<!--
Suppress generating TFA so that projects targeting Portable Profile7 can reference the dll
(see https://github.com/dotnet/roslyn/issues/11067).
-->
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,7 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<AssemblyVersion>1.2.0</AssemblyVersion>
<NuGetMoniker>beta1</NuGetMoniker>
</PropertyGroup>
<Import Project="..\Toolset\Version.props"/>
</Project>

19
build/Toolset.proj Normal file
Просмотреть файл

@ -0,0 +1,19 @@
<!-- 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>
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<!-- Output dir for restore artifacts -->
<BaseIntermediateOutputPath>$(MSBuildThisProjectDirectory)..\..\artifacts\Toolset</BaseIntermediateOutputPath>
</PropertyGroup>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<ItemGroup>
<PackageReference Include="RoslynTools.Microsoft.RepoToolset" Version="$(RoslynToolsMicrosoftRepoToolsetVersion)" />
<PackageReference Include="RoslynTools.Microsoft.XUnitLogger" Version="$(RoslynToolsMicrosoftXUnitLoggerVersion)" />
<PackageReference Include="RoslynTools.Microsoft.SignTool" Version="$(RoslynToolsMicrosoftSignToolVersion)" />
<PackageReference Include="MicroBuild.Core" Version="$(MicroBuildCoreVersion)" />
<PackageReference Include="MicroBuild.Core.Sentinel" Version="1.0.0" />
<PackageReference Include="Microsoft.Net.Compilers" Version="$(MicrosoftNetCompilersVersion)" />
<PackageReference Include="SourceLink.Create.CommandLine" Version="$(SourceLinkCreateCommandLineVersion)" PrivateAssets="all" />
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>

Просмотреть файл

@ -1,21 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" Condition="'$(TargetFrameworkIdentifier)' == '.NETPortable'" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="'$(TargetFrameworkIdentifier)' != '.NETPortable'" />
<Choose>
<When Condition="'$(TargetFrameworkIdentifier)' == '.NETPortable' AND
'$(TargetFrameworkVersion)' == 'v5.0'">
<!-- Treat portable exes as CoreClr-targeting-exes -->
<PropertyGroup Condition="'$(OutputType)' == 'Exe'">
<NuGetTargetMoniker>.NETCoreApp,Version=v1.0</NuGetTargetMoniker>
<BaseNuGetRuntimeIdentifier Condition="'$(OS)' == 'Windows_NT'">win7</BaseNuGetRuntimeIdentifier>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup>
<DocumentationFile Condition="'$(DocumentationFile)' == '' AND '$(NoDocumentationFile)' != 'true' AND '$(AssemblyName)' != ''">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,38 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="Toolset.targets" />
<!-- Common Settings -->
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SignAssembly Condition="'$(SignAssembly)' == ''">true</SignAssembly>
<OverwriteReadOnlyFiles Condition="'$(OverwriteReadOnlyFiles)' == ''">true</OverwriteReadOnlyFiles>
<FileAlignment>512</FileAlignment>
<HighEntropyVA>true</HighEntropyVA>
</PropertyGroup>
<!-- C# Specific Settings -->
<PropertyGroup>
<WarningLevel>4</WarningLevel>
<ErrorReport>prompt</ErrorReport>
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>pdbonly</DebugType>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>
<Import Project="Layout.props" />
</Project>

Просмотреть файл

@ -1,82 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GeneratedAssemblyInfoFile>$(IntermediateOutputPath)GeneratedAssemblyInfo_$(BuildVersion)$(DefaultLanguageSourceExtension)</GeneratedAssemblyInfoFile>
</PropertyGroup>
<ItemGroup>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyCompanyAttribute">
<_Parameter1>Microsoft Corporation</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyInfoAttribute Include="System.Reflection.AssemblyConfigurationAttribute">
<_Parameter1>$(Configuration)</_Parameter1>
</AssemblyInfoAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyCopyrightAttribute">
<_Parameter1>© Microsoft Corporation. All rights reserved.</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyInfoAttribute Include="System.Reflection.AssemblyDefaultAliasAttribute">
<_Parameter1>$(AssemblyName)</_Parameter1>
</AssemblyInfoAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyFileVersionAttribute">
<_Parameter1>$(BuildVersion)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyInformationalVersionAttribute">
<_Parameter1>$(BuildVersion)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyVersionAttribute">
<_Parameter1>$(AssemblyVersion)</_Parameter1>
</AssemblyVersionAttribute>
</ItemGroup>
<PropertyGroup>
<!-- It is extremely important to make CoreCompile depend on us, and not anything else.
This has to do with how XAML tasks compile a temporary assembly during the two markup compile
passes.
Targets happen in this order:
PrepareForBuild, PreBuildEvent, ResolveReferences, PrepareResources, ResolveKeySource, Compile, ...
Here's the target dependency DAG that invokes markup compile:
CoreBuild -> PrepareResources -> XamlMarkupCompilePass1, XamlMarkupCompilePass2.
As part of pass 1, we determine a list of .xaml files that reference types from the current
assembly. For those, we can't emit BAML just yet because we can't reference the assembly being
compiled. We pass this list to MarkupCompilePass2. As part of pass 2, we run the
XamlTemporaryAssemblyGeneration target. It generates a special ***.tmp_proj project that is a
trimmed down version of the current project's XML. It then spawns a new MSBuild process to build
the tmp_proj with only a limited set of targets, specifically:
<Target Name="CompileTemporaryAssembly" DependsOnTargets="BuildOnlySettings;ResolveKeySource;_GenerateCompileInputs;CoreCompile" />
Hence, as part of building the temporary assembly the most important target being called is
CoreCompile. Targets such as CoreBuild and Compile aren't even called there. Hence, if we predicate
GenerateAssemblyInfoFile on Compile or CoreBuild, it won't get called when generating the
assembly info file. As a result, we won't pass GeneratedAssemblyInfo_42.42.42.42.cs to the
compiler when compiling the temporary assembly, and the temporary assembly will be generated
with AssemblyVersion 0.0.0.0. Next, the unfortunate consequence is that the temp assembly will be
used to compile the .baml files in MarkupCompilePass2, and the .baml files will end up referencing
version 0.0.0.0 of the assembly, resulting in runtime assembly load failures.
This is why if we use CoreCompile below the correct version will end up in the temporary assembly
and the .baml will be generated correctly eliminating the assembly load failures.
-->
<CoreCompileDependsOn>GenerateAssemblyInfoFile;$(CoreCompileDependsOn)</CoreCompileDependsOn>
</PropertyGroup>
<!-- Depends on PrepareForBuild because the latter is responsible for calling MakeDir(IntermediateOutputPath).
Without it, if we do a design-time build of a project (e.g. in Workspace.LoadSolution) immediately following
a tfpt treeclean, WriteCodeFragment may fail because the obj folder doesn't even exist at that time. -->
<Target Name="GenerateAssemblyInfoFile"
Inputs="$(MSBuildThisFileFullPath)"
Outputs="$(GeneratedAssemblyInfoFile)"
DependsOnTargets="PrepareForBuild"
Condition="('$(Language)' == 'C#' or '$(Language)' == 'VB') and '$(OS)' == 'Windows_NT' ">
<WriteCodeFragment AssemblyAttributes="@(AssemblyVersionAttribute)"
Language="$(Language)"
OutputFile="$(GeneratedAssemblyInfoFile)">
<Output TaskParameter="OutputFile" ItemName="Compile" />
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragment>
</Target>
</Project>

Просмотреть файл

@ -1,57 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GeneratedInternalsVisibleToFile>$(IntermediateOutputPath)GeneratedInternalsVisibleTo$(DefaultLanguageSourceExtension)</GeneratedInternalsVisibleToFile>
</PropertyGroup>
<PropertyGroup>
<CompileDependsOn>GenerateInternalsVisibleToFile;$(CompileDependsOn)</CompileDependsOn>
</PropertyGroup>
<ItemDefinitionGroup>
<InternalsVisibleTo>
<Visible>false</Visible>
</InternalsVisibleTo>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(PublicKey)' != '' and '$(SignAssembly)' == 'True'">
<InternalsVisibleToSuffix>, PublicKey=$(PublicKey)</InternalsVisibleToSuffix>
</PropertyGroup>
<!-- Dependency on PrepareForBuild is necessary so that we don't accidentally get ordered before it.
We rely on PrepareForBuild to create the IntermediateOutputDirectory if it doesn't exist. -->
<Target Name="GenerateInternalsVisibleToFile"
Inputs="$(MSBuildThisFileFullPath);$(MSBuildProjectFile)"
Outputs="$(GeneratedInternalsVisibleToFile)"
DependsOnTargets="PrepareForBuild"
Condition="'@(InternalsVisibleTo)' != ''">
<!--
This is a slightly evil trick. What we have is a group of InternalsVisibleTo items which
we need to convert to the items that the WriteCodeFragment expects. They look like this:
<InternalsVisibleTo Include="Foo" />
And need to convert it to:
<InternalsVisibleToAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>Foo</Parameter1>
</InternalsVisibleToAttribute>
One way (although a bit evil) is to use the old CreateItem task. Since we use the well-defined
"Identity" metadata on each of our itemgroups, MSBuild batching will take effect and this task
will be invoked once for each InternalsVisibleTo item.
-->
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"
AdditionalMetadata="_Parameter1=%(InternalsVisibleTo.Identity)$(InternalsVisibleToSuffix)"
Condition="'@(InternalsVisibleTo)' != ''">
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
</CreateItem>
<WriteCodeFragment AssemblyAttributes="@(InternalsVisibleToAttribute)"
Language="$(Language)"
OutputFile="$(GeneratedInternalsVisibleToFile)">
<Output TaskParameter="OutputFile" ItemName="Compile" />
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragment>
</Target>
</Project>

Просмотреть файл

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Properties describing the layout of the repo.
-->
<PropertyGroup>
<ArtifactsDir>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\artifacts'))</ArtifactsDir>
<OutDirName Condition="'$(OutDirName)' == ''">$([System.IO.Path]::GetFileName('$(MSBuildProjectDirectory)'))</OutDirName>
<OutDirBase>$(ArtifactsDir)\$(Configuration)\bin</OutDirBase>
<OutDir Condition="'$(OutDir)' == ''">$(OutDirBase)\$(OutDirName)</OutDir>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(ArtifactsDir)\$(Configuration)\obj\$(OutDirName)</IntermediateOutputPath>
<OutputPath>$(OutDir)</OutputPath>
<!-- Disable AppX packaging for the Roslyn source. Not setting this to false has the side effect
that any builds of portable projects end up in a sub folder of $(OutDir). Search for this flag in
Microsoft.Common.CurrentVersion.targets to see how it is consumed -->
<WindowsAppContainer>false</WindowsAppContainer>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
</PropertyGroup>
<ImportGroup>
<Import Project="..\Targets\Dependencies.props"/>
<Import Project="Layout.props" />
<Import Project="NuGet.props"/>
<Import Project="$(NuGetPackageRoot)\MicroBuild.Core\$(MicroBuildCoreVersion)\build\MicroBuild.Core.props" />
<Import Project="$(NuGetPackageRoot)\MicroBuild.Core\$(MicroBuildCoreVersion)\build\MicroBuild.Core.targets" />
</ImportGroup>
<ItemGroup>
<SignToolArgs Include='-nugetPackagesPath "$(NugetPackageRoot)"' />
<SignToolArgs Include='-intermediateOutputPath "$(IntermediateOutputPath)"' />
<SignToolArgs Include='-msbuildPath "$(MSBuildBinPath)\msbuild.exe"' />
<SignToolArgs Include='-config "$(MSBuildThisFileDirectory)..\Signing\SignToolData.json"' />
<SignToolArgs Include='"$(OutDirBase)"' />
</ItemGroup>
<Target Name="Build">
<Exec Command="$(NuGetPackageRoot)\RoslynTools.Microsoft.SignTool\$(RoslynToolsMicrosoftSignToolVersion)\tools\SignTool.exe @(SignToolArgs, ' ')" />
</Target>
</Project>

Просмотреть файл

@ -1,17 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!-- ====================================================================================
NuGet Restore Settings
==================================================================================== -->
<PropertyGroup>
<ProjectDir>$(MSBuildThisFileDirectory)..\..\</ProjectDir>
<NuGetToolPath>$(ProjectDir)\nuget.exe</NuGetToolPath>
<ToolsetPackagesDir>$(ProjectDir)build\Toolset\</ToolsetPackagesDir>
<!-- Respect environment variable for the NuGet Packages Root if set; otherwise, use the current default location -->
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">$(NUGET_PACKAGES)</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' AND '$(OS)' == 'Windows_NT'">$(UserProfile)\.nuget\packages</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' AND '$(OS)' != 'Windows_NT'">$([System.Environment]::GetFolderPath(SpecialFolder.Personal))\.nuget\packages</NuGetPackageRoot>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,26 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!--
Requires the following properties to be set:
ToolsetCompilerPackageVersion
XUnitConsoleRunnerPackageVersion
-->
<Import Project="NuGet.props" />
<PropertyGroup>
<ToolsetCompilerPackageDir>$(NuGetPackageRoot)\Microsoft.Net.Compilers\$(ToolsetCompilerPackageVersion)</ToolsetCompilerPackageDir>
<ToolsetCompilerPropsFilePath>$(ToolsetCompilerPackageDir)\build\Microsoft.Net.Compilers.props</ToolsetCompilerPropsFilePath>
<XUnitConsoleRunnerExeFilePath>$(NuGetPackageRoot)\xunit.runner.console\$(XUnitConsoleRunnerPackageVersion)\tools\xunit.console.x86.exe</XUnitConsoleRunnerExeFilePath>
</PropertyGroup>
<Target Name="RestoreToolsetCheck" Condition="'$(BuildingProject)' == 'true'">
<Error Text="Toolset packages have not been restored, run Restore.cmd before building"
Condition="!Exists('$(ToolsetCompilerPropsFilePath)') or !Exists('$(XUnitConsoleRunnerExeFilePath)')" />
</Target>
<Import Project="$(ToolsetCompilerPropsFilePath)" Condition="Exists('$(ToolsetCompilerPropsFilePath)')" />
</Project>

Просмотреть файл

@ -1,51 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<!--
Requires the following properties to be set:
AssemblyVersion
NuGetMoniker (empty for release build)
Defines the following properties:
BuildVersion
NuGetVersion
VsixVersion
-->
<Choose>
<When Condition="$(BUILD_BUILDNUMBER) == ''">
<PropertyGroup>
<NuGetMoniker>dev</NuGetMoniker>
<NuGetVersionSuffix>dev</NuGetVersionSuffix>
<BuildVersion>$(AssemblyVersion).0</BuildVersion>
<VsixVersion>$(AssemblyVersion).9000000</VsixVersion>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<BuildNumberFiveDigitDateStamp>$([MSBuild]::Subtract($(BUILD_BUILDNUMBER.Split('.')[0].Substring(3).Trim()), 8800))</BuildNumberFiveDigitDateStamp>
<BuildNumberBuildOfTheDayPadded>$(BUILD_BUILDNUMBER.Split('.')[1].PadLeft(2,'0'))</BuildNumberBuildOfTheDayPadded>
<NuGetVersionSuffix>$(NuGetMoniker)-$(BuildNumberFiveDigitDateStamp)-$(BuildNumberBuildOfTheDayPadded)</NuGetVersionSuffix>
<BuildVersion>$(AssemblyVersion).$(BuildNumberFiveDigitDateStamp)</BuildVersion>
<VsixVersion>$(AssemblyVersion).$(BuildNumberFiveDigitDateStamp)$(BuildNumberBuildOfTheDayPadded)</VsixVersion>
</PropertyGroup>
</Otherwise>
</Choose>
<Choose>
<When Condition="'$(NuGetMoniker)' == ''" >
<PropertyGroup>
<NuGetVersion>$(AssemblyVersion)</NuGetVersion>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<NuGetVersion>$(AssemblyVersion)-$(NuGetVersionSuffix)</NuGetVersion>
</PropertyGroup>
</Otherwise>
</Choose>
</Project>

Просмотреть файл

@ -1,20 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<PropertyGroup>
<XUnitTestResultsDirectory>$(OutDir)\xUnitResults</XUnitTestResultsDirectory>
<XUnitArguments>"$(OutDir)\$(AssemblyName).dll" -html "$(XUnitTestResultsDirectory)\$(AssemblyName).html" -noshadow</XUnitArguments>
</PropertyGroup>
<Target Name="Test" DependsOnTargets="Build">
<MakeDir Directories="$(XUnitTestResultsDirectory)" />
<Exec Command="&quot;$(XUnitConsoleRunnerExeFilePath)&quot; $(XUnitArguments)" />
</Target>
<PropertyGroup>
<StartAction Condition="'$(StartActions)' == ''">Program</StartAction>
<StartProgram Condition="'$(StartProgram)' == ''">$(XUnitConsoleRunnerExeFilePath)</StartProgram>
<StartArguments Condition="'$(StartArguments)' == ''">$(XUnitArguments)</StartArguments>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,14 +0,0 @@
{
"dependencies": {
"MicroBuild.Core": "0.2.0",
"Microsoft.Net.Compilers": "2.0.0-beta3-60616-03",
"xunit.runner.console": "2.1.0",
"RoslynTools.Microsoft.SignTool": "0.2.0-beta"
},
"frameworks": {
"net46": {}
},
"runtimes": {
"win": {}
}
}

28
build/Versions.props Normal file
Просмотреть файл

@ -0,0 +1,28 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- This repo version -->
<VersionBase>1.2.0</VersionBase>
<PreReleaseVersionLabel>beta1</PreReleaseVersionLabel>
<!-- Toolset -->
<RoslynToolsMicrosoftRepoToolsetVersion>1.0.0-alpha14</RoslynToolsMicrosoftRepoToolsetVersion>
<RoslynToolsMicrosoftXUnitLoggerVersion>1.0.0-alpha1</RoslynToolsMicrosoftXUnitLoggerVersion>
<RoslynToolsMicrosoftSignToolVersion>0.3.2-beta</RoslynToolsMicrosoftSignToolVersion>
<DotNetCliVersion>2.0.0-preview1-005977</DotNetCliVersion>
<MicroBuildCoreVersion>0.2.0</MicroBuildCoreVersion>
<MicroBuildPluginsSwixBuildVersion>1.0.101</MicroBuildPluginsSwixBuildVersion>
<MicrosoftNetCompilersVersion>2.0.1</MicrosoftNetCompilersVersion>
<SourceLinkCreateCommandLineVersion>2.1.0</SourceLinkCreateCommandLineVersion>
<!--
TODO: dotnet cli currently doesn't support building against net20, using msbuild instead.
https://github.com/Microsoft/msbuild/issues/1333
-->
<VSWhereVersion>1.0.47</VSWhereVersion>
<!-- Tests -->
<MicrosoftNETTestSdkVersion>15.0.0-preview-20170125-04</MicrosoftNETTestSdkVersion>
<XUnitVersion>2.2.0-beta4-build3444</XUnitVersion>
<XUnitRunnerVisualStudioVersion>2.2.0-beta4-build1194</XUnitRunnerVisualStudioVersion>
</PropertyGroup>
</Project>

25
build/build.proj Normal file
Просмотреть файл

@ -0,0 +1,25 @@
<Project DefaultTargets="Build" TreatAsLocalProperty="SolutionPath">
<!--
Optional parameters:
SolutionPath Path to the solution to build
Configuration Build configuration: "Debug", "Release", etc.
CIBuild "true" if building on CI server
Restore "true" to restore toolset and solution
Build "true" to build solution
Test "true" to run tests
Sign "true" to sign built binaries
Pack "true" to build NuGet packages
-->
<PropertyGroup>
<SolutionPath Condition="'$(SolutionPath)' == ''">$(MSBuildThisFileDirectory)..\SymReader.sln</SolutionPath>
</PropertyGroup>
<Import Project="..\Directory.build.props"/>
<Target Name="Build">
<MSBuild Projects="Toolset.proj" Targets="Restore" Condition="'$(Restore)' == 'true'"/>
<MSBuild Projects="$(RepoToolsetDir)Build.proj"
Properties="SolutionPath=$(SolutionPath);Configuration=$(Configuration);CIBuild=$(CIBuild);Restore=$(Restore);Build=$(Build);Test=$(Test);Sign=$(Sign);Pack=$(Pack)" />
</Target>
</Project>

85
build/build.ps1 Normal file
Просмотреть файл

@ -0,0 +1,85 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = "Debug",
[string] $solution = "",
[string] $verbosity = "normal",
[switch] $restore,
[switch] $build,
[switch] $test,
[switch] $sign,
[switch] $pack,
[switch] $ci,
[switch] $clearCaches
)
set-strictmode -version 2.0
$ErrorActionPreference = "Stop"
$RepoRoot = Join-Path $PSScriptRoot "..\"
$ToolsRoot = Join-Path $RepoRoot ".tools"
$BuildProj = Join-Path $PSScriptRoot "build.proj"
$DependenciesProps = Join-Path $PSScriptRoot "Versions.props"
$ArtifactsDir = Join-Path $RepoRoot "artifacts"
$LogDir = Join-Path $ArtifactsDir "log"
$TempDir = Join-Path (Join-Path $ArtifactsDir $configuration) "tmp"
function Create-Directory([string[]] $path) {
if (!(Test-Path -path $path)) {
New-Item -path $path -force -itemType "Directory" | Out-Null
}
}
function GetVSWhereVersion {
[xml]$xml = Get-Content $DependenciesProps
return $xml.Project.PropertyGroup.VSWhereVersion
}
function LocateMsbuild {
$vswhereVersion = GetVSWhereVersion
$vsWhereDir = Join-Path $ToolsRoot "vswhere\$vswhereVersion"
$vsWhereExe = Join-Path $vsWhereDir "vswhere.exe"
if (!(Test-Path $vsWhereExe)) {
Create-Directory $vsWhereDir
Invoke-WebRequest "http://github.com/Microsoft/vswhere/releases/download/$vswhereVersion/vswhere.exe" -OutFile $vswhereExe
}
$vsInstallDir = & $vsWhereExe -latest -property installationPath -requires Microsoft.Component.MSBuild -requires Microsoft.VisualStudio.Component.VSSDK -requires Microsoft.Net.Component.4.6.TargetingPack -requires Microsoft.VisualStudio.Component.Roslyn.Compiler -requires Microsoft.VisualStudio.Component.VSSDK
$msbuildExe = Join-Path $vsInstallDir "MSBuild\15.0\Bin\msbuild.exe"
if (!(Test-Path $msbuildExe)) {
throw "Failed to locate msbuild (exit code '$lastExitCode')."
}
return $msbuildExe
}
function Build {
$msbuildExe = LocateMsbuild
$summaryLog = Join-Path $LogDir "Build.log"
$warningLog = Join-Path $LogDir "Build.wrn"
$errorLog = Join-Path $LogDir "Build.err"
Create-Directory($logDir)
& $msbuildExe $BuildProj /p:Configuration=$configuration /p:SolutionPath=$solution /p:Restore=$restore /p:Build=$build /p:Test=$test /p:Sign=$sign /p:Pack=$pack /p:CIBuild=$ci /v:$verbosity /flp1:Summary`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$summaryLog /flp2:WarningsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$warningLog /flp3:ErrorsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$errorLog
if ($lastExitCode -ne 0) {
throw "Build failed (exit code '$lastExitCode')."
}
}
if ($ci) {
Create-Directory $TempDir
$env:TEMP = $TempDir
$env:TMP = $TempDir
}
if ($clearCaches) {
# clean nuget packages -- necessary to avoid mismatching versions of swix microbuild build plugin and VSSDK on Jenkins
Remove-Item (Join-Path $env:USERPROFILE ".nuget\packages") -Recurse -Force
}
Build

Просмотреть файл

@ -1,454 +0,0 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = "Debug",
[string] $deployHive = "TestImpact",
[string] $msbuildVersion = "14.0",
[string] $nugetVersion = "3.5.0-beta2",
[switch] $help,
[switch] $official,
[switch] $skipBuild,
[switch] $skipDeploy,
[switch] $skipRestore,
[switch] $skipInstallRoslyn,
[switch] $skipTest,
[switch] $skipTest32,
[switch] $skipTest64,
[switch] $skipTestCore,
[switch] $integration,
[string] $target = "Build",
[string] $testFilter = "*.UnitTests.dll",
[string] $integrationTestFilter = "*.IntegrationTests.dll",
[string] $xUnitVersion = "2.1.0"
)
function Create-Directory([string[]] $path) {
if (!(Test-Path -path $path)) {
New-Item -path $path -force -itemType "Directory" | Out-Null
}
}
function Download-File([string] $address, [string] $fileName) {
$webClient = New-Object -typeName "System.Net.WebClient"
$webClient.DownloadFile($address, $fileName)
}
function Get-ProductVersion([string[]] $path) {
if (!(Test-Path -path $path)) {
return ""
}
$item = Get-Item -path $path
return $item.VersionInfo.ProductVersion
}
function Get-RegistryValue([string] $keyName, [string] $valueName) {
$registryKey = Get-ItemProperty -path $keyName
return $registryKey.$valueName
}
function Locate-ArtifactsPath {
$rootPath = Locate-RootPath
$artifactsPath = Join-Path -path $rootPath -ChildPath "artifacts\"
Create-Directory -path $artifactsPath
return Resolve-Path -path $artifactsPath
}
function Locate-MSBuild {
$msbuildPath = Locate-MSBuildPath
$msbuild = Join-Path -path $msbuildPath -childPath "MSBuild.exe"
if (!(Test-Path -path $msbuild)) {
throw "The specified MSBuild version ($msbuildVersion) could not be located."
}
return Resolve-Path -path $msbuild
}
function Locate-MSBuildLogPath {
$artifactsPath = Locate-ArtifactsPath
$msbuildLogPath = Join-Path -path $artifactsPath -ChildPath "$configuration\log\"
Create-Directory -path $msbuildLogPath
return Resolve-Path -path $msbuildLogPath
}
function Locate-MSBuildPath {
$msbuildVersionPath = Locate-MSBuildVersionPath
$msbuildPath = Get-RegistryValue -keyName $msbuildVersionPath -valueName "MSBuildToolsPath"
return Resolve-Path -path $msbuildPath
}
function Locate-MSBuildVersionPath {
$msbuildVersionPath = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\MSBuild\ToolsVersions\$msbuildVersion"
if (!(Test-Path -path $msbuildVersionPath)) {
$msbuildVersionPath = "HKLM:\SOFTWARE\Microsoft\MSBuild\ToolsVersions\$msbuildVersion"
if (!(Test-Path -path $msbuildVersionPath)) {
throw "The specified MSBuild version ($msbuildVersion) could not be located."
}
}
return Resolve-Path -path $msbuildVersionPath
}
function Locate-NuGet {
$rootPath = Locate-RootPath
$nuget = Join-Path -path $rootPath -childPath "nuget.exe"
if (Test-Path -path $nuget) {
$currentVersion = Get-ProductVersion -path $nuget
if ($currentVersion.StartsWith($nugetVersion)) {
return Resolve-Path -path $nuget
}
Write-Host -object "The located version of NuGet ($currentVersion) is out of date. The specified version ($nugetVersion) will be downloaded instead."
Remove-Item -path $nuget | Out-Null
}
Download-File -address "https://dist.nuget.org/win-x86-commandline/v$nugetVersion/NuGet.exe" -fileName $nuget
if (!(Test-Path -path $nuget)) {
throw "The specified NuGet version ($nugetVersion) could not be downloaded."
}
return Resolve-Path -path $nuget
}
function Locate-NuGetConfig {
$rootPath = Locate-RootPath
$nugetConfig = Join-Path -path $rootPath -childPath "nuget.config"
return Resolve-Path -path $nugetConfig
}
function Locate-PackagesPath {
if ($env:NUGET_PACKAGES -eq $null) {
$env:NUGET_PACKAGES = Join-Path -path $env:UserProfile -childPath ".nuget\packages\"
}
$packagesPath = $env:NUGET_PACKAGES
Create-Directory -path $packagesPath
return Resolve-Path -path $packagesPath
}
function Locate-RootPath {
$scriptPath = Locate-ScriptPath
$rootPath = Join-Path -path $scriptPath -childPath "..\..\..\"
return Resolve-Path -path $rootPath
}
function Locate-ScriptPath {
$myInvocation = Get-Variable -name "MyInvocation" -scope "Script"
$scriptPath = Split-Path -path $myInvocation.Value.MyCommand.Definition -parent
return Resolve-Path -path $scriptPath
}
function Locate-Solution {
$rootPath = Locate-RootPath
$solution = Join-Path -path $rootPath -childPath "SymReader.sln"
return Resolve-Path -path $solution
}
function Locate-Toolset {
$rootPath = Locate-RootPath
$toolset = Join-Path -path $rootPath -childPath "build\Toolset\project.json"
return Resolve-Path -path $toolset
}
function Locate-xUnit-x86 {
$xUnitPath = Locate-xUnitPath
$xUnit = Join-Path -path $xUnitPath -childPath "xunit.console.x86.exe"
if (!(Test-Path -path $xUnit)) {
throw "The specified xUnit version ($xUnitVersion) could not be located."
}
return Resolve-Path -path $xUnit
}
function Locate-xUnit-x64 {
$xUnitPath = Locate-xUnitPath
$xUnit = Join-Path -path $xUnitPath -childPath "xunit.console.exe"
if (!(Test-Path -path $xUnit)) {
throw "The specified xUnit version ($xUnitVersion) could not be located."
}
return Resolve-Path -path $xUnit
}
function Locate-xUnitPath {
$packagesPath = Locate-PackagesPath
$xUnitPath = Join-Path -path $packagesPath -childPath "xunit.runner.console\$xUnitVersion\tools\"
Create-Directory -path $xUnitPath
return Resolve-Path -path $xUnitPath
}
function Locate-xUnitLogPath {
$artifactsPath = Locate-ArtifactsPath
$xUnitLogPath = Join-Path -path $artifactsPath -ChildPath "$configuration\log\"
Create-Directory -path $xUnitLogPath
return Resolve-Path -path $xUnitLogPath
}
function Locate-xUnitTestBinaries {
$artifactsPath = Locate-ArtifactsPath
$binariesPath = Join-Path -path $artifactsPath -childPath "$configuration\bin\Microsoft.DiaSymReader.Tests"
$testBinaries = Get-ChildItem -path $binariesPath -filter $testFilter -recurse -force
$xUnitTestBinaries = @()
foreach ($xUnitTestBinary in $testBinaries) {
$xUnitTestBinaries += $xUnitTestBinary.FullName
}
return $xUnitTestBinaries
}
function Locate-VsixDeployExe {
$artifactsPath = Locate-ArtifactsPath
$binariesPath = Join-Path -path $artifactsPath -childPath "$configuration\bin\DesktopTests"
return Join-Path $binariesPath "DeployIntegrationTestVsixes\DeployIntegrationTestVsixes.exe"
}
function Locate-xUnitIntegrationTestBinaries {
$artifactsPath = Locate-ArtifactsPath
$binariesPath = Join-Path -path $artifactsPath -childPath "$configuration\bin\"
$testBinaries = Get-ChildItem -path $binariesPath -filter $integrationTestFilter -recurse -force
$xUnitTestBinaries = @()
foreach ($xUnitTestBinary in $testBinaries) {
$xUnitTestBinaries += $xUnitTestBinary.FullName
}
return $xUnitTestBinaries
}
function Perform-Build {
Write-Host -object ""
if ($skipBuild) {
Write-Host -object "Skipping build..."
return
}
$artifactsPath = Locate-ArtifactsPath
$msbuild = Locate-MSBuild
$msbuildLogPath = Locate-MSBuildLogPath
$solution = Locate-Solution
$msbuildSummaryLog = Join-Path -path $msbuildLogPath -childPath "MSBuild.log"
$msbuildWarningLog = Join-Path -path $msbuildLogPath -childPath "MSBuild.wrn"
$msbuildFailureLog = Join-Path -path $msbuildLogPath -childPath "MSBuild.err"
$deploy = (-not $skipDeploy)
Write-Host -object "Starting build..."
& $msbuild /t:$target /p:Configuration=$configuration /p:DeployExtension=$deploy /p:DeployHive=$deployHive /p:OfficialBuild=$official /m /tv:$msbuildVersion /v:m /flp1:Summary`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$msbuildSummaryLog /flp2:WarningsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$msbuildWarningLog /flp3:ErrorsOnly`;Verbosity=diagnostic`;Encoding=UTF-8`;LogFile=$msbuildFailureLog /nr:false $solution
if ($lastExitCode -ne 0) {
throw "The build failed with an exit code of '$lastExitCode'."
}
Write-Host -object "The build completed successfully." -foregroundColor Green
}
function Perform-Restore {
Write-Host -object ""
if ($skipRestore) {
Write-Host -object "Skipping restore..."
return
}
$nuget = Locate-NuGet
$nugetConfig = Locate-NuGetConfig
$packagesPath = Locate-PackagesPath
$toolset = Locate-Toolset
$solution = Locate-Solution
Write-Host -object "Starting restore..."
& $nuget restore -packagesDirectory $packagesPath -msbuildVersion $msbuildVersion -verbosity quiet -nonInteractive -configFile $nugetConfig $toolset
& $nuget restore -packagesDirectory $packagesPath -msbuildVersion $msbuildVersion -verbosity quiet -nonInteractive -configFile $nugetConfig $solution
if ($lastExitCode -ne 0) {
throw "The restore failed with an exit code of '$lastExitCode'."
}
Write-Host -object "The restore completed successfully." -foregroundColor Green
}
function Perform-Test-x86 {
Write-Host -object ""
if ($skipTest -or $skipTest32) {
Write-Host -object "Skipping test x86..."
return
}
$xUnit = Locate-xUnit-x86
$xUnitLogPath = Locate-xUnitLogPath
$xUnitTestBinaries = @(Locate-xUnitTestBinaries)
Write-Host $xUnitTestBinaries
$xUnitResultLog = Join-Path -path $xUnitLogPath -childPath "xUnit-x86.xml"
Write-Host "$xUnit $xUnitTestBinaries -xml $xUnitResultLog"
& $xUnit @xUnitTestBinaries -xml $xUnitResultLog
if ($lastExitCode -ne 0) {
throw "The test failed with an exit code of '$lastExitCode'."
}
Write-Host -object "The test completed successfully." -foregroundColor Green
}
function Perform-Test-x64 {
Write-Host -object ""
if ($skipTest -or $skipTest64) {
Write-Host -object "Skipping test x64..."
return
}
$xUnit = Locate-xUnit-x64
$xUnitLogPath = Locate-xUnitLogPath
$xUnitTestBinaries = @(Locate-xUnitTestBinaries)
$xUnitResultLog = Join-Path -path $xUnitLogPath -childPath "xUnit-x64.xml"
Write-Host "$xUnit $xUnitTestBinaries -xml $xUnitResultLog"
& $xUnit @xUnitTestBinaries -xml $xUnitResultLog
if ($lastExitCode -ne 0) {
throw "The test failed with an exit code of '$lastExitCode'."
}
Write-Host -object "The test completed successfully." -foregroundColor Green
}
function Perform-Test-Core {
Write-Host -object ""
if ($skipTest -or $skipTestCore) {
Write-Host -object "Skipping test Core..."
return
}
$artifactsPath = Locate-ArtifactsPath
$binariesPath = Join-Path $artifactsPath "$configuration\bin\CoreTests"
$corerun = Join-Path $binariesPath "CoreRun.exe"
$xUnit = Join-Path $binariesPath "xunit.console.netcore.exe"
$xUnitLogPath = Locate-xUnitLogPath
$xUnitTestBinaries = @(Locate-xUnitTestBinaries)
Write-Host $xUnitTestBinaries
$xUnitResultLog = Join-Path -path $xUnitLogPath -childPath "xUnit-Core.xml"
Write-Host "$corerun $xUnit $xUnitTestBinaries -xml $xUnitResultLog"
& $corerun $xUnit @xUnitTestBinaries -xml $xUnitResultLog
if ($lastExitCode -ne 0) {
throw "The test failed with an exit code of '$lastExitCode'."
}
Write-Host -object "The test completed successfully." -foregroundColor Green
}
function Perform-Install-Roslyn-Vsixes {
Write-Host -object ""
if ($skipInstallRoslyn -or $skipTest -or (-not $integration)) {
Write-Host -object "Skipping installation of integration test vsixes..."
return
}
Write-Host "Starting to install vsixes..."
$vsixDeployExe = Locate-VsixDeployExe
& $vsixDeployExe
Write-Host -object "Installed integration test vsixes successfully." -foregroundColor Green
}
function Perform-Test-Integration {
Write-Host -object ""
if ($skipTest -or (-not $integration)) {
Write-Host -object "Skipping integration tests..."
return
}
$xUnit = Locate-xUnit-x64
$xUnitLogPath = Locate-xUnitLogPath
$xUnitTestBinaries = @(Locate-xUnitIntegrationTestBinaries)
$xUnitResultLog = Join-Path -path $xUnitLogPath -childPath "xUnit-integration.xml"
Write-Host -object "Starting integration tests..."
& $xUnit @xUnitTestBinaries -xml $xUnitResultLog -noshadow
if ($lastExitCode -ne 0) {
throw "The test failed with an exit code of '$lastExitCode'."
}
Write-Host -object "The test completed successfully." -foregroundColor Green
}
function Print-Help {
if (-not $help) {
return
}
Write-Host -object "TestImpact Build Script"
Write-Host -object " Help - [Switch] - Prints this help message."
Write-Host -object ""
Write-Host -object " Configuration - [String] - Specifies the build configuration. Defaults to 'Debug'."
Write-Host -object " DeployHive - [String] - Specifies the VSIX deployment hive. Defaults to 'TestImpact'."
Write-Host -object " MSBuildVersion - [String] - Specifies the MSBuild version. Defaults to '14.0'."
Write-Host -object " NuGetVersion - [String] - Specifies the NuGet version. Defaults to '3.5.0-beta'."
Write-Host -object " Target - [String] - Specifies the build target. Defaults to 'Build'."
Write-Host -object " TestFilter - [String] - Specifies the test filter. Defaults to '*.UnitTests.dll'."
Write-Host -object " IntegrationTestFilter - [String] - Specifies the integration test filter. Defaults to '*.IntegrationTests.dll'"
Write-Host -object " xUnitVersion - [String] - Specifies the xUnit version. Defaults to '2.1.0'."
Write-Host -object ""
Write-Host -object " Official - [Switch] - Indicates this is an official build which changes the semantic version."
Write-Host -object " SkipBuild - [Switch] - Indicates the build step should be skipped."
Write-Host -object " SkipDeploy - [Switch] - Indicates the VSIX deployment step should be skipped."
Write-Host -object " SkipInstallRoslyn - [Switch] - Indicates the installation of Roslyn VSIX step should be skipped."
Write-Host -object " SkipRestore - [Switch] - Indicates the restore step should be skipped."
Write-Host -object " SkipTest - [Switch] - Indicates the test step should be skipped."
Write-Host -object " SkipTest32 - [Switch] - Indicates the 32-bit Unit Tests should be skipped."
Write-Host -object " SkipTest64 - [Switch] - Indicates the 64-bit Unit Tests should be skipped."
Write-Host -object " SkipTestCore - [Switch] - Indicates the Core CLR Unit Tests should be skipped."
Write-Host -object " Integration - [Switch] - Indicates the Integration Tests should be run."
Exit 0
}
# Enforce deployment when running integration tests.
# This ensures that installed extension's timestamp is the same as in the artifacts folder.
if ((-not $skipTest) -and $integration) {
$skipBuild = $false
$skipDeploy = $false
}
Print-Help
Perform-Restore
Perform-Build
Perform-Install-Roslyn-Vsixes
Perform-Test-x86
Perform-Test-x64
Perform-Test-Integration

Просмотреть файл

@ -3,8 +3,8 @@
import jobs.generation.Utilities;
static getJobName(def opsysName, def configName, def testName) {
return "${opsysName}_${configName}_${testName}"
static getJobName(def opsysName, def configName) {
return "${opsysName}_${configName}"
}
static addArchival(def job, def filesToArchive, def filesToExclude) {
@ -14,130 +14,28 @@ static addArchival(def job, def filesToArchive, def filesToExclude) {
Utilities.addArchival(job, filesToArchive, filesToExclude, doNotFailIfNothingArchived, archiveOnlyIfSuccessful)
}
static addGithubPRTriggerForBranch(def job, def branchName, def jobName, def testName) {
static addGithubPRTriggerForBranch(def job, def branchName, def jobName) {
def prContext = "prtest/${jobName.replace('_', '/')}"
def triggerPhrase = "(?i).*test\\W+${prContext}.*"
def triggerOnPhraseOnly = (testName != 'build')
def triggerPhrase = "(?i)^\\s*(@?dotnet-bot\\s+)?(re)?test\\s+(${prContext})(\\s+please)?\\s*\$"
def triggerOnPhraseOnly = false
Utilities.addGithubPRTriggerForBranch(job, branchName, prContext, triggerPhrase, triggerOnPhraseOnly)
}
static addGithubPRCommitStatusForBranch(def job, def branchName, def jobName, def testName) {
def prContext = "prtest/${jobName.replace('_', '/')}"
job.with {
wrappers {
downstreamCommitStatus {
context(prContext)
}
}
}
}
static addXUnitDotNETResults(def job, def configName) {
def resultFilePattern = "**/artifacts/${configName}/log/xUnit-*.xml"
def resultFilePattern = "**/artifacts/${configName}/TestResults/*.xml"
def skipIfNoTestFiles = false
Utilities.addXUnitDotNETResults(job, resultFilePattern, skipIfNoTestFiles)
}
static addExtendedEmailPublisher(def job) {
job.with {
publishers {
extendedEmail {
defaultContent('$DEFAULT_CONTENT')
defaultSubject('$DEFAULT_SUBJECT')
recipientList('$DEFAULT_RECIPIENTS, cc:tomat@microsoft.com')
triggers {
aborted {
content('$PROJECT_DEFAULT_CONTENT')
sendTo {
culprits()
developers()
recipientList()
requester()
}
subject('$PROJECT_DEFAULT_SUBJECT')
}
failure {
content('$PROJECT_DEFAULT_CONTENT')
sendTo {
culprits()
developers()
recipientList()
requester()
}
subject('$PROJECT_DEFAULT_SUBJECT')
}
}
}
}
}
}
static addBuildSteps(def job, def projectName, def opsysName, def configName, def isPR) {
def unit32JobName = getJobName(opsysName, configName, 'unit32')
def unit32FullJobName = Utilities.getFullJobName(projectName, unit32JobName, isPR)
def unit64JobName = getJobName(opsysName, configName, 'unit64')
def unit64FullJobName = Utilities.getFullJobName(projectName, unit64JobName, isPR)
def downstreamFullJobNames = "${unit32FullJobName}, ${unit64FullJobName}"
def officialSwitch = ''
if (!isPR) {
officialSwitch = '-Official'
}
job.with {
steps {
batchFile("""set TEMP=%WORKSPACE%\\artifacts\\${configName}\\tmp
mkdir %TEMP%
set TMP=%TEMP%
.\\Build.cmd -Configuration ${configName} -msbuildVersion '14.0' ${officialSwitch} -SkipDeploy -SkipTest
""")
publishers {
downstreamParameterized {
trigger(downstreamFullJobNames) {
condition('UNSTABLE_OR_BETTER')
parameters {
currentBuild()
gitRevision()
}
}
}
}
}
}
}
static addTestSteps(def job, def projectName, def opsysName, def configName, def testName, def isPR, def filesToArchive, def filesToExclude) {
def buildJobName = getJobName(opsysName, configName, 'build')
def buildJobName = getJobName(opsysName, configName)
def buildFullJobName = Utilities.getFullJobName(projectName, buildJobName, isPR)
def officialSwitch = ''
if (!isPR) {
officialSwitch = '-Official'
}
job.with {
steps {
copyArtifacts(buildFullJobName) {
includePatterns(filesToArchive)
excludePatterns(filesToExclude)
buildSelector {
upstreamBuild {
fallbackToLastSuccessful(false)
}
}
}
batchFile("""set TEMP=%WORKSPACE%\\artifacts\\${configName}\\tmp
mkdir %TEMP%
set TMP=%TEMP%
.\\Build.cmd -Configuration ${configName} -msbuildVersion '14.0' ${officialSwitch} -SkipBuild ${testName == 'unit32' ? '-SkipTest64 -SkipTestCore' : (testName == 'core' ? '-SkipTest32 -SkipTest64' : '-SkipTest32 -SkipTestCore')}
""")
batchFile(""".\\CIBuild.cmd -configuration ${configName}""")
}
}
}
@ -145,51 +43,31 @@ set TMP=%TEMP%
[true, false].each { isPR ->
['windows'].each { opsysName ->
['debug', 'release'].each { configName ->
['build', 'unit32', 'unit64'].each { testName ->
def projectName = GithubProject
def projectName = GithubProject
def branchName = GithubBranchName
def branchName = GithubBranchName
def filesToArchive = "**/artifacts/${configName}/**"
def filesToExclude = "**/artifacts/${configName}/obj/**"
def filesToArchive = "**/artifacts/${configName}/**"
def filesToExclude = "**/artifacts/${configName}/obj/**"
def jobName = getJobName(opsysName, configName, testName)
def fullJobName = Utilities.getFullJobName(projectName, jobName, isPR)
def myJob = job(fullJobName)
def jobName = getJobName(opsysName, configName)
def fullJobName = Utilities.getFullJobName(projectName, jobName, isPR)
def myJob = job(fullJobName)
Utilities.standardJobSetup(myJob, projectName, isPR, "*/${branchName}")
Utilities.standardJobSetup(myJob, projectName, isPR, "*/${branchName}")
if (testName == 'build') {
if (isPR) {
addGithubPRTriggerForBranch(myJob, branchName, jobName, testName)
} else {
Utilities.addGithubPushTrigger(myJob)
}
}
else {
if (isPR) {
addGithubPRCommitStatusForBranch(myJob, branchName, jobName, testName)
}
}
addArchival(myJob, filesToArchive, filesToExclude)
if (testName != 'build') {
addXUnitDotNETResults(myJob, configName)
}
Utilities.setMachineAffinity(myJob, 'Windows_NT', 'latest-or-auto')
if (!isPR) {
addExtendedEmailPublisher(myJob)
}
if (testName == 'build') {
addBuildSteps(myJob, projectName, opsysName, configName, isPR)
} else {
addTestSteps(myJob, projectName, opsysName, configName, testName, isPR, filesToArchive, filesToExclude)
}
if (isPR) {
addGithubPRTriggerForBranch(myJob, branchName, jobName)
} else {
Utilities.addGithubPushTrigger(myJob)
}
addArchival(myJob, filesToArchive, filesToExclude)
addXUnitDotNETResults(myJob, configName)
Utilities.setMachineAffinity(myJob, 'Windows_NT', 'latest-or-auto-dev15-0')
addBuildSteps(myJob, projectName, opsysName, configName, isPR)
}
}
}

17
src/Directory.Build.props Normal file
Просмотреть файл

@ -0,0 +1,17 @@
<!-- 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>
<Import Project="..\Directory.Build.props"/>
<!-- This file is imported by all projects at the beginning of the project files -->
<Import Project="$(RepoToolsetDir)Settings.props" />
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>embedded</DebugType>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,7 @@
<!-- 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>
<!-- This file is imported by all projects at the end of the project files -->
<Import Project="$(RepoToolsetDir)Imports.targets" />
<!-- Source link -->
<Import Project="$(NuGetPackageRoot)SourceLink.Create.CommandLine\$(SourceLinkCreateCommandLineVersion)\build\SourceLink.Create.CommandLine.targets" />
</Project>

Просмотреть файл

@ -1,41 +1,16 @@
<?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="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup>
<Import Project="..\..\build\Targets\Settings.targets" />
</ImportGroup>
<!-- 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 Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{D9CAEB67-A062-4874-96E9-51BAF1373EBB}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.DiaSymReader.UnitTests</RootNamespace>
<AssemblyName>Microsoft.DiaSymReader.UnitTests</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworks>net46;netcoreapp1.1</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<!--
We would need to download 32bit dotnet cli, which would add extra time to PR runs
Testing 64bit only on Desktop suffixiently covers our interop code paths.
-->
<TestArchitectures Condition="'$(TargetFramework)' == 'net46'">x64;x86</TestArchitectures>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
<ItemGroup>
<ProjectReference Include="..\Microsoft.DiaSymReader\Portable\Microsoft.DiaSymReader.Portable.csproj">
<Project>{316FD2AD-8514-41BD-98D5-61A821F3320E}</Project>
<Name>Microsoft.DiaSymReader</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.DiaSymReader\Microsoft.DiaSymReader.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
<None Include="Microsoft.DiaSymReader.UnitTests.xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Compile Include="SymUnmanagedStreamFactoryTests.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ImportGroup>
<Import Project="..\..\build\Targets\Imports.targets" />
<Import Project="..\..\build\Toolset\XunitProjectRunAction.targets" />
</ImportGroup>
</Project>

Просмотреть файл

@ -1,13 +0,0 @@
{
"dependencies": {
"xunit": "2.1.0",
"xunit.runner.console": "2.1.0",
"xunit.runner.visualstudio": "2.1.0"
},
"frameworks": {
"net45": {}
},
"runtimes": {
"win": { }
}
}

Просмотреть файл

@ -0,0 +1,15 @@
<!-- 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 Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.1;net20</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>true</IsPackable>
<Description>Microsoft DiaSymReader interop interfaces and utilities.</Description>
<PackageReleaseNotes>Microsoft DiaSymReader interop interfaces and utilities</PackageReleaseNotes>
<PackageTags>DiaSymReader ISymUnmanagedReader PDB COM interop debugging</PackageTags>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.DiaSymReader.UnitTests" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>f9127f0f-95c8-4576-8081-96e004c1652f</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>Microsoft.DiaSymReader</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Extensions\InteropUtilities.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\ComStreamWrapper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedAsyncStepInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedExtensions.Namespace.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedExtensions.Constant.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedExtensions.Variable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedExtensions.Scope.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedExtensions.Document.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedExtensions.Method.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedExtensions.Reader.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedExtensions.Binder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedSequencePoint.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\SymUnmanagedStreamFactory.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Metadata\IMetadataImport.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedEncUpdate.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedBinder3.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Metadata\IMetadataImportProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedBinder4.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedReader4.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedReader5.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedSourceServerModule.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Metadata\MetadataImportFieldOffset.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SymUnmanagedLineDelta.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SymUnmanagedSearchPolicy.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymEncUnmanagedMethod.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedAsyncMethod.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedBinder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedBinder2.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedConstant.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedDispose.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedDocument.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedMethod.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedNamespace.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedReader.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedReader2.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedReader3.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedScope.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedScope2.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ISymUnmanagedVariable.cs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>f9127f0f-95c8-4576-8081-96e004c1652f</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="Microsoft.DiaSymReader.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,10 @@
#if NET20
namespace System.Runtime.CompilerServices
{
/// <summary>
/// Indicates that a method is an extension method, or that a class or assembly contains extension methods.
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Assembly)]
internal sealed class ExtensionAttribute : Attribute { }
}
#endif

Просмотреть файл

@ -0,0 +1,48 @@
{
"locked": false,
"version": 2,
"targets": {
".NETFramework,Version=v2.0": {
"Microsoft.NetFX20/1.0.3": {
"type": "package",
"compile": {
"lib/net20/mscorlib.dll": {}
},
"runtime": {
"lib/net20/mscorlib.dll": {}
}
}
},
".NETFramework,Version=v2.0/win": {
"Microsoft.NetFX20/1.0.3": {
"type": "package",
"compile": {
"lib/net20/mscorlib.dll": {}
},
"runtime": {
"lib/net20/mscorlib.dll": {}
}
}
}
},
"libraries": {
"Microsoft.NetFX20/1.0.3": {
"sha512": "7hPxu4q65ap1yiAuniskpMIJyTwviBIRItCYXozm/6Ikt03Uw3NNQNNzf7mjOEYYi9CG9VIv1KYwBGEa3FWAcg==",
"type": "package",
"path": "Microsoft.NetFX20/1.0.3",
"files": [
"Microsoft.NetFX20.1.0.3.nupkg.sha512",
"Microsoft.NetFX20.nuspec",
"lib/net20/mscorlib.dll"
]
}
},
"projectFileDependencyGroups": {
"": [
"Microsoft.NetFX20 >= 1.0.3"
],
".NETFramework,Version=v2.0": []
},
"tools": {},
"projectFileToolGroups": {}
}