提交 9252d214 编写于 作者: J Jared Parsons

Moved to props file extension

This follows standard MSBuild conventions for file extensions:

- props: imported at the start of projects.  Primarily for setting properties.
- targets: imported at the end of projects.
上级 8ab1b925
......@@ -6,17 +6,17 @@ The goal of our targets files is to be the container of all of our build logic.
To accomplish this all of the build logic is contained in our central targets files. This includes logic around packaging, deployment, nuget targeting, signing, etc... The preference is to contain logic in XML when reasonable but a custom build task is used when appropriate.
The individual project files contain declaritive information only. They inherit their build logic by importing [Settings.targets](Settings.targets) at the start and [Imports.targets](Imports.targets) at the conclusion.
The individual project files contain declaritive information only. They inherit their build logic by importing [Settings.props](Settings.props) at the start and [Imports.targets](Imports.targets) at the conclusion.
## Files
This section describes the purpose and layout of the important files here.
### Settings.targets
### Settings.props
This file is importanted at the start of projects. There are two primary purposes of this file:
- Import standard targets files.
- Import standard props files.
- Define the set of properties which ...
- Projects reasonably need to ready, modify or evaluate.
- Are necessary for importing standard target files.
......
<Project DefaultTargets="Build" InitialTargets="RestoreToolsetCheck" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
<Import Project="Versions.props"/>
<PropertyGroup>
<ProjectDir>$(MSBuildThisFileDirectory)..\..\</ProjectDir>
<NuGetToolPath>$(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>
<ToolsetCompilerPackageName>Microsoft.Net.Compilers</ToolsetCompilerPackageName>
<ToolsetCompilerPackageVersion>1.3.2</ToolsetCompilerPackageVersion>
<RoslynDiagnosticsNugetPackageVersion>1.2.0-beta2</RoslynDiagnosticsNugetPackageVersion>
<RoslynDiagnosticsPropsFilePath>$(NuGetPackageRoot)\Microsoft.Net.RoslynDiagnostics\$(RoslynDiagnosticsNugetPackageVersion)\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>
<Features>strict,IOperation</Features>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<SignAssembly>true</SignAssembly>
<UseRoslynAnalyzers Condition="'$(UseRoslynAnalyzers)' == ''">true</UseRoslynAnalyzers>
<OutDir>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\Binaries\$(Configuration)'))\</OutDir>
<BaseIntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\Binaries\Obj\$(MSBuildProjectName)'))\</BaseIntermediateOutputPath>
<!-- Workaround until we move to Microsoft.Net.Compilers.nupkg with this fix: https://github.com/dotnet/roslyn/commit/05c12ebfcdd08a02dbceded5327a8da7a7df23be:
Use the Microsoft.Net.Compilers.props file with the fix checked into the repo instead of the one that comes along with the nuget package:
$(NuGetPackageRoot)\Microsoft.Net.Compilers\$(ToolsetCompilerPackageVersion)\build\Microsoft.Net.Compilers.props -->
<ToolsetCompilerPropsFilePath>$(MSBuildThisFileDirectory)Microsoft.Net.Compilers.props</ToolsetCompilerPropsFilePath>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VisualStudioReferenceMajorVersion Condition="'$(VisualStudioReferenceMajorVersion)' == ''">$(VisualStudioVersion.Substring(0, $(VisualStudioVersion.IndexOf('.'))))</VisualStudioReferenceMajorVersion>
<VisualStudioReferenceAssemblyVersion Condition="'$(VisualStudioReferenceAssemblyVersion)' == ''">$(VisualStudioReferenceMajorVersion).0.0.0</VisualStudioReferenceAssemblyVersion>
<VisualStudioCodename>Dev$(VisualStudioReferenceMajorVersion)</VisualStudioCodename>
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
<!-- 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>
<CompilerGeneratorToolsDir>$(OutDir)CompilerGeneratorTools\</CompilerGeneratorToolsDir>
<MSBuildAssemblyNameFragment>Core</MSBuildAssemblyNameFragment>
</PropertyGroup>
<!-- Windows specific settings -->
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<BaseNuGetRuntimeIdentifier>win7</BaseNuGetRuntimeIdentifier>
<DebugType>pdbonly</DebugType>
<UseSharedCompilation>true</UseSharedCompilation>
<!-- This is a really hacky way to detect whether we are on a legacy or a willow based VS install.
Basically, we check for a registry key that will only exist in legacy VS installs, and assume
we are a willow based installation if our VSVersion is 15.0 and the registry key doesn't exist. -->
<IsVSBeforeDev15Preview4 Condition="'$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\15.0@InstallDir)' != ''">true</IsVSBeforeDev15Preview4>
<IsVSBeforeDev15Preview4 Condition="'$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\15.0@InstallDir)' != ''">true</IsVSBeforeDev15Preview4>
<IsVSBeforeDev15Preview4 Condition="'$(IsVSBeforeDev15Preview4)' == 'true' AND Exists('$(MSBuildBinPath)\..\..\..\Common7\IDE\devenv.isolation.ini')">false</IsVSBeforeDev15Preview4>
<IsVSBeforeDev15Preview4 Condition="'$(IsVSBeforeDev15Preview4)' == 'true' AND Exists('$(MSBuildBinPath)\..\..\..\..\Common7\IDE\devenv.isolation.ini')">false</IsVSBeforeDev15Preview4>
</PropertyGroup>
<!-- Unix specific settings -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<!-- Point to the reference assemblies on unix -->
<TargetFrameworkRootPath>$(MSBuildBinPath)\reference-assemblies\Framework</TargetFrameworkRootPath>
<!-- 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. -->
<CompilerResponseFile>$(MSBuildThisFileDirectory)..\unix\extra_unix_args.rsp</CompilerResponseFile>
<DebugType>portable</DebugType>
</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>
<PropertyGroup Condition="'$(DevEnvDir)' == ''">
<DevEnvDir>$([System.Environment]::ExpandEnvironmentVariables("%VS$(VisualStudioReferenceMajorVersion)0COMNTOOLS%"))</DevEnvDir>
<DevEnvDir>$(DevEnvDir)\..\IDE</DevEnvDir>
<DevEnvDir>$([System.IO.Path]::GetFullPath('$(DevEnvDir)'))</DevEnvDir>
</PropertyGroup>
<PropertyGroup Condition="'$(BootstrapBuildPath)' != ''">
<CSharpCoreTargetsPath>$(BootstrapBuildPath)\Microsoft.CSharp.Core.targets</CSharpCoreTargetsPath>
<VisualBasicCoreTargetsPath>$(BootstrapBuildPath)\Microsoft.VisualBasic.Core.targets</VisualBasicCoreTargetsPath>
</PropertyGroup>
<!-- Language specifc settings -->
<Choose>
<!-- VB specific settings -->
<When Condition="'$(MSBuildProjectExtension)' == '.vbproj' OR '$(Language)' == 'VB' OR '$(ProjectLanguage)' == 'VB'">
<PropertyGroup>
<ProjectLanguage>VB</ProjectLanguage>
<MyType>Empty</MyType>
<OptionCompare>Binary</OptionCompare>
<OptionExplicit>On</OptionExplicit>
<OptionInfer>On</OptionInfer>
<OptionStrict>On</OptionStrict>
<VBRuntime>Embed</VBRuntime>
<RemoveIntegerChecks>true</RemoveIntegerChecks>
<MSBuildTargetsLanguageName>VisualBasic</MSBuildTargetsLanguageName>
</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>
<PropertyGroup>
<DefineConstants Condition="'$(InitialDefineConstants)' != ''">$(InitialDefineConstants)</DefineConstants>
</PropertyGroup>
</When>
<!-- C# specific settings -->
<When Condition="'$(MSBuildProjectExtension)' == '.csproj' OR '$(Language)' == 'C#' OR '$(ProjectLanguage)' == 'CSharp'">
<PropertyGroup>
<ProjectLanguage>CSharp</ProjectLanguage>
<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>$(NoWarn);1591</NoWarn>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<MSBuildTargetsLanguageName>CSharp</MSBuildTargetsLanguageName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="'$(InitialDefineConstants)' != ''">$(DefineConstants);$(InitialDefineConstants)</DefineConstants>
</PropertyGroup>
</When>
<!-- C++ specific settings -->
<When Condition="'$(MSBuildProjectExtension)' == '.vcxproj' OR '$(Language)' == 'C++' OR '$(ProjectLanguage)' == 'C++'">
<PropertyGroup>
<ProjectLanguage>C++</ProjectLanguage>
<!-- 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>
<!-- Visual Studio specific properties -->
<Choose>
<When Condition="'$(VisualStudioVersion)' == '15.0' AND '$(IsVSBeforeDev15Preview4)' == 'true'">
<PropertyGroup>
<VisualStudioBuildToolsVersion>15.0.25201-dev15preview2</VisualStudioBuildToolsVersion>
</PropertyGroup>
</When>
<When Condition="'$(VisualStudioVersion)' == '15.0'">
<PropertyGroup>
<VisualStudioBuildToolsVersion>15.0.25604-Preview4</VisualStudioBuildToolsVersion>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<VisualStudioBuildToolsVersion>14.3.25420</VisualStudioBuildToolsVersion>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup Condition="'$(ProjectLanguage)' == 'CSharp' AND '$(TargetNetFX20)' == 'true'">
<_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
</ItemGroup>
<!-- During bootstrap builds it's important to load our bootstrap tasks before doing any
other imports (which could load a same named DLL) -->
<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)' != ''" />
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.ValidateBootstrap"
AssemblyFile="$(BootstrapBuildPath)\Microsoft.Build.Tasks.CodeAnalysis.dll"
Condition="'$(BootstrapBuildPath)' != ''" />
<!--
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)" />
<!-- 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'" />
<Import Project="$(RoslynDiagnosticsPropsFilePath)" Condition="'$(UseRoslynAnalyzers)' == 'true'" />
<ImportGroup Label="WindowsImports" Condition="'$(OS)' == 'Windows_NT'">
<Import Project="$(NuGetPackageRoot)\Microsoft.VSSDK.BuildTools\$(VisualStudioBuildToolsVersion)\build\Microsoft.VsSDK.BuildTools.props" />
<Import Project="$(ToolsetCompilerPropsFilePath)" Condition="Exists('$(ToolsetCompilerPropsFilePath)') AND '$(BootstrapBuildPath)' == ''" />
</ImportGroup>
<ImportGroup Label="WindowsImports" Condition="'$(OS)' != 'Windows_NT'">
<!-- 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'" />
</ImportGroup>
<Target Name="RestoreToolsetCheck"
Condition="'$(BuildingProject)' == 'true'">
<Error Text="Toolset packages have not been restored, run Restore.cmd before building"
Condition="!Exists('$(ToolsetCompilerPropsFilePath)')" />
</Target>
<Target Name="CheckBootstrapState" Condition="'$(BootstrapBuildPath)' != ''" BeforeTargets="CoreCompile">
<ValidateBootstrap BootstrapPath="$(BootstrapBuildPath)" />
</Target>
<!--
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>
<Project DefaultTargets="Build" InitialTargets="RestoreToolsetCheck" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
<Import Project="VSL.Versions.targets"/>
<Import Project="Settings.props" />
<PropertyGroup>
<ProjectDir>$(MSBuildThisFileDirectory)..\..\</ProjectDir>
<NuGetToolPath>$(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>
<ToolsetCompilerPackageName>Microsoft.Net.Compilers</ToolsetCompilerPackageName>
<ToolsetCompilerPackageVersion>1.3.2</ToolsetCompilerPackageVersion>
<RoslynDiagnosticsNugetPackageVersion>1.2.0-beta2</RoslynDiagnosticsNugetPackageVersion>
<RoslynDiagnosticsPropsFilePath>$(NuGetPackageRoot)\Microsoft.Net.RoslynDiagnostics\$(RoslynDiagnosticsNugetPackageVersion)\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>
<Features>strict,IOperation</Features>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<SignAssembly>true</SignAssembly>
<UseRoslynAnalyzers Condition="'$(UseRoslynAnalyzers)' == ''">true</UseRoslynAnalyzers>
<OutDir>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\Binaries\$(Configuration)'))\</OutDir>
<BaseIntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\..\Binaries\Obj\$(MSBuildProjectName)'))\</BaseIntermediateOutputPath>
<!-- Workaround until we move to Microsoft.Net.Compilers.nupkg with this fix: https://github.com/dotnet/roslyn/commit/05c12ebfcdd08a02dbceded5327a8da7a7df23be:
Use the Microsoft.Net.Compilers.props file with the fix checked into the repo instead of the one that comes along with the nuget package:
$(NuGetPackageRoot)\Microsoft.Net.Compilers\$(ToolsetCompilerPackageVersion)\build\Microsoft.Net.Compilers.props -->
<ToolsetCompilerPropsFilePath>$(MSBuildThisFileDirectory)Microsoft.Net.Compilers.props</ToolsetCompilerPropsFilePath>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VisualStudioReferenceMajorVersion Condition="'$(VisualStudioReferenceMajorVersion)' == ''">$(VisualStudioVersion.Substring(0, $(VisualStudioVersion.IndexOf('.'))))</VisualStudioReferenceMajorVersion>
<VisualStudioReferenceAssemblyVersion Condition="'$(VisualStudioReferenceAssemblyVersion)' == ''">$(VisualStudioReferenceMajorVersion).0.0.0</VisualStudioReferenceAssemblyVersion>
<VisualStudioCodename>Dev$(VisualStudioReferenceMajorVersion)</VisualStudioCodename>
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
<!-- 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>
<CompilerGeneratorToolsDir>$(OutDir)CompilerGeneratorTools\</CompilerGeneratorToolsDir>
<MSBuildAssemblyNameFragment>Core</MSBuildAssemblyNameFragment>
</PropertyGroup>
<!-- Windows specific settings -->
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<BaseNuGetRuntimeIdentifier>win7</BaseNuGetRuntimeIdentifier>
<DebugType>pdbonly</DebugType>
<UseSharedCompilation>true</UseSharedCompilation>
<!-- This is a really hacky way to detect whether we are on a legacy or a willow based VS install.
Basically, we check for a registry key that will only exist in legacy VS installs, and assume
we are a willow based installation if our VSVersion is 15.0 and the registry key doesn't exist. -->
<IsVSBeforeDev15Preview4 Condition="'$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\15.0@InstallDir)' != ''">true</IsVSBeforeDev15Preview4>
<IsVSBeforeDev15Preview4 Condition="'$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\15.0@InstallDir)' != ''">true</IsVSBeforeDev15Preview4>
<IsVSBeforeDev15Preview4 Condition="'$(IsVSBeforeDev15Preview4)' == 'true' AND Exists('$(MSBuildBinPath)\..\..\..\Common7\IDE\devenv.isolation.ini')">false</IsVSBeforeDev15Preview4>
<IsVSBeforeDev15Preview4 Condition="'$(IsVSBeforeDev15Preview4)' == 'true' AND Exists('$(MSBuildBinPath)\..\..\..\..\Common7\IDE\devenv.isolation.ini')">false</IsVSBeforeDev15Preview4>
</PropertyGroup>
<!-- Unix specific settings -->
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<!-- Point to the reference assemblies on unix -->
<TargetFrameworkRootPath>$(MSBuildBinPath)\reference-assemblies\Framework</TargetFrameworkRootPath>
<!-- 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. -->
<CompilerResponseFile>$(MSBuildThisFileDirectory)..\unix\extra_unix_args.rsp</CompilerResponseFile>
<DebugType>portable</DebugType>
</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>
<PropertyGroup Condition="'$(DevEnvDir)' == ''">
<DevEnvDir>$([System.Environment]::ExpandEnvironmentVariables("%VS$(VisualStudioReferenceMajorVersion)0COMNTOOLS%"))</DevEnvDir>
<DevEnvDir>$(DevEnvDir)\..\IDE</DevEnvDir>
<DevEnvDir>$([System.IO.Path]::GetFullPath('$(DevEnvDir)'))</DevEnvDir>
</PropertyGroup>
<PropertyGroup Condition="'$(BootstrapBuildPath)' != ''">
<CSharpCoreTargetsPath>$(BootstrapBuildPath)\Microsoft.CSharp.Core.targets</CSharpCoreTargetsPath>
<VisualBasicCoreTargetsPath>$(BootstrapBuildPath)\Microsoft.VisualBasic.Core.targets</VisualBasicCoreTargetsPath>
</PropertyGroup>
<!-- Language specifc settings -->
<Choose>
<!-- VB specific settings -->
<When Condition="'$(MSBuildProjectExtension)' == '.vbproj' OR '$(Language)' == 'VB' OR '$(ProjectLanguage)' == 'VB'">
<PropertyGroup>
<ProjectLanguage>VB</ProjectLanguage>
<MyType>Empty</MyType>
<OptionCompare>Binary</OptionCompare>
<OptionExplicit>On</OptionExplicit>
<OptionInfer>On</OptionInfer>
<OptionStrict>On</OptionStrict>
<RootNamespace></RootNamespace>
<VBRuntime>Embed</VBRuntime>
<RemoveIntegerChecks>true</RemoveIntegerChecks>
<MSBuildTargetsLanguageName>VisualBasic</MSBuildTargetsLanguageName>
</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>
<PropertyGroup>
<DefineConstants Condition="'$(InitialDefineConstants)' != ''">$(InitialDefineConstants)</DefineConstants>
</PropertyGroup>
</When>
<!-- C# specific settings -->
<When Condition="'$(MSBuildProjectExtension)' == '.csproj' OR '$(Language)' == 'C#' OR '$(ProjectLanguage)' == 'CSharp'">
<PropertyGroup>
<ProjectLanguage>CSharp</ProjectLanguage>
<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>$(NoWarn);1591</NoWarn>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<MSBuildTargetsLanguageName>CSharp</MSBuildTargetsLanguageName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugSymbols>true</DebugSymbols>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="'$(InitialDefineConstants)' != ''">$(DefineConstants);$(InitialDefineConstants)</DefineConstants>
</PropertyGroup>
</When>
<!-- C++ specific settings -->
<When Condition="'$(MSBuildProjectExtension)' == '.vcxproj' OR '$(Language)' == 'C++' OR '$(ProjectLanguage)' == 'C++'">
<PropertyGroup>
<ProjectLanguage>C++</ProjectLanguage>
<!-- 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>
<!-- Visual Studio specific properties -->
<Choose>
<When Condition="'$(VisualStudioVersion)' == '15.0' AND '$(IsVSBeforeDev15Preview4)' == 'true'">
<PropertyGroup>
<VisualStudioBuildToolsVersion>15.0.25201-dev15preview2</VisualStudioBuildToolsVersion>
</PropertyGroup>
</When>
<When Condition="'$(VisualStudioVersion)' == '15.0'">
<PropertyGroup>
<VisualStudioBuildToolsVersion>15.0.25604-Preview4</VisualStudioBuildToolsVersion>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<VisualStudioBuildToolsVersion>14.3.25420</VisualStudioBuildToolsVersion>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup Condition="'$(ProjectLanguage)' == 'CSharp' AND '$(TargetNetFX20)' == 'true'">
<_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
</ItemGroup>
<!-- During bootstrap builds it's important to load our bootstrap tasks before doing any
other imports (which could load a same named DLL) -->
<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)' != ''" />
<UsingTask TaskName="Microsoft.CodeAnalysis.BuildTasks.ValidateBootstrap"
AssemblyFile="$(BootstrapBuildPath)\Microsoft.Build.Tasks.CodeAnalysis.dll"
Condition="'$(BootstrapBuildPath)' != ''" />
<!--
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)" />
<!-- 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'" />
<Import Project="$(RoslynDiagnosticsPropsFilePath)" Condition="'$(UseRoslynAnalyzers)' == 'true'" />
<ImportGroup Label="WindowsImports" Condition="'$(OS)' == 'Windows_NT'">
<Import Project="$(NuGetPackageRoot)\Microsoft.VSSDK.BuildTools\$(VisualStudioBuildToolsVersion)\build\Microsoft.VsSDK.BuildTools.props" />
<Import Project="$(ToolsetCompilerPropsFilePath)" Condition="Exists('$(ToolsetCompilerPropsFilePath)') AND '$(BootstrapBuildPath)' == ''" />
</ImportGroup>
<ImportGroup Label="WindowsImports" Condition="'$(OS)' != 'Windows_NT'">
<!-- 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'" />
</ImportGroup>
<Target Name="RestoreToolsetCheck"
Condition="'$(BuildingProject)' == 'true'">
<Error Text="Toolset packages have not been restored, run Restore.cmd before building"
Condition="!Exists('$(ToolsetCompilerPropsFilePath)')" />
</Target>
<Target Name="CheckBootstrapState" Condition="'$(BootstrapBuildPath)' != ''" BeforeTargets="CoreCompile">
<ValidateBootstrap BootstrapPath="$(BootstrapBuildPath)" />
</Target>
<!--
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>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册