|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" |
| 3 | + InitialTargets="CopyToOutputDirectoryAlwaysError" > |
| 4 | + |
| 5 | + <!-- Ensures that if this file changes it forces a rebuild --> |
| 6 | + <PropertyGroup> |
| 7 | + <MSBuildAllProjects> |
| 8 | + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) |
| 9 | + </MSBuildAllProjects> |
| 10 | + </PropertyGroup> |
| 11 | + |
| 12 | + <PropertyGroup> |
| 13 | + <BuildRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.root))</BuildRoot> |
| 14 | + <TargetsPath>$(BuildRoot)\Build</TargetsPath> |
| 15 | + <OsVersion>$(registry:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion@CurrentVersion)</OsVersion> |
| 16 | + </PropertyGroup> |
| 17 | + |
| 18 | + <Target Name="CopyToOutputDirectoryAlwaysError" |
| 19 | + Condition="'@(Content)'!='' or '@(None)'!=''"> |
| 20 | + <Error Condition="'%(Content.CopyToOutputDirectory)'=='Always'" Text="CopyToOutputDirectory is not allowed to be 'Always'. Use 'PreserveNewest' instead." File="$(MSBuildProjectFile)" /> |
| 21 | + <Error Condition="'%(None.CopyToOutputDirectory)'=='Always'" Text="CopyToOutputDirectory is not allowed to be 'Always'. Use 'PreserveNewest' instead." File="$(MSBuildProjectFile)" /> |
| 22 | + </Target> |
| 23 | + |
| 24 | + <Import Condition="Exists('$(BuildRoot)\..\Build\environment.casablanca.settings')" Project="$(BuildRoot)\..\Build\environment.casablanca.settings"/> |
| 25 | + <PropertyGroup> |
| 26 | + <BinaryDependencies>$(TargetsPath)\BinaryDependencies</BinaryDependencies> |
| 27 | + <Configuration Condition="'$(Configuration)'==''">Debug</Configuration> |
| 28 | + <Platform Condition="'$(Platform)'==''">Win32</Platform> |
| 29 | + <ErrorReport>prompt</ErrorReport> |
| 30 | + <WarningLevel>4</WarningLevel> |
| 31 | + |
| 32 | + <MSBuildCommunityTasksPath Condition="'$(MSBuildCommunityTasksPath)'==''">$(BuildRoot)\Build\MSBuild.Community.Tasks</MSBuildCommunityTasksPath> |
| 33 | + <WixToolPath Condition="'$(WixToolPath)'==''">$(BuildRoot)\Build\Wix\3.6\</WixToolPath> |
| 34 | + <WixExtDir Condition="'$(WixExtDir)'==''">$(WixToolPath)</WixExtDir> |
| 35 | + <WixTargetsPath>$(WixToolPath)Wix.targets</WixTargetsPath> |
| 36 | + <WixTasksPath >$(WixToolPath)WixTasks.dll</WixTasksPath> |
| 37 | + <LuxTargetsPath>$(WixToolPath)Lux.targets</LuxTargetsPath> |
| 38 | + <LuxTasksPath >$(WixToolPath)LuxTasks.dll</LuxTasksPath> |
| 39 | + |
| 40 | + <!--If Dev10 and Dev11 are both installed, the default is to build Dev11. This can be overridden by setting the DevToolsVersion variable in powershell--> |
| 41 | + <DevToolsVersion Condition="'$(DevToolsVersion)' == '' And '$(VS110COMNTOOLS)' != ''">110</DevToolsVersion> |
| 42 | + <DevToolsVersion Condition="'$(DevToolsVersion)' == '' And '$(VS100COMNTOOLS)' != ''">100</DevToolsVersion> |
| 43 | + |
| 44 | + <TestRoot>$(BuildRoot)\Release\Tests</TestRoot> |
| 45 | + <CasablancaSrcDir>$(BuildRoot)\Release\src</CasablancaSrcDir> |
| 46 | + <CasablancaIncludeDir>$(BuildRoot)\Release\include</CasablancaIncludeDir> |
| 47 | + <CollateralsDir>$(BuildRoot)\Release\Collateral</CollateralsDir> |
| 48 | + |
| 49 | + <!--For C#:--> |
| 50 | + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
| 51 | + <!-- RunCodeAnalysis, false by default, is set true as necessary from the msbuild command line. --> |
| 52 | + <!-- This is normally done for the gated checkin build. --> |
| 53 | + <RunCodeAnalysis Condition="'$(RunCodeAnalysis)'==''">false</RunCodeAnalysis> |
| 54 | + <EnableCPPAnalysis Condition="'$(EnableCPPAnalysis)'==''">$(RunCodeAnalysis)</EnableCPPAnalysis> |
| 55 | + <CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors> |
| 56 | + <!-- This is overridden in Release.Product.settings and Release.Tests.settings. --> |
| 57 | + <StyleCopEnabled Condition="'$(StyleCopEnabled)'==''">true</StyleCopEnabled> |
| 58 | + |
| 59 | + <!-- Set LinkIncremental, WholeProgramOptimization, unless they were already set in CodeCoverage.proj. --> |
| 60 | + <LinkIncremental Condition="'$(LinkIncremental)'=='' And '$(Configuration)'=='Debug'">true</LinkIncremental> |
| 61 | + <LinkIncremental Condition="'$(LinkIncremental)'=='' And '$(Configuration)'!='Debug'">false</LinkIncremental> |
| 62 | + <WholeProgramOptimization Condition="'$(WholeProgramOptimization)'=='' And '$(Configuration)'=='Debug'">false</WholeProgramOptimization> |
| 63 | + <WholeProgramOptimization Condition="'$(WholeProgramOptimization)'=='' And '$(Configuration)'!='Debug'">true</WholeProgramOptimization> |
| 64 | + </PropertyGroup> |
| 65 | + |
| 66 | + <PropertyGroup Condition="'$(DevToolsVersion)' == '100'"> <PlatformToolset>v100</PlatformToolset> |
| 67 | + <DevEnvDir>$(VS100COMNTOOLS)..\IDE</DevEnvDir> |
| 68 | + </PropertyGroup> |
| 69 | + |
| 70 | + <PropertyGroup Condition="'$(DevToolsVersion)' == '110'"> |
| 71 | + <DevEnvDir>$(VS110COMNTOOLS)..\IDE</DevEnvDir> |
| 72 | + </PropertyGroup> |
| 73 | + |
| 74 | + <!--For Incubation only:--> |
| 75 | + <PropertyGroup> |
| 76 | + <ActorsIncludeDir>$(BuildRoot)\Incubation\Actors\include</ActorsIncludeDir> |
| 77 | + <ActorsInternalIncludeDir>$(BuildRoot)\Incubation\Actors\internalinc</ActorsInternalIncludeDir> |
| 78 | + </PropertyGroup> |
| 79 | + |
| 80 | + <ItemDefinitionGroup> |
| 81 | + <ClCompile> |
| 82 | + <WarningLevel>Level4</WarningLevel> |
| 83 | + <PrecompiledHeader>Use</PrecompiledHeader> |
| 84 | + <TreatWarningAsError Condition="'$(TreatWarningsAsErrors)' != ''">true</TreatWarningAsError> |
| 85 | + <EnablePREfast>$(EnableCPPAnalysis)</EnablePREfast> |
| 86 | + <CompileAsManaged Condition="'$(CompileAsManagedDefault)' != ''">true</CompileAsManaged> |
| 87 | + </ClCompile> |
| 88 | + </ItemDefinitionGroup> |
| 89 | + |
| 90 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
| 91 | + <ClCompile> |
| 92 | + <Optimization>Disabled</Optimization> |
| 93 | + <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 94 | + </ClCompile> |
| 95 | + <Link> |
| 96 | + <GenerateDebugInformation>true</GenerateDebugInformation> |
| 97 | + </Link> |
| 98 | + </ItemDefinitionGroup> |
| 99 | + |
| 100 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> |
| 101 | + <ClCompile> |
| 102 | + <PreprocessorDefinitions>_WIN64;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 103 | + </ClCompile> |
| 104 | + <Link> |
| 105 | + <GenerateDebugInformation>true</GenerateDebugInformation> |
| 106 | + </Link> |
| 107 | + </ItemDefinitionGroup> |
| 108 | + |
| 109 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'"> |
| 110 | + <ClCompile> |
| 111 | + <PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 112 | + </ClCompile> |
| 113 | + <Link> |
| 114 | + <GenerateDebugInformation>true</GenerateDebugInformation> |
| 115 | + </Link> |
| 116 | + </ItemDefinitionGroup> |
| 117 | + |
| 118 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> |
| 119 | + <ClCompile> |
| 120 | + <PreprocessorDefinitions>_WIN64;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 121 | + </ClCompile> |
| 122 | + <Link> |
| 123 | + <GenerateDebugInformation>true</GenerateDebugInformation> |
| 124 | + </Link> |
| 125 | + </ItemDefinitionGroup> |
| 126 | + |
| 127 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'"> |
| 128 | + <ClCompile> |
| 129 | + <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 130 | + </ClCompile> |
| 131 | + <Link> |
| 132 | + <GenerateDebugInformation>true</GenerateDebugInformation> |
| 133 | + </Link> |
| 134 | + </ItemDefinitionGroup> |
| 135 | + |
| 136 | + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
| 137 | + <ClCompile> |
| 138 | + <PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
| 139 | + </ClCompile> |
| 140 | + <Link> |
| 141 | + <GenerateDebugInformation>true</GenerateDebugInformation> |
| 142 | + </Link> |
| 143 | + </ItemDefinitionGroup> |
| 144 | + |
| 145 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' "> |
| 146 | + <DebugSymbols>true</DebugSymbols> |
| 147 | + <DebugType>full</DebugType> |
| 148 | + <Optimize>false</Optimize> |
| 149 | + <OutputPath>$(BuildRoot)\Binaries\Win32\Debug\</OutputPath> |
| 150 | + <DefineConstants>DEBUG;TRACE</DefineConstants> |
| 151 | + <InstallerPlatform>x86</InstallerPlatform> |
| 152 | + </PropertyGroup> |
| 153 | + |
| 154 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> |
| 155 | + <DebugSymbols>true</DebugSymbols> |
| 156 | + <DebugType>full</DebugType> |
| 157 | + <Optimize>false</Optimize> |
| 158 | + <OutputPath>$(BuildRoot)\Binaries\x64\Debug\</OutputPath> |
| 159 | + <DefineConstants>DEBUG;TRACE;X64</DefineConstants> |
| 160 | + </PropertyGroup> |
| 161 | + |
| 162 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' "> |
| 163 | + <DebugType>pdbonly</DebugType> |
| 164 | + <Optimize>true</Optimize> |
| 165 | + <OutputPath>$(BuildRoot)\Binaries\Win32\Release\</OutputPath> |
| 166 | + <DefineConstants>TRACE</DefineConstants> |
| 167 | + <InstallerPlatform>x86</InstallerPlatform> |
| 168 | + </PropertyGroup> |
| 169 | + |
| 170 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> |
| 171 | + <DebugType>pdbonly</DebugType> |
| 172 | + <Optimize>true</Optimize> |
| 173 | + <OutputPath>$(BuildRoot)\Binaries\x64\Release\</OutputPath> |
| 174 | + <DefineConstants>TRACE;X64</DefineConstants> |
| 175 | + </PropertyGroup> |
| 176 | + |
| 177 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' "> |
| 178 | + <DebugSymbols>true</DebugSymbols> |
| 179 | + <DebugType>full</DebugType> |
| 180 | + <Optimize>false</Optimize> |
| 181 | + <OutputPath>$(BuildRoot)\Binaries\ARM\Debug\</OutputPath> |
| 182 | + <DefineConstants>DEBUG;TRACE;ARM</DefineConstants> |
| 183 | + </PropertyGroup> |
| 184 | + |
| 185 | + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' "> |
| 186 | + <DebugType>pdbonly</DebugType> |
| 187 | + <Optimize>true</Optimize> |
| 188 | + <OutputPath>$(BuildRoot)\Binaries\ARM\Release\</OutputPath> |
| 189 | + <DefineConstants>TRACE;ARM</DefineConstants> |
| 190 | + </PropertyGroup> |
| 191 | + |
| 192 | + <PropertyGroup> |
| 193 | + <OutDir Condition="'$(OutDir)' == ''">$(OutputPath)</OutDir> |
| 194 | + </PropertyGroup> |
| 195 | + |
| 196 | + <PropertyGroup> |
| 197 | + <OutDir Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')">$(OutDir)\</OutDir> |
| 198 | + </PropertyGroup> |
| 199 | + |
| 200 | + <ItemGroup> |
| 201 | + <CodeAnalysisDictionary Include="$(BuildRoot)\Build\CustomDictionary.xml" /> |
| 202 | + </ItemGroup> |
| 203 | + |
| 204 | + <!-- BEGIN: Workaround for MSBuild.exe bug that will be fixed in v4.5 --> |
| 205 | + <!-- Bug Symptom: --> |
| 206 | + <!-- Multi-proc build returns "CSC : fatal error CS0009: Metadata file '(FilePath)' could not be opened == 'File is corrupt.' --> |
| 207 | + <!-- Bug Cause: --> |
| 208 | + <!-- "We are sharing the resultsbytargets dictionary between build results. --> |
| 209 | + <!-- We return build result A but do some merging of results in build result B --> |
| 210 | + <!-- B is a copy of A sharing the same resultsbyTargets. --> |
| 211 | + <!-- The merging of results into B causes extra target outputs to be put into A --> |
| 212 | + <!-- and when we return A we see these extra results. --> |
| 213 | + <!-- Bug Workaround: --> |
| 214 | + <!-- Since items are bleeding across, they still have metadata we can use to differentiate them. --> |
| 215 | + <!-- This error seems to be specific to items that have CopyToOutputDirectory --> |
| 216 | + <!-- defined (Content, None, etc.) that bleed into _ResolvedProjectReferencePaths. --> |
| 217 | + <!-- So, we will remove items from _ResolvedProjectReferencePaths that have CopyToOutputDirectory defined. --> |
| 218 | + <!-- There may be other places where the underlying bug manifests, but we have not encountered them. --> |
| 219 | + |
| 220 | + <!-- Placeholder target since we're importing this into some non-c# projects as well. --> |
| 221 | + <Target Name="ResolveAssemblyReferences" /> |
| 222 | + |
| 223 | + <!-- Define a default value so we can test items for the metadata without erroring --> |
| 224 | + <ItemDefinitionGroup> |
| 225 | + <_ResolvedProjectReferencePaths> |
| 226 | + <CopyToOutputDirectory>Undefined</CopyToOutputDirectory> |
| 227 | + </_ResolvedProjectReferencePaths> |
| 228 | + </ItemDefinitionGroup> |
| 229 | + |
| 230 | + <!-- Remove all items from _ResolvedProjectReferencePaths that have non-default value for CopyToOutputDirectory --> |
| 231 | + <Target Name="Cleanup_ResolvedProjectReferencePaths" |
| 232 | + BeforeTargets="ResolveAssemblyReferences" |
| 233 | + Condition="'@(_ResolvedProjectReferencePaths)' != ''"> |
| 234 | + <Message Text="Before Cleanup_ResolvedProjectReferencePaths (CopyToOutputDirectory = %(CopyToOutputDirectory)): @(_ResolvedProjectReferencePaths)" |
| 235 | + Importance="Low" /> |
| 236 | + <ItemGroup> |
| 237 | + <_ResolvedProjectReferencePaths Condition="'%(CopyToOutputDirectory)' != 'Undefined'" |
| 238 | + Remove="@(_ResolvedProjectReferencePaths)" /> |
| 239 | + </ItemGroup> |
| 240 | + <Message Text="After Cleanup_ResolvedProjectReferencePaths (CopyToOutputDirectory = %(CopyToOutputDirectory)): @(_ResolvedProjectReferencePaths)" |
| 241 | + Importance="Low" /> |
| 242 | + </Target> |
| 243 | + <!-- END Workaround for MSBuild.exe bug that will be fixed in v4.5 --> |
| 244 | + |
| 245 | +</Project> |
| 246 | + |
0 commit comments