This commit is contained in:
Tomas Matousek 2016-07-08 15:10:09 -07:00
Родитель 43c267c185
Коммит ec7b87536c
73 изменённых файлов: 1104 добавлений и 644 удалений

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

@ -8,7 +8,7 @@
.vs/
# Build results
[Bb]inaries/
[Aa]rtifacts/
[Dd]ebug/
[Rr]elease/
x64/

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

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

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

@ -2,26 +2,22 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<configuration>
<packageRestore>
<!-- Currently, the repository's version of NuGet.exe and Visual Studio's version
fight over the format of project.lock.json because the one in the respository
is newer. To prevent that, turn off package restore. -->
<add key="automatic" value="false" />
</packageRestore>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<config>
<add key="repositoryPath" value="../packages" />
<add key="dependencyVersion" value="HighestMinor" />
</config>
<packageSources>
<clear />
<add key="myget.org dotnet-coreclr" value="https://www.myget.org/F/dotnet-coreclr/api/v3/index.json" />
<add key="myget.org dotnet-core" value="https://www.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="myget.org dotnet-corefxtestdata" value="https://www.myget.org/F/dotnet-corefxtestdata/api/v3/index.json" />
<add key="myget.org dotnet-buildtools" value="https://www.myget.org/F/dotnet-buildtools/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="myget.org dotnet-buildtools" value="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
<add key="myget.org dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="myget.org roslyn-master-nightly" value="https://dotnet.myget.org/F/roslyn-master-nightly/api/v3/index.json" />
</packageSources>
<packageRestore>
<!-- Automated package restore in VS does not work at this time with
this project and it causes build failures. Disable it. -->
<add key="automatic" value="false" />
</packageRestore>
</configuration>

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

@ -1,18 +1 @@
@echo off
@setlocal
set NuGetExe="%~dp0NuGet.exe"
set NuGetAdditionalCommandLineArgs=-verbosity quiet -configfile "%~dp0nuget.config" -Project2ProjectTimeOut 1200
set Solution=%~dp0SymReader.sln
echo Restoring packages: Toolsets
call %NugetExe% restore "%~dp0build\ToolsetPackages\project.json" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed
echo Restoring packages: %Solution%
call %NugetExe% restore "%Solution%" %NuGetAdditionalCommandLineArgs% || goto :RestoreFailed
exit /b 0
:RestoreFailed
echo Restore failed with ERRORLEVEL %ERRORLEVEL%
exit /b 1
@call %~dp0build.cmd -skipBuild -skipTest %*

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

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.DiaSymReader", "src\Microsoft.DiaSymReader\Microsoft.DiaSymReader.shproj", "{F9127F0F-95C8-4576-8081-96E004C1652F}"
EndProject
@ -9,11 +9,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.DiaSymReader.NetF
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}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Microsoft.DiaSymReader\Microsoft.DiaSymReader.projitems*{fa2c8969-bd1f-457a-a6e3-ca772135ff73}*SharedItemsImports = 4
src\Microsoft.DiaSymReader\Microsoft.DiaSymReader.projitems*{316fd2ad-8514-41bd-98d5-61a821f3320e}*SharedItemsImports = 4
src\Microsoft.DiaSymReader\Microsoft.DiaSymReader.projitems*{f9127f0f-95c8-4576-8081-96e004c1652f}*SharedItemsImports = 13
src\Microsoft.DiaSymReader\Microsoft.DiaSymReader.projitems*{fa2c8969-bd1f-457a-a6e3-ca772135ff73}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -28,6 +30,10 @@ Global
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

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

@ -0,0 +1 @@
@call %~dp0build.cmd -skipRestore -skipBuild %*

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

@ -1,21 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup>
<Import Project="..\Targets\Settings.targets" />
<Import Project="..\Targets\Signing.targets" />
<Import Project="..\Targets\Dependencies.props"/>
<Import Project="..\Targets\Layout.props" />
<Import Project="..\Toolset\MicroBuild.props" />
</ImportGroup>
<ItemGroup>
<AssembliesToSign Include="$(OutDir)NetFX20\Microsoft.DiaSymReader.dll">
<AuthenticodeCertificateName>MicrosoftSHA1Win8WinBlue</AuthenticodeCertificateName>
<ItemGroup>
<AssembliesToSign Include="$(OutDirBase)Microsoft.DiaSymReader\NetFX20\Microsoft.DiaSymReader.dll">
<AuthenticodeCertificateName>MicrosoftSHA1Win8WinBlue</AuthenticodeCertificateName>
</AssembliesToSign>
<AssembliesToSign Include="$(OutDir)Portable\Microsoft.DiaSymReader.dll">
<AuthenticodeCertificateName>WindowsPhone623</AuthenticodeCertificateName>
<AssembliesToSign Include="$(OutDirBase)Microsoft.DiaSymReader\Portable\Microsoft.DiaSymReader.dll">
<AuthenticodeCertificateName>WindowsPhone623</AuthenticodeCertificateName>
</AssembliesToSign>
</ItemGroup>
<UsingTask TaskName="SignFiles" AssemblyFile="$(MicroBuildSigningLibrary)"/>
<Target Name="Build">
<ItemGroup>
<AssembliesToSign>
@ -25,10 +24,9 @@
</ItemGroup>
<Message Text="Signing using authenticode certificate '%(AssembliesToSign.AuthenticodeCertificateName)' for @(AssembliesToSign)"/>
<Message Text="OutDir: $(OutDir); Inter: $(MSBuildProjectDirectory)\obj\Signing; $(SignType)"/>
<SignFiles Files="@(AssembliesToSign)"
BinariesDirectory="$(OutDir)"
IntermediatesDirectory="$(MSBuildProjectDirectory)\obj\Signing"
BinariesDirectory="$(OutDirBase)"
IntermediatesDirectory="$(IntermediateOutputPath)"
Type="$(SignType)" />
</Target>
</Project>

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

@ -0,0 +1,51 @@
<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>

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

@ -0,0 +1,12 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MicroBuildCoreVersion>0.2.0</MicroBuildCoreVersion>
<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,99 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- ====================================================================================
Generation of InternalsVisibleTo attributes from the project
==================================================================================== -->
<PropertyGroup>
<GeneratedInternalsVisibleToFile>$(IntermediateOutputPath)GeneratedInternalsVisibleTo$(DefaultLanguageSourceExtension)</GeneratedInternalsVisibleToFile>
</PropertyGroup>
<PropertyGroup>
<CoreCompileDependsOn>GenerateInternalsVisibleToFile;$(CoreCompileDependsOn)</CoreCompileDependsOn>
</PropertyGroup>
<ItemDefinitionGroup>
<InternalsVisibleTo>
<Visible>false</Visible>
</InternalsVisibleTo>
<InternalsVisibleToTest>
<Visible>false</Visible>
</InternalsVisibleToTest>
<InternalsVisibleToTypeScript>
<Visible>false</Visible>
</InternalsVisibleToTypeScript>
<InternalsVisibleToFSharp>
<Visible>false</Visible>
</InternalsVisibleToFSharp>
<InternalsVisibleToMoq>
<Visible>false</Visible>
</InternalsVisibleToMoq>
</ItemDefinitionGroup>
<PropertyGroup Condition="'$(PublicKey)' != '' and '$(SignAssembly)' == 'True'">
<InternalsVisibleToSuffix>, PublicKey=$(PublicKey)</InternalsVisibleToSuffix>
<InternalsVisibleToTestSuffix>, PublicKey=$(RoslynInternalKey)</InternalsVisibleToTestSuffix>
</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)' != '' OR '@(InternalsVisibleToTest)' != '' OR '@(InternalsVisibleToTypeScript)' != '' OR '@(InternalsVisibleToFSharp)' != '' OR '@(InternalsVisibleToMoq)' != ''">
<!--
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>
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"
AdditionalMetadata="_Parameter1=%(InternalsVisibleToTest.Identity)$(InternalsVisibleToTestSuffix)"
Condition="'@(InternalsVisibleToTest)' != ''">
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
</CreateItem>
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"
AdditionalMetadata="_Parameter1=%(InternalsVisibleToTypeScript.Identity), PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293"
Condition="'@(InternalsVisibleToTypeScript)' != ''">
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
</CreateItem>
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"
AdditionalMetadata="_Parameter1=%(InternalsVisibleToFSharp.Identity), PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293"
Condition="'@(InternalsVisibleToFSharp)' != ''">
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
</CreateItem>
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"
AdditionalMetadata="_Parameter1=%(InternalsVisibleToMoq.Identity), PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7"
Condition="'@(InternalsVisibleToMoq)' != ''">
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
</CreateItem>
<!-- The necessity of this Task is tracked by https://github.com/dotnet/roslyn/issues/8421 -->
<WriteCodeFragmentEx
AssemblyAttributes="@(InternalsVisibleToAttribute)"
Language="$(Language)"
OutputFile="$(GeneratedInternalsVisibleToFile)">
<Output TaskParameter="OutputFile" ItemName="Compile" />
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragmentEx>
</Target>
</Project>

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

@ -1,49 +1,10 @@
<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 -->
<PropertyGroup>
<OutputPath>$(OutDir)</OutputPath>
<DocumentationFile Condition="'$(DocumentationFile)' == '' AND '$(NoDocumentationFile)' != 'true' AND '$(Nonshipping)' != 'true' AND '$(ProjectLanguage)' == 'VB' AND '$(AssemblyName)' != ''">$(AssemblyName).xml</DocumentationFile>
<DocumentationFile Condition="'$(DocumentationFile)' == '' AND '$(NoDocumentationFile)' != 'true' AND '$(Nonshipping)' != 'true' AND '$(ProjectLanguage)' == 'CSharp' AND '$(AssemblyName)' != ''">$(OutputPath)$(AssemblyName).xml</DocumentationFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.VisualBasic.targets"
Condition="'$(ProjectLanguage)' == 'VB' And '$(TargetFrameworkIdentifier)' == '.NETPortable'"/>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets"
Condition="'$(ProjectLanguage)' == 'CSharp' And '$(TargetFrameworkIdentifier)' == '.NETPortable'"/>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets"
Condition="'$(ProjectLanguage)' == 'VB' And '$(TargetFrameworkIdentifier)' != '.NETPortable'" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"
Condition="'$(ProjectLanguage)' == 'CSharp' And '$(TargetFrameworkIdentifier)' != '.NETPortable'" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" Condition="'$(ProjectLanguage)' == 'C++'" />
<!-- On Mono on *nix the NuGet targets aren't imported by default, so we do that here -->
<Import Project="$(MSBuildExtensionsPath)\Microsoft\NuGet\Microsoft.NuGet.targets" Condition="'$(OS)' != 'Windows_NT'" />
<!-- It looks like MSBuild has a bug on *nix where they aggressively
directory separators from '\' to '/', even when the '\'
is being used as an escape character in a define constant in VB.
This change works around the bug by removing all quotes from
define constants after Microsoft.VisualBasic.CurrentVersion adds
them in our build. This should be OK since none of our constants
should require quoting. See https://github.com/Microsoft/msbuild/issues/137 -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<FinalDefineConstants>$(FinalDefineConstants.Replace('"', ''))</FinalDefineConstants>
</PropertyGroup>
<PropertyGroup>
<BuildDependsOn>
$(BuildDependsOn);
CopyCppOutputBackToIntDir;
</BuildDependsOn>
</PropertyGroup>
<!-- A task for C++ projects to copy their output back under obj\Debug or the like. This is slightly hacky. -->
<Target
Name="CopyCppOutputBackToIntDir" Condition="'$(ProjectLanguage)' == 'C++'">
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(IntDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="$(OutDir)$(TargetName).pdb" DestinationFolder="$(IntDir)" SkipUnchangedFiles="true" Condition="Exists('$(OutDir)$(TargetName).pdb')" />
</Target>
<Import Project="..\Signing\StrongName.targets"/>
<Import Project="..\Toolset\DefaultImports.targets"/>
<Import Project="..\Toolset\GenerateAssemblyInfo.targets" />
<Import Project="..\Toolset\GenerateInternalsVisibleTo.targets" />
</Project>

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

@ -1,305 +1,7 @@
<Project DefaultTargets="Build" InitialTargets="RestoreToolsetCheck" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="OutDir;Configuration">
<Import Project="$(MSBuildThisFileDirectory)\..\..\Version.props"/>
<PropertyGroup>
<ProjectDir>$(MSBuildThisFileDirectory)..\..\</ProjectDir>
<NuGetToolPath Condition="">$(ProjectDir)nuget.exe</NuGetToolPath>
<ToolsetPackagesDir>$(ProjectDir)build\ToolsetPackages\</ToolsetPackagesDir>
<ToolsetPackagesSemaphore>$(ToolsetPackagesDir)toolsetpackages.semaphore</ToolsetPackagesSemaphore>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">$(NUGET_PACKAGES)</NuGetPackageRoot> <!-- Respect environment variable if set -->
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' and
'$(OS)' == 'Windows_NT'">$(UserProfile)\.nuget\packages</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' and
'$(OS)' != 'Windows_NT'">$(HOME)\.nuget\packages</NuGetPackageRoot>
<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. -->
<!--
$(OS) is only specific enough for windows builds. For non-windows builds the identifier
is specified on the command line of MSBuild
-->
<BaseNuGetRuntimeIdentifier Condition="'$(OS)' == 'Windows_NT'">win7</BaseNuGetRuntimeIdentifier>
</PropertyGroup>
<!-- Import the global NuGet packages -->
<PropertyGroup>
<ToolsetCompilerPackageName>Microsoft.Net.Compilers</ToolsetCompilerPackageName>
<ToolsetCompilerPropsFilePath>$(NuGetPackageRoot)\Microsoft.Net.Compilers\1.2.0-rc\build\Microsoft.Net.Compilers.props</ToolsetCompilerPropsFilePath>
<RoslynDiagnosticsPropsFilePath>$(NuGetPackageRoot)\Microsoft.Net.RoslynDiagnostics\1.1.1-beta1-20150818-01\build\Microsoft.Net.RoslynDiagnostics.props</RoslynDiagnosticsPropsFilePath>
<RoslynBuildUtilFilePath>$(NuGetPackageRoot)\Roslyn.Build.Util\0.9.4-portable\lib\dotnet\Roslyn.MSBuild.Util.dll</RoslynBuildUtilFilePath>
<AdditionalFileItemNames>$(AdditionalFileItemNames);PublicAPI</AdditionalFileItemNames>
</PropertyGroup>
<!--
Roslyn uses the WriteCodeFragment task to output generated assembly attributes. In MSBuild 14.0 update 1 this task
produces non-deterministic output. This is fixed in update 2 but until that is released we use a hand patched
version of the Task that is deterministic.
MSBuild bug: https://github.com/Microsoft/msbuild/issues/408
Bug tracking removing this: https://github.com/dotnet/roslyn/issues/8421
-->
<UsingTask TaskName="Roslyn.MSBuild.Util.WriteCodeFragmentEx"
AssemblyFile="$(RoslynBuildUtilFilePath)" />
<Target Name="RestoreToolsetCheck"
Condition="'$(BuildingProject)' == 'true'">
<Error Text="Toolset packages have not been restored, run Restore.cmd before building"
Condition="!Exists('$(ToolsetCompilerPropsFilePath)')" />
</Target>
<!-- Prevent vsix manifests from being copied to the shared output directory, makes build more deterministic -->
<PropertyGroup>
<CopyVsixManifestToOutput>false</CopyVsixManifestToOutput>
</PropertyGroup>
<!-- Point to the reference assemblies on unix -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<TargetFrameworkRootPath>$(MSBuildBinPath)\reference-assemblies\Framework</TargetFrameworkRootPath>
</PropertyGroup>
<!-- This file is imported by all projects at the beginning of the project files -->
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props') AND '$(MSBuildProjectExtension)' != '.vcxproj'" />
<!-- NuGet props aren't imported by default on *nix so we do that here -->
<Import Project="$(MSBuildExtensionsPath)\Microsoft\NuGet\Microsoft.NuGet.props"
Condition="'$(OS)' != 'Windows_NT'" />
<!-- The /publicsign argument is required for the compiler, but the current MSBuild
build task can't be redirected and even if it could the new build task is not
built against the xplat MSBuild references so it can't be loaded properly. Providing
a response file works around the problem by directly adding the public sign argument
to all unix compilations. This shouldn't present a problem as it's impossible to
fully sign on unix at the moment anyway. Tracked by #7756. -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<CompilerResponseFile>$(MSBuildThisFileDirectory)..\unix\extra_unix_args.rsp</CompilerResponseFile>
</PropertyGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
</PropertyGroup>
<PropertyGroup>
<VisualStudioReferenceMajorVersion Condition="'$(VisualStudioReferenceMajorVersion)' == ''">$(VisualStudioVersion.Substring(0, $(VisualStudioVersion.IndexOf('.'))))</VisualStudioReferenceMajorVersion>
<VisualStudioReferenceAssemblyVersion Condition="'$(VisualStudioReferenceAssemblyVersion)' == ''">$(VisualStudioReferenceMajorVersion).0.0.0</VisualStudioReferenceAssemblyVersion>
<VisualStudioCodename>Dev$(VisualStudioReferenceMajorVersion)</VisualStudioCodename>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
<VSLToolsPath Condition="'$(VSLToolsPath)' == ''">$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..'))</VSLToolsPath>
<VSLTargetsPath Condition="'$(VSLTargetsPath)' == ''">$(MSBuildThisFileDirectory)</VSLTargetsPath>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<SignAssembly Condition="'$(SignAssembly)' == ''">true</SignAssembly>
<UseRoslynAnalyzers Condition="'$(UseRoslynAnalyzers)' == ''">true</UseRoslynAnalyzers>
<Deterministic>True</Deterministic>
<!-- Only portable PDBs are supported xplat -->
<DebugType Condition="'$(OS)' != 'Windows_NT'">portable</DebugType>
<DebugType Condition="'$(OS)' == 'Windows_NT'">pdbonly</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(VSCOMNTOOLS)' == ''">
<VSCOMNTOOLS>$([System.Environment]::ExpandEnvironmentVariables("%VS$(VisualStudioReferenceMajorVersion)0COMNTOOLS%"))</VSCOMNTOOLS>
</PropertyGroup>
<PropertyGroup Condition="'$(DevEnvDir)' == ''">
<DevEnvDir>$(VSCOMNTOOLS)\..\IDE</DevEnvDir>
<DevEnvDir>$([System.IO.Path]::GetFullPath('$(DevEnvDir)'))</DevEnvDir>
</PropertyGroup>
<Choose>
<When Condition="'$(VisualStudioVersion)' == '12.0'">
<PropertyGroup>
<MSBuildAssemblyNameFragment>v12.0</MSBuildAssemblyNameFragment>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<MSBuildAssemblyNameFragment>Core</MSBuildAssemblyNameFragment>
</PropertyGroup>
</Otherwise>
</Choose>
<!-- Build reliability -->
<PropertyGroup>
<OverwriteReadOnlyFiles Condition="'$(OverwriteReadOnlyFiles)' == ''">true</OverwriteReadOnlyFiles>
</PropertyGroup>
<!-- Project language -->
<PropertyGroup Condition="'$(ProjectLanguage)' == ''">
<ProjectLanguage Condition="'$(MSBuildProjectExtension)' == '.csproj' OR '$(Language)' == 'C#'">CSharp</ProjectLanguage>
<ProjectLanguage Condition="'$(MSBuildProjectExtension)' == '.vbproj' OR '$(Language)' == 'VB'">VB</ProjectLanguage>
<ProjectLanguage Condition="'$(MSBuildProjectExtension)' == '.vcxproj' OR '$(Language)' == 'C++'">C++</ProjectLanguage>
</PropertyGroup>
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<!-- Use the compiler server -->
<UseSharedCompilation>true</UseSharedCompilation>
</PropertyGroup>
<!-- Import the props files from the toolset NuGet packages if we're not in a bootstrap build -->
<ImportGroup Label="GlobalNuGets" Condition="'$(BootstrapBuildPath)' == ''">
<Import Project="$(ToolsetCompilerPropsFilePath)"
Condition="Exists('$(ToolsetCompilerPropsFilePath)') And '$(OS)' == 'Windows_NT'" />
</ImportGroup>
<ImportGroup>
<Import Project="$(RoslynDiagnosticsPropsFilePath)"
Condition="Exists('$(RoslynDiagnosticsPropsFilePath)') And ('$(UseRoslynAnalyzers)' == 'true')" />
</ImportGroup>
<!-- Otherwise, use the task from the bootstrap location. This is necessary
to support new properties on the build task. -->
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.Csc"
AssemblyFile="$(BootstrapBuildPath)\Microsoft.Build.Tasks.CodeAnalysis.dll"
Condition="'$(BootstrapBuildPath)' != ''" />
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.Vbc"
AssemblyFile="$(BootstrapBuildPath)\Microsoft.Build.Tasks.CodeAnalysis.dll"
Condition="'$(BootstrapBuildPath)' != ''" />
<PropertyGroup Condition="'$(BootstrapBuildPath)' != ''">
<UseSharedCompilation>true</UseSharedCompilation>
<CSharpCoreTargetsPath>$(BootstrapBuildPath)\Microsoft.CSharp.Core.targets</CSharpCoreTargetsPath>
<VisualBasicCoreTargetsPath>$(BootstrapBuildPath)\Microsoft.VisualBasic.Core.targets</VisualBasicCoreTargetsPath>
</PropertyGroup>
<!-- Common project settings -->
<PropertyGroup>
<DeployToSamplesSubfolder Condition="'$(DeployToSamplesSubfolder)' == ''">false</DeployToSamplesSubfolder>
<FileAlignment>512</FileAlignment>
<HighEntropyVA>true</HighEntropyVA>
</PropertyGroup>
<!--
If TargetNetFX20 is true the project targets Framework 2.0 reference assemblies provided by Microsoft.NetFX20 nuget package.
Use the latest Framework toolset to build, but set msbuild properties below
so to avoid 4.5 specific artifacts to be added to the compilation (references, attributes).
-->
<PropertyGroup Condition="'$(TargetNetFX20)' == 'true'">
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<NoStdLib>true</NoStdLib>
<FrameworkPathOverride>$(NuGetPackageRoot)\Microsoft.NetFX20\1.0.3\lib\net20</FrameworkPathOverride>
<NuGetTargetMoniker>.NETFramework,Version=v2.0</NuGetTargetMoniker>
</PropertyGroup>
<ItemGroup Condition="'$(ProjectLanguage)' == 'CSharp' AND '$(TargetNetFX20)' == 'true'">
<_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
</ItemGroup>
<PropertyGroup>
<OutDir Condition="'$(OutDir)' == ''">$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\Binaries\$(Configuration)'))\</OutDir>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\Binaries\Obj\$(MSBuildProjectName)'))\</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup>
<!-- Capture the root, so we'll always have it even if we're building to a sub-folder -->
<VSLOutDir>$(OutDir)</VSLOutDir>
</PropertyGroup>
<PropertyGroup>
<CompilerGeneratorToolsDir>$(OutDir)CompilerGeneratorTools\</CompilerGeneratorToolsDir>
</PropertyGroup>
<PropertyGroup Condition="'$(DeployToSamplesSubfolder)' == 'true'">
<OutDir>$(OutDir)\Samples\$(MSBuildProjectName)</OutDir>
</PropertyGroup>
<PropertyGroup>
<!-- 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>
<Choose>
<!-- VB specific settings -->
<When Condition="'$(ProjectLanguage)' == 'VB'">
<PropertyGroup>
<MyType>Empty</MyType>
<OptionCompare>Binary</OptionCompare>
<OptionExplicit>On</OptionExplicit>
<OptionInfer>On</OptionInfer>
<OptionStrict>On</OptionStrict>
<RootNamespace></RootNamespace>
<VBRuntime>Embed</VBRuntime>
</PropertyGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
</ItemGroup>
<ItemGroup Condition="'$(TargetNetFX20)' != 'true'">
<Import Include="System.Linq" />
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
</PropertyGroup>
</When>
<!-- C# specific settings -->
<When Condition="'$(ProjectLanguage)' == 'CSharp'">
<PropertyGroup>
<WarningLevel>4</WarningLevel>
<ErrorReport>prompt</ErrorReport>
<!-- Suppress the following warnings by default for C# projects
1591: So far we've chosen to implicitly implement interfaces and as a consequence
the methods are public. We don't want to duplicate documentation for them
and hence suppress this warning until we get closer to release and a more
thorough documentation story
-->
<NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>
</When>
<!-- C++ specific settings -->
<When Condition="'$(ProjectLanguage)' == 'C++'">
<PropertyGroup>
<!-- Put intermediate outputs in the same place as managed projects for sanity -->
<IntDir>$(ProjectDir)obj\$(Configuration)\</IntDir>
<!-- We just always want to build with whatever toolset matches the VS you're building with -->
<PlatformToolset>v$(VisualStudioReferenceMajorVersion)0</PlatformToolset>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup>
<CopyVSReferencesToOutput>True</CopyVSReferencesToOutput>
<AuthenticodeCertificateName>Microsoft402</AuthenticodeCertificateName>
</PropertyGroup>
<!--
When running our determinism tests we need to copy the diagnostic file from the intermediate directory
to the location of the binary. This ensures .dll and .dll.key are next to each other to be picked up
by our test scripts
-->
<Target Name="CopyDeterministicBuildDiagnosticFile" Condition="'$(DebugDeterminism)' != ''" AfterTargets="CoreCompile">
<Copy
Condition="Exists(@(IntermediateAssembly -> '%(fullpath).key'))"
SourceFiles="@(IntermediateAssembly -> '%(fullpath).key')"
DestinationFolder="$(OutDir)" />
</Target>
</Project>
<Import Project="Version.props" />
<Import Project="Dependencies.props" />
<Import Project="..\Toolset\DefaultSettings.targets" />
</Project>

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

@ -1,74 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RoslynInternalKey>002400000480000094000000060200000024000052534131000400000100010055e0217eb635f69281051f9a823e0c7edd90f28063eb6c7a742a19b4f6139778ee0af438f47aed3b6e9f99838aa8dba689c7a71ddb860c96d923830b57bbd5cd6119406ddb9b002cf1c723bf272d6acbb7129e9d6dd5a5309c94e0ff4b2c884d45a55f475cd7dba59198086f61f5a8c8b5e601c0edbf269733f6f578fc8579c2</RoslynInternalKey>
</PropertyGroup>
<!-- settings for strong name signing -->
<PropertyGroup>
<MicroBuildSigningLibraryV1>$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll</MicroBuildSigningLibraryV1>
<MicroBuildSigningLibraryV2>$(BUILD_ARTIFACTSTAGINGDIRECTORY)\MicroBuild\Plugins\MicroBuild.Plugins.Signing.1.0.200\build\MicroBuild.Signing.dll</MicroBuildSigningLibraryV2>
<MicroBuildSigningLibrary Condition="Exists('$(MicroBuildSigningLibraryV1)')">$(MicroBuildSigningLibraryV1)</MicroBuildSigningLibrary>
<MicroBuildSigningLibrary Condition="Exists('$(MicroBuildSigningLibraryV2)')">$(MicroBuildSigningLibraryV2)</MicroBuildSigningLibrary>
<RunningInMicroBuild Condition="'$(MicroBuildSigningLibrary)' != ''">true</RunningInMicroBuild>
<ShouldSignBuild Condition="'$(RealSignBuild)' == 'true' OR ('$(RunningInMicroBuild)' == 'true' AND '$(SignType)' == 'real')">true</ShouldSignBuild>
</PropertyGroup>
<Choose>
<When Condition="'$(SignAssembly)' == 'true'">
<Choose>
<!-- Shipping binaries in an "official" build are delay-signed with the MS key; later, the signing
system will finish the strong-name signing. -->
<When Condition="'$(NonShipping)' != 'true'">
<Choose>
<!-- DelaySign if we're real signing, otherwise public sign -->
<When Condition="'$(ShouldSignBuild)' == 'true'">
<PropertyGroup>
<DelaySign>true</DelaySign>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<PublicSign>true</PublicSign>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\..\Strong Name Keys\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
<PublicKey>0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9</PublicKey>
<PublicKeyToken>31BF3856AD364E35</PublicKeyToken>
</PropertyGroup>
</When>
<!-- Non-shipping binaries are simply signed with the Roslyn internal key. -->
<Otherwise>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\..\Strong Name Keys\RoslynInternalKey.Private.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<PublicKey>$(RoslynInternalKey)</PublicKey>
<PublicKeyToken>fc793a00266884fb</PublicKeyToken>
</PropertyGroup>
</Otherwise>
</Choose>
</When>
</Choose>
<Target Name="VerifySigningFlags" BeforeTargets="CoreCompile">
<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>
<!-- Because https://github.com/dotnet/roslyn/issues/7812 is not yet fixed, the IDE doesn't know if we set the PublicSign
flag. As a result, all design-time builds will thing we're real-signing, which causes semantics to get all screwed up.
The workaround for now is, for design-time builds only, to pass the DelaySign flag since that's "good enough". This
must be done in a target versus conditioning on BuildingProject, since BuildingProject itself is correctly set in a
target. -->
<Target Name="FixPublicSignFlagForDesignTimeBuilds" BeforeTargets="CoreCompile" Condition="'$(PublicSign)' == 'true'">
<PropertyGroup Condition="'$(BuildingProject)' == 'false'">
<!-- Turn off PublicSign, because leaving both to true will make the Csc task unhappy -->
<PublicSign>false</PublicSign>
<DelaySign>true</DelaySign>
</PropertyGroup>
</Target>
</Project>

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

@ -1,8 +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. -->
<Import Project="Imports.targets"/>
<Import Project="Signing.targets" />
<Import Project="GenerateAssemblyInfo.targets" Condition="'$(ProjectLanguage)' == 'CSharp' OR '$(ProjectLanguage)' == 'VB'" />
<Import Project="GenerateInternalsVisibleTo.targets" />
</Project>

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

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

@ -0,0 +1,21 @@
<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>

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

@ -0,0 +1,38 @@
<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,10 +1,4 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- ====================================================================================
Generation of AssemblyVersion attributes from the BuildVersion property
==================================================================================== -->
<PropertyGroup>
<GeneratedAssemblyInfoFile>$(IntermediateOutputPath)GeneratedAssemblyInfo_$(BuildVersion)$(DefaultLanguageSourceExtension)</GeneratedAssemblyInfoFile>
</PropertyGroup>
@ -13,18 +7,24 @@
<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>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyVersionAttribute">
<_Parameter1>$(AssemblyVersion)</_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>
@ -70,21 +70,13 @@
Inputs="$(MSBuildThisFileFullPath)"
Outputs="$(GeneratedAssemblyInfoFile)"
DependsOnTargets="PrepareForBuild"
Condition="('$(Language)' == 'C#' or '$(Language)' == 'VB')">
Condition="('$(Language)' == 'C#' or '$(Language)' == 'VB') and '$(OS)' == 'Windows_NT' ">
<CreateItem Include="System.Reflection.AssemblyMetadataAttribute"
AdditionalMetadata="_Parameter1=Serviceable;_Parameter2=True"
Condition="'$(ServiceablePackage)' == 'true'">
<Output TaskParameter="Include" ItemName="AssemblyVersionAttribute" />
</CreateItem>
<!-- The necessity of this Task is tracked by https://github.com/dotnet/roslyn/issues/8421 -->
<WriteCodeFragmentEx
AssemblyAttributes="@(AssemblyVersionAttribute)"
Language="$(Language)"
OutputFile="$(GeneratedAssemblyInfoFile)">
<WriteCodeFragment AssemblyAttributes="@(AssemblyVersionAttribute)"
Language="$(Language)"
OutputFile="$(GeneratedAssemblyInfoFile)">
<Output TaskParameter="OutputFile" ItemName="Compile" />
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragmentEx>
</WriteCodeFragment>
</Target>
</Project>
</Project>

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

@ -0,0 +1,57 @@
<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>

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

@ -0,0 +1,20 @@
<?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>

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

@ -0,0 +1,7 @@
<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="NuGet.props"/>
<Import Project="$(NuGetPackageRoot)\MicroBuild.Core\$(MicroBuildCoreVersion)\build\MicroBuild.Core.props" />
<Import Project="$(NuGetPackageRoot)\MicroBuild.Core\$(MicroBuildCoreVersion)\build\MicroBuild.Core.targets" />
</Project>

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

@ -0,0 +1,17 @@
<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>

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

@ -0,0 +1,25 @@
<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>
<ToolsetCompilerPropsFilePath>$(NuGetPackageRoot)\Microsoft.Net.Compilers\$(ToolsetCompilerPackageVersion)\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>

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

@ -0,0 +1,20 @@
<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>

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

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

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

@ -1,11 +0,0 @@
{
"dependencies": {
"MicroBuild.Core": "0.2.0",
"Microsoft.NETCore.Platforms": "1.0.1",
"Microsoft.Net.Compilers": "1.2.1",
"Roslyn.Build.Util": "0.9.4-portable"
},
"frameworks": {
"net46": {}
}
}

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

@ -0,0 +1,454 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $configuration = "Debug",
[string] $deployHive = "TestImpact",
[string] $msbuildVersion = "14.0",
[string] $nugetVersion = "3.5.0-beta",
[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

192
netci.groovy Normal file
Просмотреть файл

@ -0,0 +1,192 @@
// Groovy Script: http://www.groovy-lang.org/syntax.html
// Jenkins DSL: https://github.com/jenkinsci/job-dsl-plugin/wiki
import jobs.generation.Utilities;
static getJobName(def opsysName, def configName, def testName) {
return "${opsysName}_${configName}_${testName}"
}
static addArchival(def job, def filesToArchive, def filesToExclude) {
def doNotFailIfNothingArchived = false
def archiveOnlyIfSuccessful = false
Utilities.addArchival(job, filesToArchive, filesToExclude, doNotFailIfNothingArchived, archiveOnlyIfSuccessful)
}
static addGithubPRTriggerForBranch(def job, def branchName, def jobName, def testName) {
def prContext = "prtest/${jobName.replace('_', '/')}"
def triggerPhrase = "(?i).*test\\W+${prContext}.*"
def triggerOnPhraseOnly = (testName != 'build')
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 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 downstreamFullJobNames = "${unit32FullJobName}"
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 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')}
""")
}
}
}
[true, false].each { isPR ->
['windows'].each { opsysName ->
['debug', 'release'].each { configName ->
['build', 'unit32'].each { testName ->
def projectName = GithubProject
def branchName = GithubBranchName
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)
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-update3')
if (!isPR) {
addExtendedEmailPublisher(myJob)
}
if (testName == 'build') {
addBuildSteps(myJob, projectName, opsysName, configName, isPR)
} else {
addTestSteps(myJob, projectName, opsysName, configName, testName, isPR, filesToArchive, filesToExclude)
}
}
}
}
}

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

@ -0,0 +1,38 @@
<?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>
<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>
</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>
</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>
<ImportGroup>
<Import Project="..\..\build\Targets\Imports.targets" />
<Import Project="..\..\build\Toolset\XunitProjectRunAction.targets" />
</ImportGroup>
</Project>

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

@ -0,0 +1,3 @@
{
"shadowCopy": false
}

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

@ -0,0 +1,16 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Xunit;
namespace Microsoft.DiaSymReader.UnitTests
{
public class SymUnmanagedStreamFactoryTests
{
[Fact]
public void Errors()
{
Assert.Throws<ArgumentNullException>(() => SymUnmanagedStreamFactory.CreateStream(null));
}
}
}

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

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

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

@ -1,17 +1,17 @@
<?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="..\..\build\Targets\Settings.targets" />
</ImportGroup>
<ItemGroup>
<NuSpec Include="Microsoft.DiaSymReader" />
</ItemGroup>
<Target Name="Build" Inputs="@(NuSpec)" Outputs="@(NuSpec->NuGet\%(Identity).$(NuGetVersion).nupkg">
<PropertyGroup>
<NuGetOutDir>$(OutDir)NuGet</NuGetOutDir>
</PropertyGroup>
<MakeDir Directories="$(NuGetOutDir)" Condition="!Exists('$(NuGetOutDir)')" />
<Exec Command='$(NuGetToolPath) Pack "$(MSBuildProjectDirectory)\%(NuSpec.Identity).nuspec" -BasePath "$(OutDir)\" -OutputDirectory "$(NuGetOutDir)" -prop currentVersion="$(NuGetVersion)"' />
<Target Name="Build" Inputs="@(NuSpec)" Outputs="@(NuSpec->$(OutDir)\%(Identity).$(NuGetVersion).nupkg">
<MakeDir Directories="$(OutDir)" Condition="!Exists('$(OutDir)')" />
<Exec Command='$(NuGetToolPath) Pack "$(MSBuildProjectDirectory)\%(NuSpec.Identity).nuspec" -BasePath "$(OutDirBase)\%(NuSpec.Identity)" -OutputDirectory "$(OutDir)" -prop currentVersion="$(NuGetVersion)" -prop SystemDiagnosticsDebugVersion=$(SystemDiagnosticsDebugVersion) -prop SystemRuntimeVersion=$(SystemRuntimeVersion) -prop SystemRuntimeInteropServicesVersion=$(SystemRuntimeInteropServicesVersion)' />
</Target>
<Target Name="Clean">
<RemoveDir Directories="$(OutDir)NuGet" />

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

@ -8,9 +8,9 @@
</description>
<dependencies>
<group targetFramework="netstandard1.1">
<dependency id="System.Runtime" version="4.1.0" />
<dependency id="System.Runtime.InteropServices" version="4.1.0" />
<dependency id="System.Diagnostics.Debug" version="4.0.11" />
<dependency id="System.Runtime" version="$SystemRuntimeVersion$" />
<dependency id="System.Runtime.InteropServices" version="$SystemRuntimeInteropServicesVersion$" />
<dependency id="System.Diagnostics.Debug" version="$SystemDiagnosticsDebugVersion$" />
</group>
</dependencies>
<language>en-US</language>

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

@ -2,21 +2,34 @@
<!-- 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">
<PropertyGroup>
<TargetNetFX20>true</TargetNetFX20>
<OutDirName>Microsoft.DiaSymReader\NetFX20</OutDirName>
</PropertyGroup>
<ImportGroup>
<Import Project="..\..\..\build\Targets\Settings.targets" />
</ImportGroup>
<!--
The project targets Framework 2.0 reference assemblies provided by Microsoft.NetFX20 nuget package.
Use the latest Framework toolset to build, but set msbuild properties below
so to avoid 4.5 specific artifacts to be added to the compilation (references, attributes).
-->
<PropertyGroup>
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
<NoStdLib>true</NoStdLib>
<FrameworkPathOverride>$(NuGetPackageRoot)\Microsoft.NetFX20\1.0.3\lib\net20</FrameworkPathOverride>
<NuGetTargetMoniker>.NETFramework,Version=v2.0</NuGetTargetMoniker>
</PropertyGroup>
<ItemGroup>
<_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
</ItemGroup>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<ProjectGuid>{FA2C8969-BD1F-457A-A6E3-CA772135FF73}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.DiaSymReader</RootNamespace>
<AssemblyName>Microsoft.DiaSymReader</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<SolutionDir Condition="'$(SolutionDir)' == '' OR '$(SolutionDir)' == '*Undefined*'">..\..\..\</SolutionDir>
<OutDir>$(OutDir)NetFX20\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
@ -29,8 +42,8 @@
<ItemGroup>
<Compile Include="ExtensionAttribute.cs" />
</ItemGroup>
<Import Project="..\Microsoft.DiaSymReader.projitems" Label="Shared" />
<ImportGroup>
<Import Project="..\..\..\build\Targets\VSL.Imports.targets" />
<Import Project="..\Shared\Microsoft.DiaSymReader.projitems" Label="Shared" />
<ImportGroup Label="Targets">
<Import Project="..\..\..\build\Targets\Imports.targets" />
</ImportGroup>
</Project>

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

@ -1,11 +1,11 @@
{
"dependencies": {
"Microsoft.NetFX20": "1.0.3"
},
"frameworks": {
"net20": {}
},
"runtimes": {
"win7": { }
}
"dependencies": {
"Microsoft.NetFX20": "1.0.3"
},
"frameworks": {
"net20": { }
},
"runtimes": {
"win": { }
}
}

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

@ -1,31 +1,31 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<?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">
<PropertyGroup>
<OutDirName>Microsoft.DiaSymReader\Portable</OutDirName>
</PropertyGroup>
<ImportGroup>
<Import Project="..\..\..\build\Targets\Settings.targets" />
</ImportGroup>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
<ProjectGuid>{316FD2AD-8514-41BD-98D5-61A821F3320E}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.DiaSymReader</RootNamespace>
<AssemblyName>Microsoft.DiaSymReader</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ServiceablePackage>true</ServiceablePackage>
<SolutionDir Condition="'$(SolutionDir)' == '' OR '$(SolutionDir)' == '*Undefined*'">..\..\..\</SolutionDir>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutDir>$(OutDir)Portable\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'" />
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
</ItemGroup>
<Import Project="..\Microsoft.DiaSymReader.projitems" Label="Shared" />
<Import Project="..\Shared\Microsoft.DiaSymReader.projitems" Label="Shared" />
<ImportGroup>
<Import Project="..\..\..\build\Targets\VSL.Imports.targets" />
<Import Project="..\..\..\build\Targets\Imports.targets" />
</ImportGroup>
</Project>