提交 87ef04af 编写于 作者: T Tomas Matousek

Factor version definitions out of VSL.Settings.targets into a separate file

上级 70b8933a
<Project DefaultTargets="Build" InitialTargets="RestoreToolsetCheck" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="OutDir;Configuration">
<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'">$([System.Environment]::GetFolderPath(SpecialFolder.Personal))\.nuget\packages</NuGetPackageRoot>
<!--
$(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>
<!-- Turn on hard-linking on Windows to reduce copy time and disk space -->
<CreateHardLinksForCopyLocalIfPossible Condition="'$(OS)' == 'Windows_NT'">true</CreateHardLinksForCopyLocalIfPossible>
</PropertyGroup>
<!-- Import the global NuGet packages -->
<PropertyGroup>
<ToolsetCompilerPackageName>Microsoft.Net.Compilers</ToolsetCompilerPackageName>
<ToolsetCompilerPropsFilePath>$(NuGetPackageRoot)\Microsoft.Net.Compilers\1.2.0-beta-20151211-01\build\Microsoft.Net.Compilers.props</ToolsetCompilerPropsFilePath>
<RoslynDiagnosticsPropsFilePath>$(NuGetPackageRoot)\Microsoft.Net.RoslynDiagnostics\1.1.1-beta1-20150818-01\build\Microsoft.Net.RoslynDiagnostics.props</RoslynDiagnosticsPropsFilePath>
<AdditionalFileItemNames>$(AdditionalFileItemNames);PublicAPI</AdditionalFileItemNames>
</PropertyGroup>
<Target Name="RestoreToolsetCheck"
Condition="'$(BuildingProject)' == 'true'">
<Error Text="Toolset packages have not been restore, 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>
<!-- 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'" />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(DevEnvDir)' == ''">
<DevEnvDir>$(VSINSTALLDIR)\Common7\IDE</DevEnvDir>
<DevEnvDir Condition="'$(VisualStudioVersion)' == '12.0'">$(VS120COMNTOOLS)\..\IDE</DevEnvDir>
<DevEnvDir Condition="'$(VisualStudioVersion)' == '14.0'">$(VS140COMNTOOLS)\..\IDE</DevEnvDir>
<DevEnvDir>$([System.IO.Path]::GetFullPath('$(DevEnvDir)'))</DevEnvDir>
</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>
<!-- If we're on Visual Studio 2015 RTM and we still have Roslyn installed, our VSIX-producing packages are not going to install, so let's not even try.
Update 1 supports this, so we'll use csi.exe's existence as a simple proxy for whether we have Update 1 installed or not. -->
<DeployExtension Condition="'$(DeployExtension)' == '' AND Exists('$(DevEnvDir)\CommonExtensions\Microsoft\Roslyn\Language Services\extension.vsixmanifest') AND !Exists('$(MSBuildBinPath)\csi.exe')">false</DeployExtension>
</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>
<!-- Don't validate our .vsixmanifests for correct schemas. Right now our build machines are on Visual Studio 2015 RTM, but we want to set a property
(Experimental) that was added in Update 1. Since the schema is pulled from the box, you can't build with RTM unless we either disable schema
validation or otherwise copy the schemas in and then point the target to those. Since schema changes happen fairly rarely, I'll just disable
schema validation and turn it on as soon as we're on update 1 only. -->
<PropertyGroup>
<BypassVsixValidation>true</BypassVsixValidation>
</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)')" />
</ImportGroup>
<ImportGroup>
<Import Project="$(RoslynDiagnosticsPropsFilePath)"
Condition="Exists('$(RoslynDiagnosticsPropsFilePath)') And ('$(UseRoslynAnalyzers)' == 'true')" />
</ImportGroup>
<PropertyGroup Condition="'$(BootstrapBuildPath)' != ''">
<CscToolPath>$(BootstrapBuildPath)</CscToolPath>
<CscToolExe>csc.cmd</CscToolExe>
<VbcToolPath>$(BootstrapBuildPath)</VbcToolPath>
<VbcToolExe>vbc.cmd</VbcToolExe>
</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 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>
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
</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>
<DebugType>full</DebugType>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>pdbonly</DebugType>
<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>
<!-- SN is in the Framework SDK tools path, but TargetFrameworkSDKToolsDirectory isn't always available -->
<SnToolPath Condition=" '$(TargetFrameworkSDKToolsDirectory)' != '' ">$(TargetFrameworkSDKToolsDirectory)\sn.exe</SnToolPath>
<SnToolPath Condition=" '$(TargetFrameworkSDKToolsDirectory)' == '' ">$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\sn.exe</SnToolPath>
<EditBinToolPath>$(MSBuildProgramFiles32)\Microsoft Visual Studio $(VisualStudioVersion)\VC\bin\editbin.exe</EditBinToolPath>
</PropertyGroup>
<PropertyGroup>
<CopyVSReferencesToOutput>True</CopyVSReferencesToOutput>
<AuthenticodeCertificateName>MicrosoftSHA1</AuthenticodeCertificateName>
<FakeSignToolPath>$(NuGetPackageRoot)\FakeSign\0.9.2\tools\FakeSign.exe</FakeSignToolPath>
</PropertyGroup>
</Project>
<Project DefaultTargets="Build" InitialTargets="RestoreToolsetCheck" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="OutDir;Configuration">
<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'">$([System.Environment]::GetFolderPath(SpecialFolder.Personal))\.nuget\packages</NuGetPackageRoot>
<!--
$(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>
<!-- Turn on hard-linking on Windows to reduce copy time and disk space -->
<CreateHardLinksForCopyLocalIfPossible Condition="'$(OS)' == 'Windows_NT'">true</CreateHardLinksForCopyLocalIfPossible>
</PropertyGroup>
<!-- Import the global NuGet packages -->
<PropertyGroup>
<ToolsetCompilerPackageName>Microsoft.Net.Compilers</ToolsetCompilerPackageName>
<ToolsetCompilerPropsFilePath>$(NuGetPackageRoot)\Microsoft.Net.Compilers\1.2.0-beta-20151211-01\build\Microsoft.Net.Compilers.props</ToolsetCompilerPropsFilePath>
<RoslynDiagnosticsPropsFilePath>$(NuGetPackageRoot)\Microsoft.Net.RoslynDiagnostics\1.1.1-beta1-20150818-01\build\Microsoft.Net.RoslynDiagnostics.props</RoslynDiagnosticsPropsFilePath>
<AdditionalFileItemNames>$(AdditionalFileItemNames);PublicAPI</AdditionalFileItemNames>
</PropertyGroup>
<Target Name="RestoreToolsetCheck"
Condition="'$(BuildingProject)' == 'true'">
<Error Text="Toolset packages have not been restore, 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>
<!-- 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'" />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(DevEnvDir)' == ''">
<DevEnvDir>$(VSINSTALLDIR)\Common7\IDE</DevEnvDir>
<DevEnvDir Condition="'$(VisualStudioVersion)' == '12.0'">$(VS120COMNTOOLS)\..\IDE</DevEnvDir>
<DevEnvDir Condition="'$(VisualStudioVersion)' == '14.0'">$(VS140COMNTOOLS)\..\IDE</DevEnvDir>
<DevEnvDir>$([System.IO.Path]::GetFullPath('$(DevEnvDir)'))</DevEnvDir>
</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>
<RoslynSemanticVersion Condition="'$(RoslynSemanticVersion)' == ''">1.2.0</RoslynSemanticVersion>
<SystemReflectionMetadataAssemblyVersion Condition="'$(SystemReflectionMetadataAssemblyVersion)' == ''">1.2.0</SystemReflectionMetadataAssemblyVersion>
<SystemCollectionsImmutableAssemblyVersion Condition="'$(SystemCollectionsImmutableAssemblyVersion)' == ''">1.1.37</SystemCollectionsImmutableAssemblyVersion>
<NuGetCommandLineAssemblyVersion Condition="'$(NuGetCommandLineAssemblyVersion)' == ''">2.8.5</NuGetCommandLineAssemblyVersion>
<MicrosoftCompositionAssemblyVersion Condition="'$(MicrosoftCompositionAssemblyVersion)' == ''">1.0.27</MicrosoftCompositionAssemblyVersion>
<SystemReflectionMetadataVersion>$(SystemReflectionMetadataAssemblyVersion)-rc2-23608</SystemReflectionMetadataVersion>
<SystemCollectionsImmutableVersion>$(SystemCollectionsImmutableAssemblyVersion)</SystemCollectionsImmutableVersion>
<MicrosoftDiaSymReaderNativeVersion>1.3.3</MicrosoftDiaSymReaderNativeVersion>
<NuGetCommandLineVersion>$(NuGetCommandLineAssemblyVersion)</NuGetCommandLineVersion>
<MicrosoftCompositionVersion>$(MicrosoftCompositionAssemblyVersion)</MicrosoftCompositionVersion>
<!-- Versioning is independent, this should not be the Roslyn semantic version -->
<CodeAnalysisAnalyzersVersion Condition="'$(CodeAnalysisAnalyzersVersion)' == ''">1.1.0</CodeAnalysisAnalyzersVersion>
<!-- If we're on Visual Studio 2015 RTM and we still have Roslyn installed, our VSIX-producing packages are not going to install, so let's not even try.
Update 1 supports this, so we'll use csi.exe's existence as a simple proxy for whether we have Update 1 installed or not. -->
<DeployExtension Condition="'$(DeployExtension)' == '' AND Exists('$(DevEnvDir)\CommonExtensions\Microsoft\Roslyn\Language Services\extension.vsixmanifest') AND !Exists('$(MSBuildBinPath)\csi.exe')">false</DeployExtension>
</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>
<!-- Don't validate our .vsixmanifests for correct schemas. Right now our build machines are on Visual Studio 2015 RTM, but we want to set a property
(Experimental) that was added in Update 1. Since the schema is pulled from the box, you can't build with RTM unless we either disable schema
validation or otherwise copy the schemas in and then point the target to those. Since schema changes happen fairly rarely, I'll just disable
schema validation and turn it on as soon as we're on update 1 only. -->
<PropertyGroup>
<BypassVsixValidation>true</BypassVsixValidation>
</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)')" />
</ImportGroup>
<ImportGroup>
<Import Project="$(RoslynDiagnosticsPropsFilePath)"
Condition="Exists('$(RoslynDiagnosticsPropsFilePath)') And ('$(UseRoslynAnalyzers)' == 'true')" />
</ImportGroup>
<PropertyGroup Condition="'$(BootstrapBuildPath)' != ''">
<CscToolPath>$(BootstrapBuildPath)</CscToolPath>
<CscToolExe>csc.cmd</CscToolExe>
<VbcToolPath>$(BootstrapBuildPath)</VbcToolPath>
<VbcToolExe>vbc.cmd</VbcToolExe>
</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 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>
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
</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>
<DebugType>full</DebugType>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>pdbonly</DebugType>
<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>
<!-- SN is in the Framework SDK tools path, but TargetFrameworkSDKToolsDirectory isn't always available -->
<SnToolPath Condition=" '$(TargetFrameworkSDKToolsDirectory)' != '' ">$(TargetFrameworkSDKToolsDirectory)\sn.exe</SnToolPath>
<SnToolPath Condition=" '$(TargetFrameworkSDKToolsDirectory)' == '' ">$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\sn.exe</SnToolPath>
<EditBinToolPath>$(MSBuildProgramFiles32)\Microsoft Visual Studio $(VisualStudioVersion)\VC\bin\editbin.exe</EditBinToolPath>
</PropertyGroup>
<PropertyGroup>
<CopyVSReferencesToOutput>True</CopyVSReferencesToOutput>
<AuthenticodeCertificateName>MicrosoftSHA1</AuthenticodeCertificateName>
<FakeSignToolPath>$(NuGetPackageRoot)\FakeSign\0.9.2\tools\FakeSign.exe</FakeSignToolPath>
</PropertyGroup>
<Choose>
<When Condition="'$(BuildVersion)' != ''">
<!-- The user specified a build version number. In that case, we'll use their version number
for the file version, and force the assembly version to $(RoslynSemanticVersion).0. That way
day-to-day upgrades don't break assembly references to other installed apps. -->
<PropertyGroup>
<AssemblyVersion>$(RoslynSemanticVersion).0</AssemblyVersion>
</PropertyGroup>
</When>
<When Condition="('$(BuildNumber)' != '') and ($(BuildNumber.Split('.').Length) == 2)">
<!-- The user specified a build number, so we should use that. -->
<PropertyGroup>
<AssemblyVersion>$(RoslynSemanticVersion).0</AssemblyVersion>
<BuildVersion>$(RoslynSemanticVersion).$(BuildNumber.Split('.')[0])</BuildVersion>
</PropertyGroup>
</When>
<When Condition="'$(OfficialBuild)' == 'true' OR '$(RealSignBuild)' == 'true' OR '$(SignType)' == 'real'">
<!-- We're creating an official or real-signed build, but don't have a build number. Just use the RoslynSemanticVersion.
This happens if the build template does not pass BuildNumber down to MSBuild. -->
<PropertyGroup>
<AssemblyVersion>$(RoslynSemanticVersion).0</AssemblyVersion>
<BuildVersion>$(RoslynSemanticVersion).0</BuildVersion>
</PropertyGroup>
</When>
<Otherwise>
<!-- No build version was supplied. We'll use a special version, higher than anything
installed, so that the assembly identity is different. This will allows us to
have a build with an actual number installed, but then build and F5 a build with
this number. -->
<PropertyGroup>
<BuildVersion>42.42.42.42</BuildVersion>
<AssemblyVersion>42.42.42.42</AssemblyVersion>
</PropertyGroup>
</Otherwise>
</Choose>
<!-- Returns the current build version. Used in .vsixmanifests to substitute our build version into them -->
<Target Name="GetBuildVersion" Outputs="$(BuildVersion)" />
<!-- NuGet version -->
<PropertyGroup>
<BuildNumberSuffix Condition="('$(TF_BUILD_BUILDNUMBER)' != '')
and ($(TF_BUILD_BUILDNUMBER.Split('_').Length) == 2)">$(TF_BUILD_BUILDNUMBER.Split('_')[1])</BuildNumberSuffix>
<BuildNumberPart1 Condition="'$(BuildNumberSuffix)' != ''">
$(BuildNumberSuffix.Split('.')[0])
</BuildNumberPart1>
<BuildNumberPart2 Condition="'$(BuildNumberSuffix)' != ''">
$(BuildNumberSuffix.Split('.')[1].PadLeft(2,'0'))
</BuildNumberPart2>
<!-- Only set when building RTM with no dependencies on pre-release packages
<NuGetReleaseVersion>$(RoslynSemanticVersion)</NuGetReleaseVersion>
-->
<NuGetPreReleaseVersion>$(RoslynSemanticVersion)-beta1</NuGetPreReleaseVersion>
<NuGetPerBuildPreReleaseVersion Condition="'$(BuildNumberSuffix)' != ''">$(NuGetPreReleaseVersion)-$(BuildNumberPart1.Trim())-$(BuildNumberPart2.Trim())</NuGetPerBuildPreReleaseVersion>
</PropertyGroup>
</Project>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="VSL.Versions.targets"/>
<Import Project="Settings.targets"/>
</Project>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RoslynSemanticVersion Condition="'$(RoslynSemanticVersion)' == ''">1.2.0</RoslynSemanticVersion>
<SystemReflectionMetadataAssemblyVersion Condition="'$(SystemReflectionMetadataAssemblyVersion)' == ''">1.2.0</SystemReflectionMetadataAssemblyVersion>
<SystemCollectionsImmutableAssemblyVersion Condition="'$(SystemCollectionsImmutableAssemblyVersion)' == ''">1.1.37</SystemCollectionsImmutableAssemblyVersion>
<NuGetCommandLineAssemblyVersion Condition="'$(NuGetCommandLineAssemblyVersion)' == ''">2.8.5</NuGetCommandLineAssemblyVersion>
<MicrosoftCompositionAssemblyVersion Condition="'$(MicrosoftCompositionAssemblyVersion)' == ''">1.0.27</MicrosoftCompositionAssemblyVersion>
<SystemReflectionMetadataVersion>$(SystemReflectionMetadataAssemblyVersion)-rc2-23608</SystemReflectionMetadataVersion>
<SystemCollectionsImmutableVersion>$(SystemCollectionsImmutableAssemblyVersion)</SystemCollectionsImmutableVersion>
<MicrosoftDiaSymReaderNativeVersion>1.3.3</MicrosoftDiaSymReaderNativeVersion>
<NuGetCommandLineVersion>$(NuGetCommandLineAssemblyVersion)</NuGetCommandLineVersion>
<MicrosoftCompositionVersion>$(MicrosoftCompositionAssemblyVersion)</MicrosoftCompositionVersion>
<!-- Versioning is independent, this should not be the Roslyn semantic version -->
<CodeAnalysisAnalyzersVersion Condition="'$(CodeAnalysisAnalyzersVersion)' == ''">1.1.0</CodeAnalysisAnalyzersVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(BuildVersion)' != ''">
<!-- The user specified a build version number. In that case, we'll use their version number
for the file version, and force the assembly version to $(RoslynSemanticVersion).0. That way
day-to-day upgrades don't break assembly references to other installed apps. -->
<PropertyGroup>
<AssemblyVersion>$(RoslynSemanticVersion).0</AssemblyVersion>
</PropertyGroup>
</When>
<When Condition="('$(BuildNumber)' != '') and ($(BuildNumber.Split('.').Length) == 2)">
<!-- The user specified a build number, so we should use that. -->
<PropertyGroup>
<AssemblyVersion>$(RoslynSemanticVersion).0</AssemblyVersion>
<BuildVersion>$(RoslynSemanticVersion).$(BuildNumber.Split('.')[0])</BuildVersion>
</PropertyGroup>
</When>
<When Condition="'$(OfficialBuild)' == 'true' OR '$(RealSignBuild)' == 'true' OR '$(SignType)' == 'real'">
<!-- We're creating an official or real-signed build, but don't have a build number. Just use the RoslynSemanticVersion.
This happens if the build template does not pass BuildNumber down to MSBuild. -->
<PropertyGroup>
<AssemblyVersion>$(RoslynSemanticVersion).0</AssemblyVersion>
<BuildVersion>$(RoslynSemanticVersion).0</BuildVersion>
</PropertyGroup>
</When>
<Otherwise>
<!-- No build version was supplied. We'll use a special version, higher than anything
installed, so that the assembly identity is different. This will allows us to
have a build with an actual number installed, but then build and F5 a build with
this number. -->
<PropertyGroup>
<BuildVersion>42.42.42.42</BuildVersion>
<AssemblyVersion>42.42.42.42</AssemblyVersion>
</PropertyGroup>
</Otherwise>
</Choose>
<!-- Returns the current build version. Used in .vsixmanifests to substitute our build version into them -->
<Target Name="GetBuildVersion" Outputs="$(BuildVersion)" />
<!-- NuGet version -->
<PropertyGroup>
<BuildNumberSuffix Condition="('$(TF_BUILD_BUILDNUMBER)' != '')
and ($(TF_BUILD_BUILDNUMBER.Split('_').Length) == 2)">$(TF_BUILD_BUILDNUMBER.Split('_')[1])</BuildNumberSuffix>
<BuildNumberPart1 Condition="'$(BuildNumberSuffix)' != ''">
$(BuildNumberSuffix.Split('.')[0])
</BuildNumberPart1>
<BuildNumberPart2 Condition="'$(BuildNumberSuffix)' != ''">
$(BuildNumberSuffix.Split('.')[1].PadLeft(2,'0'))
</BuildNumberPart2>
<!-- Only set when building RTM with no dependencies on pre-release packages
<NuGetReleaseVersion>$(RoslynSemanticVersion)</NuGetReleaseVersion>
-->
<NuGetPreReleaseVersion>$(RoslynSemanticVersion)-beta1</NuGetPreReleaseVersion>
<NuGetPerBuildPreReleaseVersion Condition="'$(BuildNumberSuffix)' != ''">$(NuGetPreReleaseVersion)-$(BuildNumberPart1.Trim())-$(BuildNumberPart2.Trim())</NuGetPerBuildPreReleaseVersion>
</PropertyGroup>
</Project>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册