Settings.props 13.9 KB
Newer Older
1
<?xml version="1.0" encoding="utf-8"?>
2
<!-- Copyright (c)  Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information. -->
3
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
J
Jared Parsons 已提交
4

5
  <Import Project="Versions.props" />
J
Jared Parsons 已提交
6 7

  <PropertyGroup>
8 9 10
    <JenkinsBuild>false</JenkinsBuild>
    <JenkinsBuild Condition="'$(JENKINS_HOME)' != ''">true</JenkinsBuild>
    <DeveloperBuild>false</DeveloperBuild>
11
    <DeveloperBuild Condition="'$(OfficialBuild)' != 'true' AND '$(JenkinsBuild)' != 'true'">true</DeveloperBuild>
12

13 14 15
    <RepoRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\'))</RepoRoot>
    <NuGetToolPath>$(RepoRoot)nuget.exe</NuGetToolPath>
    <ToolsetPackagesDir>$(RepoRoot)build\ToolsetPackages\</ToolsetPackagesDir>
J
Jared Parsons 已提交
16 17
    <ToolsetPackagesSemaphore>$(ToolsetPackagesDir)toolsetpackages.semaphore</ToolsetPackagesSemaphore>
    <ToolsetCompilerPackageName>Microsoft.Net.Compilers</ToolsetCompilerPackageName>
18
    <ToolsetCompilerPackageVersion>2.0.1</ToolsetCompilerPackageVersion>
19 20
    <VSIXExpInstallerPackageName>RoslynTools.Microsoft.VSIXExpInstaller</VSIXExpInstallerPackageName>
    <VSIXExpInstallerPackageVersion>0.2.1-beta</VSIXExpInstallerPackageVersion>
J
Jared Parsons 已提交
21 22 23 24 25 26 27 28
    <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>
29 30 31 32
    <BaseOutputPath Condition="'$(BaseOutputPath)' == ''">$(RepoRoot)Binaries\</BaseOutputPath>
    <OutDir>$(BaseOutputPath)$(Configuration)\</OutDir>
    <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$(RepoRoot)Binaries\Obj\</BaseIntermediateOutputPath>
    <IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
J
Jared Parsons 已提交
33 34

    <!-- Workaround until we move to Microsoft.Net.Compilers.nupkg with this fix: https://github.com/dotnet/roslyn/commit/05c12ebfcdd08a02dbceded5327a8da7a7df23be:
35
         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:
J
Jared Parsons 已提交
36 37
         $(NuGetPackageRoot)\Microsoft.Net.Compilers\$(ToolsetCompilerPackageVersion)\build\Microsoft.Net.Compilers.props -->
    <ToolsetCompilerPropsFilePath>$(MSBuildThisFileDirectory)Microsoft.Net.Compilers.props</ToolsetCompilerPropsFilePath>
38
    <TargetFrameworkRootPath>$(NuGetPackageRoot)\RoslynTools.ReferenceAssemblies\$(RoslynToolsReferenceAssembliesVersion)\tools\Framework</TargetFrameworkRootPath>
J
Jared Parsons 已提交
39

J
Jared Parsons 已提交
40
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
J
Jared Parsons 已提交
41 42 43 44 45 46 47 48 49 50 51
    <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>

    <MSBuildAssemblyNameFragment>Core</MSBuildAssemblyNameFragment>
52

53
    <!-- To copy .dll.config and .exe.config files of the referenced projects to the output dir
54 55
         (see https://github.com/Microsoft/msbuild/issues/1307) -->
    <AllowedReferenceRelatedFileExtensions>$(AllowedReferenceRelatedFileExtensions);.dll.config;.exe.config</AllowedReferenceRelatedFileExtensions>
J
Jared Parsons 已提交
56

57 58 59 60
    <!-- This controls the places MSBuild will consult to resolve assembly references.  This is 
         kept as minimal as possible to make our build reliable from machine to machine.  Global
         locations such as GAC, AssemblyFoldersEx, etc ... are deliberately removed from this 
         list as they will not be the same from machine to machine -->
J
Jared Parsons 已提交
61 62 63 64
    <AssemblySearchPaths>
      {TargetFrameworkDirectory};
      {RawFileName};
    </AssemblySearchPaths>
J
Jared Parsons 已提交
65 66 67 68 69 70 71 72
  </PropertyGroup>

  <!-- Windows specific settings -->
  <PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
    <BaseNuGetRuntimeIdentifier>win7</BaseNuGetRuntimeIdentifier>
    <DebugType>pdbonly</DebugType>
    <UseSharedCompilation>true</UseSharedCompilation>

73
    <!-- Presently our code can build on machines with Dev14 or Dev15 but only successfully deploy
74
         in the Dev15 environment.  -->
75 76
    <IsDev15RC Condition="Exists('$(MSBuildBinPath)\..\..\..\Common7\IDE\Microsoft.VisualStudio.ExtensionEngine.dll')">true</IsDev15RC>
    <IsDev15RC Condition="Exists('$(MSBuildBinPath)\..\..\..\..\Common7\IDE\Microsoft.VisualStudio.ExtensionEngine.dll')">true</IsDev15RC>
77
    <DeployExtension Condition="'$(IsDev15RC)' != 'true' OR '$(VisualStudioVersion)' != '15.0'">false</DeployExtension>
J
Jared Parsons 已提交
78
    <VisualStudioBuildToolsVersion>$(MicrosoftVSSDKBuildToolsVersion)</VisualStudioBuildToolsVersion>
J
Jared Parsons 已提交
79 80 81

    <!-- For the moment our Dev14 VSI suites must continue to use the Dev14 SDK. -->
    <VisualStudioBuildToolsVersion Condition="'$(IsDev14VsiBuild)' == 'true'">14.3.25420</VisualStudioBuildToolsVersion>
J
Jared Parsons 已提交
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
  </PropertyGroup>

  <!-- Unix specific settings -->
  <PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
    <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>
107

J
Jared Parsons 已提交
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
  <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>
126
        <RootNamespace></RootNamespace>
J
Jared Parsons 已提交
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
        <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 -->
188
        <IntDir>$(IntermediateOutputPath)</IntDir>
J
Jared Parsons 已提交
189 190 191 192 193 194 195 196 197 198 199

        <!-- We just always want to build with whatever toolset matches the VS you're building with -->
        <PlatformToolset>v$(VisualStudioReferenceMajorVersion)0</PlatformToolset>
      </PropertyGroup>
    </When>
  </Choose>

  <ItemGroup Condition="'$(ProjectLanguage)' == 'CSharp' AND '$(TargetNetFX20)' == 'true'">
    <_ExplicitReference Include="$(FrameworkPathOverride)\mscorlib.dll" />
  </ItemGroup>

200
  <!-- During bootstrap builds it's important to load our bootstrap tasks before doing any
J
Jared Parsons 已提交
201
       other imports (which could load a same named DLL) -->
202 203 204 205 206 207 208 209 210
  <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)' != ''" />
J
Jared Parsons 已提交
211

212 213
  <!--
    Roslyn uses the WriteCodeFragment task to output generated assembly attributes.  In MSBuild 14.0 update 1 this task
J
Jared Parsons 已提交
214
    produces non-deterministic output.  This is fixed in update 2 but until that is released we use a hand patched
215
    version of the Task that is deterministic.
J
Jared Parsons 已提交
216 217 218 219 220 221 222

    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 -->
223 224
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
          Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props') AND '$(MSBuildProjectExtension)' != '.vcxproj'" />
J
Jared Parsons 已提交
225

J
Jared Parsons 已提交
226
  <Import Project="$(RoslynDiagnosticsPropsFilePath)" Condition="'$(UseRoslynAnalyzers)' == 'true' AND Exists('$(RoslynDiagnosticsPropsFilePath)')" />
J
Jared Parsons 已提交
227 228 229 230 231 232 233 234

  <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 -->
235
    <Import Project="$(MSBuildBinPath)\Microsoft.NuGet.props" Condition="'$(OS)' != 'Windows_NT'" />
J
Jared Parsons 已提交
236
  </ImportGroup>
J
Jared Parsons 已提交
237
</Project>