| 1 |
<Project DefaultTargets="Build" InitialTargets="_CheckForInvalidConfigurationAndPlatform" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 2 |
<PropertyGroup> |
| 3 |
<ImportByWildcardBeforeMicrosoftCommonTargets Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == ''">true</ImportByWildcardBeforeMicrosoftCommonTargets> |
| 4 |
<ImportByWildcardAfterMicrosoftCommonTargets Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == ''">true</ImportByWildcardAfterMicrosoftCommonTargets> |
| 5 |
</PropertyGroup> |
| 6 |
|
| 7 |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore\*" |
| 8 |
Condition="'$(ImportByWildcardBeforeMicrosoftCommonTargets)' == 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportBefore')"/> |
| 9 |
|
| 10 |
<Import Project="$(MSBuildProjectFullPath).user" Condition="Exists('$(MSBuildProjectFullPath).user')"/> |
| 11 |
|
| 12 |
<PropertyGroup> |
| 13 |
<OutputType Condition="'$(OutputType)' == ''">Exe</OutputType> |
| 14 |
<TargetExt Condition="'$(OutputType)' == 'Winexe'">.exe</TargetExt> |
| 15 |
<TargetExt Condition="'$(OutputType)' == 'Exe'">.exe</TargetExt> |
| 16 |
<TargetExt Condition="'$(OutputType)' == 'Library'">.dll</TargetExt> |
| 17 |
<TargetExt Condition="'$(OutputType)' == 'Netmodule'">.netmodule</TargetExt> |
| 18 |
</PropertyGroup> |
| 19 |
|
| 20 |
<PropertyGroup> |
| 21 |
<ProjectDir Condition="'$(ProjectDir)' == ''">$(MSBuildProjectDirectory)\</ProjectDir> |
| 22 |
</PropertyGroup> |
| 23 |
|
| 24 |
<!-- MSBuild defines this even outside of VS, and F# projects depend on it --> |
| 25 |
<PropertyGroup> |
| 26 |
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion> |
| 27 |
</PropertyGroup> |
| 28 |
|
| 29 |
<PropertyGroup> |
| 30 |
<AssemblyName Condition="'$(AssemblyName)' == ''">$(MSBuildProjectName)</AssemblyName> |
| 31 |
<OutputPath Condition="'$(OutputPath)' != '' and !HasTrailingSlash('$(OutputPath)')">$(OutputPath)\</OutputPath> |
| 32 |
<OutputPath Condition=" '$(Platform)'=='' and '$(Configuration)'=='' and '$(OutputPath)'=='' ">bin\Debug\</OutputPath> |
| 33 |
|
| 34 |
<TargetFrameworkIdentifier Condition="'$(TargetFrameworkIdentifier)' == ''">.NETFramework</TargetFrameworkIdentifier> |
| 35 |
<TargetFrameworkVersion Condition="'$(TargetFrameworkVersion)' == ''">v4.0</TargetFrameworkVersion> |
| 36 |
|
| 37 |
<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == '' and '$(TargetFrameworkProfile)' != ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion),Profile=$(TargetFrameworkProfile)</TargetFrameworkMoniker> |
| 38 |
<TargetFrameworkMoniker Condition="'$(TargetFrameworkMoniker)' == ''">$(TargetFrameworkIdentifier),Version=$(TargetFrameworkVersion)</TargetFrameworkMoniker> |
| 39 |
</PropertyGroup> |
| 40 |
|
| 41 |
<PropertyGroup> |
| 42 |
<OutDir Condition="'$(OutDir)' == ''">$(OutputPath)</OutDir> |
| 43 |
<OutDir Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')">$(OutDir)\</OutDir> |
| 44 |
|
| 45 |
<_OriginalConfiguration>$(Configuration)</_OriginalConfiguration> |
| 46 |
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
| 47 |
<ConfigurationName Condition="'$(ConfigurationName)' == ''">$(Configuration)</ConfigurationName> |
| 48 |
|
| 49 |
<_OriginalPlatform>$(Platform)</_OriginalPlatform> |
| 50 |
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
| 51 |
<PlatformName Condition="'$(PlatformName)' == ''">$(Platform)</PlatformName> |
| 52 |
</PropertyGroup> |
| 53 |
|
| 54 |
<!-- in MSBuild, these properties are set in a separate file that is only imported for .NETFramework --> |
| 55 |
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'"> |
| 56 |
<AddAdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == ''">true</AddAdditionalExplicitAssemblyReferences> |
| 57 |
<AdditionalExplicitAssemblyReferences Condition="'$(AddAdditionalExplicitAssemblyReferences)' == 'true' and '$(TargetFrameworkVersion)' != 'v2.0' and '$(TargetFrameworkVersion)' != 'v3.0'">System.Core;$(AdditionalExplicitAssemblyReferences)</AdditionalExplicitAssemblyReferences> |
| 58 |
</PropertyGroup> |
| 59 |
|
| 60 |
<PropertyGroup> |
| 61 |
<SkipCopyUnchangedFiles Condition="'$(SkipCopyUnchangedFiles)' == ''">true</SkipCopyUnchangedFiles> |
| 62 |
</PropertyGroup> |
| 63 |
|
| 64 |
<PropertyGroup> |
| 65 |
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">obj\</BaseIntermediateOutputPath> |
| 66 |
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' != '' and !HasTrailingSlash('$(BaseIntermediateOutputPath)')">$(BaseIntermediateOutputPath)\</BaseIntermediateOutputPath> |
| 67 |
<CleanFile Condition="'$(CleanFile)'==''">$(MSBuildProjectFile).FilesWrittenAbsolute.txt</CleanFile> |
| 68 |
</PropertyGroup> |
| 69 |
|
| 70 |
<PropertyGroup Condition="'$(IntermediateOutputPath)' == ''"> |
| 71 |
<IntermediateOutputPath Condition=" '$(PlatformName)' == 'AnyCPU'">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath> |
| 72 |
<IntermediateOutputPath Condition=" '$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath> |
| 73 |
</PropertyGroup> |
| 74 |
|
| 75 |
<PropertyGroup> |
| 76 |
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' != '' and !HasTrailingSlash('$(IntermediateOutputPath)')">$(IntermediateOutputPath)\</IntermediateOutputPath> |
| 77 |
</PropertyGroup> |
| 78 |
|
| 79 |
<ItemGroup> |
| 80 |
<IntermediateAssembly Include="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt)" /> |
| 81 |
|
| 82 |
<!-- creating this as a item to use FullPath on it, to build TargetPath --> |
| 83 |
<_OutDirItem Include="$(OutDir)"/> |
| 84 |
</ItemGroup> |
| 85 |
|
| 86 |
<PropertyGroup> |
| 87 |
<TargetName Condition="'$(TargetName)' == '' ">$(AssemblyName)</TargetName> |
| 88 |
<TargetFileName Condition="'$(TargetFileName)' == '' ">$(TargetName)$(TargetExt)</TargetFileName> |
| 89 |
<TargetDir Condition=" '$(TargetDir)' == '' ">@(_OutDirItem->'%(FullPath)')</TargetDir> |
| 90 |
<TargetPath Condition=" '$(TargetPath)' == '' ">@(_OutDirItem->'%(FullPath)\$(TargetFileName)')</TargetPath> |
| 91 |
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildProjectFullPath);$(MSBuildToolsPath)\Microsoft.Common.targets</MSBuildAllProjects> |
| 92 |
<KeyOriginatorFile Condition=" '$(SignAssembly)' == 'true' ">$(AssemblyOriginatorKeyFile)</KeyOriginatorFile> |
| 93 |
<TargetingClr2Framework Condition="('$(TargetFrameworkIdentifier)' == '.NETFramework') and ('$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5')">true</TargetingClr2Framework> |
| 94 |
</PropertyGroup> |
| 95 |
|
| 96 |
<Target Name="_CheckForInvalidConfigurationAndPlatform"> |
| 97 |
<Error Condition=" '$(OutputPath)' == '' and '$(SkipInvalidConfigurations)' != 'true'" |
| 98 |
Text="'OutputPath' property is not set for this project. Usually this is caused by invalid Configuration/Platform combination. Original values: Configuration: $(_OriginalConfiguration) Platform: $(_OriginalPlatform)."/> |
| 99 |
|
| 100 |
<Warning Condition=" '$(OutputPath)' == '' and '$(SkipInvalidConfigurations)' == 'true'" |
| 101 |
Text="'OutputPath' property is not set for this project. Usually this is caused by invalid Configuration/Platform combination. Original values: Configuration: $(_OriginalConfiguration) Platform: $(_OriginalPlatform)."/> |
| 102 |
|
| 103 |
<!-- If OutDir is specified via the command line, then the earlier check |
| 104 |
to add a trailing slash won't have any affect, so error here. --> |
| 105 |
<Error |
| 106 |
Condition="'$(OutDir)' != '' and !HasTrailingSlash('$(OutDir)')" |
| 107 |
Text="OutDir property must end with a slash."/> |
| 108 |
</Target> |
| 109 |
|
| 110 |
<PropertyGroup> |
| 111 |
<PrepareForBuildDependsOn>AssignLinkMetadata</PrepareForBuildDependsOn> |
| 112 |
</PropertyGroup> |
| 113 |
<Target Name="PrepareForBuild" DependsOnTargets="$(PrepareForBuildDependsOn)"> |
| 114 |
<Message Importance="High" Text="Configuration: $(Configuration) Platform: $(Platform)"/> |
| 115 |
|
| 116 |
<!-- Look for app.config, if $(AppConfig) is specified, then use that. Else look in |
| 117 |
@(None) and @(Content) --> |
| 118 |
<CreateItem Include="$(AppConfig)" Condition="'$(AppConfig)' != ''" |
| 119 |
AdditionalMetadata="TargetPath=$(TargetFileName).config"> |
| 120 |
<Output TaskParameter="Include" ItemName="AppConfigWithTargetPath" /> |
| 121 |
</CreateItem> |
| 122 |
|
| 123 |
<FindAppConfigFile PrimaryList="@(None)" SecondaryList="@(Content)" TargetPath="$(TargetFileName).config" |
| 124 |
Condition="'$(AppConfig)' == ''"> |
| 125 |
<Output TaskParameter="AppConfigFile" ItemName="AppConfigWithTargetPath"/> |
| 126 |
</FindAppConfigFile> |
| 127 |
|
| 128 |
<MakeDir |
| 129 |
Directories="$(OutDir);$(IntermediateOutputPath);@(DocFileItem->'%(RelativeDir)')" |
| 130 |
/> |
| 131 |
</Target> |
| 132 |
|
| 133 |
<Target Name="AssignLinkMetadata"> |
| 134 |
<AssignLinkMetadata Items="@(EmbeddedResource)" Condition="'@(EmbeddedResource)' != '' and '%(EmbeddedResource.DefiningProjectFullPath)' != '$(MSBuildProjectFullPath)'"> |
| 135 |
<Output TaskParameter="OutputItems" ItemName="_EmbeddedResourceWithLinkAssigned" /> |
| 136 |
</AssignLinkMetadata> |
| 137 |
|
| 138 |
<ItemGroup> |
| 139 |
<EmbeddedResource Remove="@(_EmbeddedResourceWithLinkAssigned)" /> |
| 140 |
<EmbeddedResource Include="@(_EmbeddedResourceWithLinkAssigned)" /> |
| 141 |
<_EmbeddedResourceWithLinkAssigned Remove="@(_EmbeddedResourceWithLinkAssigned)" /> |
| 142 |
</ItemGroup> |
| 143 |
</Target> |
| 144 |
|
| 145 |
<PropertyGroup> |
| 146 |
<GetFrameworkPathsDependsOn /> |
| 147 |
</PropertyGroup> |
| 148 |
<Target Name="GetFrameworkPaths" |
| 149 |
Condition="'$(TargetFrameworkIdentifier)' == '' or '$(TargetFrameworkIdentifier)' == '.NETFramework'" |
| 150 |
DependsOnTargets="$(GetFrameworkPathsDependsOn)"> |
| 151 |
<GetFrameworkPath> |
| 152 |
<Output Condition="'$(TargetFrameworkVersion)' == 'v4.5'" |
| 153 |
TaskParameter="FrameworkVersion45Path" |
| 154 |
ItemName="_CombinedTargetFrameworkDirectoriesItem"/> |
| 155 |
<Output Condition="'$(TargetFrameworkVersion)' == 'v4.0'" |
| 156 |
TaskParameter="FrameworkVersion40Path" |
| 157 |
ItemName="_CombinedTargetFrameworkDirectoriesItem"/> |
| 158 |
<Output Condition="'$(TargetFrameworkVersion)' == 'v3.5'" |
| 159 |
TaskParameter="FrameworkVersion35Path" |
| 160 |
ItemName="_CombinedTargetFrameworkDirectoriesItem"/> |
| 161 |
<Output Condition="'$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'" |
| 162 |
TaskParameter="FrameworkVersion30Path" |
| 163 |
ItemName="_CombinedTargetFrameworkDirectoriesItem"/> |
| 164 |
<Output Condition="'$(TargetFrameworkVersion)' == 'v2.0' or '$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5'" |
| 165 |
TaskParameter="FrameworkVersion20Path" |
| 166 |
ItemName="_CombinedTargetFrameworkDirectoriesItem"/> |
| 167 |
</GetFrameworkPath> |
| 168 |
<CreateProperty Value="@(_CombinedTargetFrameworkDirectoriesItem)"> |
| 169 |
<Output TaskParameter="Value" PropertyName="TargetFrameworkDirectory"/> |
| 170 |
</CreateProperty> |
| 171 |
|
| 172 |
<Warning Text="TargetFrameworkVersion '$(TargetFrameworkVersion)' not supported by this toolset (ToolsVersion: $(MSBuildToolsVersion))." |
| 173 |
Condition="'$(TargetFrameworkVersion)' != 'v4.5' and '$(TargetFrameworkVersion)' != 'v4.0' and '$(TargetFrameworkVersion)' != 'v3.5' and '$(TargetFrameworkVersion)' != 'v3.0' and '$(TargetFrameworkVersion)' != 'v2.0'"/> |
| 174 |
</Target> |
| 175 |
|
| 176 |
<PropertyGroup> |
| 177 |
<GetReferenceAssemblyPathsDependsOn /> |
| 178 |
</PropertyGroup> |
| 179 |
<Target Name="GetReferenceAssemblyPaths" DependsOnTargets="$(GetReferenceAssemblyPathsDependsOn)"> |
| 180 |
<!-- in case of .NETFramework, $(TargetFrameworkDirectory) would have been set by |
| 181 |
GetFrameworkPaths, if it hasn't been changed, then clear it, to avoid duplicates --> |
| 182 |
<CreateProperty Value="" Condition="'@(_CombinedTargetFrameworkDirectoriesItem)' == '$(TargetFrameworkDirectory)'"> |
| 183 |
<Output TaskParameter="Value" PropertyName="TargetFrameworkDirectory"/> |
| 184 |
</CreateProperty> |
| 185 |
|
| 186 |
<GetReferenceAssemblyPaths |
| 187 |
Condition="'$(TargetFrameworkMoniker)' != '' and '$(_TargetFrameworkDirectories)' == ''" |
| 188 |
TargetFrameworkMoniker="$(TargetFrameworkMoniker)" |
| 189 |
RootPath="$(TargetFrameworkRootPath)"> |
| 190 |
|
| 191 |
<Output TaskParameter="ReferenceAssemblyPaths" PropertyName="_TargetFrameworkDirectories"/> |
| 192 |
<Output TaskParameter="FullFrameworkReferenceAssemblyPaths" PropertyName="_FullFrameworkReferenceAssemblyPaths"/> |
| 193 |
<Output TaskParameter="TargetFrameworkMonikerDisplayName" PropertyName="TargetFrameworkMonikerDisplayName"/> |
| 194 |
</GetReferenceAssemblyPaths> |
| 195 |
|
| 196 |
|
| 197 |
<!-- Remove duplicates. --> |
| 198 |
<ItemGroup> |
| 199 |
<_TargetFrameworkDirectories Include="$(_TargetFrameworkDirectories);$(TargetFrameworkDirectory)" KeepDuplicates="false" /> |
| 200 |
</ItemGroup> |
| 201 |
<PropertyGroup> |
| 202 |
<TargetFrameworkDirectory>@(_TargetFrameworkDirectories)</TargetFrameworkDirectory> |
| 203 |
</PropertyGroup> |
| 204 |
|
| 205 |
<ItemGroup Condition="'$(ImplicitlyExpandDesignTimeFacades)' == 'true'"> |
| 206 |
<DesignTimeFacadeDirectoryRoots Include="$(TargetFrameworkDirectory)" /> |
| 207 |
<DesignTimeFacadeDirectories Include="%(DesignTimeFacadeDirectoryRoots.Identity)\Facades\" Condition="Exists('%(DesignTimeFacadeDirectoryRoots.Identity)\Facades\')" /> |
| 208 |
<_DesignTimeFacadeAssemblies Include="%(DesignTimeFacadeDirectories.Identity)\*.dll"/> |
| 209 |
</ItemGroup> |
| 210 |
|
| 211 |
<PropertyGroup Condition="'@(DesignTimeFacadeDirectories)' != ''"> |
| 212 |
<TargetFrameworkDirectory>$(TargetFrameworkDirectory);@(DesignTimeFacadeDirectories)</TargetFrameworkDirectory> |
| 213 |
</PropertyGroup> |
| 214 |
|
| 215 |
</Target> |
| 216 |
|
| 217 |
<PropertyGroup> |
| 218 |
<AllowedReferenceAssemblyFileExtensions Condition=" '$(AllowedReferenceAssemblyFileExtensions)' == '' "> |
| 219 |
.exe; |
| 220 |
.dll |
| 221 |
</AllowedReferenceAssemblyFileExtensions> |
| 222 |
|
| 223 |
<AllowedReferenceRelatedFileExtensions Condition=" '$(AllowedReferenceRelatedFileExtensions)' == '' "> |
| 224 |
.exe.mdb; |
| 225 |
.dll.mdb; |
| 226 |
.pdb; |
| 227 |
.xml |
| 228 |
</AllowedReferenceRelatedFileExtensions> |
| 229 |
|
| 230 |
<AssemblySearchPaths Condition="'$(AssemblySearchPaths)' == ''"> |
| 231 |
{CandidateAssemblyFiles}; |
| 232 |
$(ReferencePath); |
| 233 |
@(AdditionalReferencePath); |
| 234 |
{HintPathFromItem}; |
| 235 |
{TargetFrameworkDirectory}; |
| 236 |
{PkgConfig}; |
| 237 |
{GAC}; |
| 238 |
{RawFileName}; |
| 239 |
$(OutDir) |
| 240 |
</AssemblySearchPaths> |
| 241 |
|
| 242 |
<ResolveReferencesDependsOn> |
| 243 |
BeforeResolveReferences; |
| 244 |
ResolveProjectReferences; |
| 245 |
ResolveAssemblyReferences; |
| 246 |
AfterResolveReferences |
| 247 |
</ResolveReferencesDependsOn> |
| 248 |
|
| 249 |
<ResolveAssemblyReferencesDependsOn> |
| 250 |
GetFrameworkPaths; |
| 251 |
GetReferenceAssemblyPaths; |
| 252 |
PrepareForBuild |
| 253 |
</ResolveAssemblyReferencesDependsOn> |
| 254 |
</PropertyGroup> |
| 255 |
|
| 256 |
<PropertyGroup Condition="'$(TargetFrameworkMoniker)' != ''"> |
| 257 |
<TargetFrameworkMonikerAssemblyAttributesPath Condition="'$(TargetFrameworkMonikerAssemblyAttributesPath)' == ''">$(IntermediateOutputPath)$(TargetFrameworkMoniker).AssemblyAttribute$(DefaultLanguageSourceExtension)</TargetFrameworkMonikerAssemblyAttributesPath> |
| 258 |
<GenerateTargetFrameworkAttribute Condition="'$(GenerateTargetFrameworkAttribute)' == '' and '$(TargetFrameworkMoniker)' |
| 259 |
!= '' and '$(TargetingClr2Framework)' != 'true'">true</GenerateTargetFrameworkAttribute> |
| 260 |
</PropertyGroup> |
| 261 |
|
| 262 |
<ItemGroup Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'"> |
| 263 |
<FileWrites Include="$(TargetFrameworkMonikerAssemblyAttributesPath)" /> |
| 264 |
</ItemGroup> |
| 265 |
|
| 266 |
<Target Name="_GenerateTargetFrameworkMonikerAttribute" |
| 267 |
DependsOnTargets="PrepareForBuild;GetReferenceAssemblyPaths" |
| 268 |
Inputs="$(MSBuildToolsPath)\Microsoft.Common.targets" |
| 269 |
Outputs="$(TargetFrameworkMonikerAssemblyAttributesPath)"> |
| 270 |
|
| 271 |
<WriteLinesToFile |
| 272 |
File="$(TargetFrameworkMonikerAssemblyAttributesPath)" |
| 273 |
Lines="$(TargetFrameworkMonikerAssemblyAttributeText)" |
| 274 |
Overwrite="true" |
| 275 |
ContinueOnError="true" |
| 276 |
Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''" |
| 277 |
/> |
| 278 |
</Target> |
| 279 |
|
| 280 |
<Target Name="GenerateTargetFrameworkMonikerAttribute" |
| 281 |
DependsOnTargets="_GenerateTargetFrameworkMonikerAttribute" |
| 282 |
Condition="'$(GenerateTargetFrameworkAttribute)' == 'true'"> |
| 283 |
|
| 284 |
<ItemGroup Condition="'@(Compile)' != '' and '$(TargetFrameworkMonikerAssemblyAttributeText)' != ''"> |
| 285 |
<Compile Include="$(TargetFrameworkMonikerAssemblyAttributesPath)"/> |
| 286 |
</ItemGroup> |
| 287 |
</Target> |
| 288 |
|
| 289 |
<Target Name="ResolveReferences" DependsOnTargets="$(ResolveReferencesDependsOn)"/> |
| 290 |
|
| 291 |
<Target Name="BeforeResolveReferences" /> |
| 292 |
<Target Name="AfterResolveReferences" /> |
| 293 |
|
| 294 |
<Target Name="ResolveAssemblyReferences" DependsOnTargets="$(ResolveAssemblyReferencesDependsOn)"> |
| 295 |
<CreateItem Include="@(Reference)" Exclude="$(AdditionalExplicitAssemblyReferences)"> |
| 296 |
<Output TaskParameter="Include" ItemName="_Reference"/> |
| 297 |
</CreateItem> |
| 298 |
|
| 299 |
<CreateItem Include="$(AdditionalExplicitAssemblyReferences)"> |
| 300 |
<Output TaskParameter="Include" ItemName="_Reference"/> |
| 301 |
</CreateItem> |
| 302 |
|
| 303 |
<ResolveAssemblyReference |
| 304 |
Assemblies="@(_Reference)" |
| 305 |
AssemblyFiles="@(ChildProjectReferences);@(_ExplicitReference)" |
| 306 |
SearchPaths="$(AssemblySearchPaths)" |
| 307 |
CandidateAssemblyFiles="@(Content);@(None)" |
| 308 |
TargetFrameworkDirectories="$(TargetFrameworkDirectory)" |
| 309 |
AllowedAssemblyExtensions="$(AllowedReferenceAssemblyFileExtensions)" |
| 310 |
AllowedRelatedFileExtensions="$(AllowedReferenceRelatedFileExtensions)" |
| 311 |
FindDependencies="true" |
| 312 |
FindSatellites="true" |
| 313 |
FindRelatedFiles="true" |
| 314 |
TargetFrameworkMoniker="$(TargetFrameworkMoniker)" |
| 315 |
TargetFrameworkMonikerDisplayName="$(TargetFrameworkMonikerDisplayName)" |
| 316 |
TargetFrameworkVersion="$(TargetFrameworkVersion)" |
| 317 |
> |
| 318 |
<Output TaskParameter="ResolvedFiles" ItemName="ResolvedFiles"/> |
| 319 |
<Output TaskParameter="ResolvedFiles" ItemName="ReferencePath"/> |
| 320 |
<Output TaskParameter="ResolvedDependencyFiles" ItemName="ReferenceDependencyPaths"/> |
| 321 |
<Output TaskParameter="RelatedFiles" ItemName="_ReferenceRelatedPaths"/> |
| 322 |
<Output TaskParameter="SatelliteFiles" ItemName="ReferenceSatellitePaths"/> |
| 323 |
<Output TaskParameter="CopyLocalFiles" ItemName="ReferenceCopyLocalPaths"/> |
| 324 |
|
| 325 |
<!-- FIXME: backwards compatibility --> |
| 326 |
<Output TaskParameter="ResolvedDependencyFiles" ItemName="_ResolvedDependencyFiles"/> |
| 327 |
</ResolveAssemblyReference> |
| 328 |
</Target> |
| 329 |
|
| 330 |
<Target |
| 331 |
Name="AssignProjectConfiguration" |
| 332 |
Condition="'@(ProjectReference)' != ''"> |
| 333 |
|
| 334 |
<!-- assign configs if building a solution file --> |
| 335 |
<AssignProjectConfiguration |
| 336 |
ProjectReferences = "@(ProjectReference)" |
| 337 |
SolutionConfigurationContents = "$(CurrentSolutionConfigurationContents)" |
| 338 |
Condition="$(CurrentSolutionConfigurationContents) != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')"> |
| 339 |
|
| 340 |
<Output TaskParameter = "AssignedProjects" ItemName = "ProjectReferenceWithConfiguration"/> |
| 341 |
</AssignProjectConfiguration> |
| 342 |
|
| 343 |
<!-- Else, just --> |
| 344 |
<CreateItem Include="@(ProjectReference)" Condition="$(CurrentSolutionConfigurationContents) == '' or ('$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true')"> |
| 345 |
<Output TaskParameter="Include" ItemName="ProjectReferenceWithConfiguration"/> |
| 346 |
</CreateItem> |
| 347 |
|
| 348 |
</Target> |
| 349 |
|
| 350 |
<!-- Split projects into 2 lists |
| 351 |
ProjectReferenceWithConfigurationExistent: Projects existent on disk |
| 352 |
ProjectReferenceWithConfigurationNonExistent: Projects non-existent on disk --> |
| 353 |
|
| 354 |
<Target Name="SplitProjectReferencesByExistent" |
| 355 |
DependsOnTargets="AssignProjectConfiguration"> |
| 356 |
|
| 357 |
<CreateItem Include="@(ProjectReferenceWithConfiguration)" Condition="'@(ProjectReferenceWithConfiguration)' != ''"> |
| 358 |
<Output TaskParameter="Include" ItemName="ProjectReferenceWithConfigurationExistent" |
| 359 |
Condition="Exists ('%(ProjectReferenceWithConfiguration.Identity)')"/> |
| 360 |
|
| 361 |
<Output TaskParameter="Include" ItemName="ProjectReferenceWithConfigurationNonExistent" |
| 362 |
Condition="!Exists ('%(ProjectReferenceWithConfiguration.Identity)')"/> |
| 363 |
</CreateItem> |
| 364 |
</Target> |
| 365 |
|
| 366 |
<Target |
| 367 |
Name="ResolveProjectReferences" |
| 368 |
DependsOnTargets="SplitProjectReferencesByExistent" |
| 369 |
> |
| 370 |
<!-- If building from a .sln.proj or from IDE, then referenced projects have already |
| 371 |
been built, so just get the target paths --> |
| 372 |
<MSBuild |
| 373 |
Projects="@(ProjectReferenceWithConfigurationExistent)" |
| 374 |
Targets="GetTargetPath" |
| 375 |
Properties="%(ProjectReferenceWithConfigurationExistent.SetConfiguration); %(ProjectReferenceWithConfigurationExistent.SetPlatform)" |
| 376 |
Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and ('$(BuildingSolutionFile)' == 'true' or '$(BuildingInsideVisualStudio)' == 'true')"> |
| 377 |
|
| 378 |
<Output TaskParameter="TargetOutputs" ItemName="ChildProjectReferences" Condition="'%(ProjectReferenceWithConfigurationExistent.ReferenceOutputAssembly)' != 'false'"/> |
| 379 |
</MSBuild> |
| 380 |
|
| 381 |
<!-- Building a project directly, build the referenced the projects also --> |
| 382 |
<MSBuild |
| 383 |
Projects="@(ProjectReferenceWithConfigurationExistent)" |
| 384 |
Properties="%(ProjectReferenceWithConfigurationExistent.SetConfiguration); %(ProjectReferenceWithConfigurationExistent.SetPlatform)" |
| 385 |
Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and '$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' "> |
| 386 |
|
| 387 |
<Output TaskParameter="TargetOutputs" ItemName="ChildProjectReferences" Condition="'%(ProjectReferenceWithConfigurationExistent.ReferenceOutputAssembly)' != 'false'"/> |
| 388 |
</MSBuild> |
| 389 |
|
| 390 |
<Warning Text="Referenced Project %(ProjectReferenceWithConfigurationNonExistent.Identity) not found, ignoring." |
| 391 |
Condition="'@(ProjectReferenceWithConfigurationNonExistent)' != ''"/> |
| 392 |
</Target> |
| 393 |
|
| 394 |
<Target Name = "CopyFilesMarkedCopyLocal"> |
| 395 |
<Copy |
| 396 |
SourceFiles="@(ReferenceCopyLocalPaths)" |
| 397 |
DestinationFiles="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" |
| 398 |
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"> |
| 399 |
<Output TaskParameter = "DestinationFiles" ItemName = "FileWritesShareable"/> |
| 400 |
</Copy> |
| 401 |
</Target> |
| 402 |
|
| 403 |
<Target Name="_ComputeNonExistentFileProperty" Condition='false'> |
| 404 |
<CreateProperty Value="__NonExistentSubDir__\__NonExistentFile__"> |
| 405 |
<Output TaskParameter="Value" PropertyName="NonExistentFile"/> |
| 406 |
</CreateProperty> |
| 407 |
</Target> |
| 408 |
|
| 409 |
<PropertyGroup> |
| 410 |
<BuildDependsOn> |
| 411 |
BuildOnlySettings; |
| 412 |
BeforeBuild; |
| 413 |
CoreBuild; |
| 414 |
AfterBuild |
| 415 |
</BuildDependsOn> |
| 416 |
</PropertyGroup> |
| 417 |
|
| 418 |
<Target Name="BuildOnlySettings"/> |
| 419 |
<Target Name="BeforeBuild"/> |
| 420 |
<Target Name="AfterBuild"/> |
| 421 |
|
| 422 |
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" Outputs="$(TargetPath)"/> |
| 423 |
|
| 424 |
<PropertyGroup> |
| 425 |
<CoreBuildDependsOn> |
| 426 |
PrepareForBuild; |
| 427 |
GetFrameworkPaths; |
| 428 |
GetReferenceAssemblyPaths; |
| 429 |
PreBuildEvent; |
| 430 |
ResolveReferences; |
| 431 |
CopyFilesMarkedCopyLocal; |
| 432 |
PrepareResources; |
| 433 |
Compile; |
| 434 |
PrepareForRun; |
| 435 |
DeployOutputFiles; |
| 436 |
_RecordCleanFile; |
| 437 |
PostBuildEvent |
| 438 |
</CoreBuildDependsOn> |
| 439 |
</PropertyGroup> |
| 440 |
|
| 441 |
<Target |
| 442 |
Name="CoreBuild" |
| 443 |
DependsOnTargets="$(CoreBuildDependsOn)" |
| 444 |
Outputs="$(OutDir)$(AssemblyName)$(TargetExt)"> |
| 445 |
|
| 446 |
<OnError ExecuteTargets="_TimestampAfterCompile;PostBuildEvent" |
| 447 |
Condition=" '$(RunPostBuildEvent)' == 'Always' or '$(RunPostBuildEvent)' == 'OnOutputUpdated'"/> |
| 448 |
|
| 449 |
<OnError ExecuteTargets="_RecordCleanFile" /> |
| 450 |
</Target> |
| 451 |
|
| 452 |
<PropertyGroup> |
| 453 |
<CompileDependsOn> |
| 454 |
ResolveReferences; |
| 455 |
GenerateTargetFrameworkMonikerAttribute; |
| 456 |
BeforeCompile; |
| 457 |
_TimestampBeforeCompile; |
| 458 |
CoreCompile; |
| 459 |
_TimestampAfterCompile; |
| 460 |
AfterCompile |
| 461 |
</CompileDependsOn> |
| 462 |
</PropertyGroup> |
| 463 |
|
| 464 |
<Target Name="BeforeCompile" /> |
| 465 |
<Target Name="AfterCompile" /> |
| 466 |
|
| 467 |
<Target Name="Compile" DependsOnTargets="$(CompileDependsOn)"/> |
| 468 |
|
| 469 |
<PropertyGroup> |
| 470 |
<PrepareForRunDependsOn> |
| 471 |
DeployOutputFiles |
| 472 |
</PrepareForRunDependsOn> |
| 473 |
</PropertyGroup> |
| 474 |
<Target Name="PrepareForRun" DependsOnTargets="$(PrepareForRunDependsOn)"/> |
| 475 |
|
| 476 |
<PropertyGroup> |
| 477 |
<PrepareResourcesDependsOn> |
| 478 |
AssignTargetPaths; |
| 479 |
SplitResourcesByCulture; |
| 480 |
CreateManifestResourceNames; |
| 481 |
CopyNonResxEmbeddedResources; |
| 482 |
GenerateResources; |
| 483 |
GenerateSatelliteAssemblies; |
| 484 |
CompileLicxFiles |
| 485 |
</PrepareResourcesDependsOn> |
| 486 |
</PropertyGroup> |
| 487 |
<Target Name="PrepareResources" DependsOnTargets="$(PrepareResourcesDependsOn)" /> |
| 488 |
|
| 489 |
<Target Name="SplitResourcesByCulture" DependsOnTargets="AssignTargetPaths"> |
| 490 |
<!-- Extract .licx files into @(LicxFiles) --> |
| 491 |
<CreateItem Include="@(EmbeddedResourceWithTargetPath)" Condition="'%(Extension)' == '.licx'"> |
| 492 |
<Output TaskParameter="Include" ItemName="LicxFiles"/> |
| 493 |
</CreateItem> |
| 494 |
|
| 495 |
<!-- Split *remaining* resource files into various groups.. --> |
| 496 |
<AssignCulture Files="@(EmbeddedResourceWithTargetPath)" Condition="'%(Extension)' != '.licx'"> |
| 497 |
<Output TaskParameter="AssignedFilesWithNoCulture" ItemName="ResourcesWithNoCulture"/> |
| 498 |
<Output TaskParameter="AssignedFilesWithCulture" ItemName="ResourcesWithCulture"/> |
| 499 |
</AssignCulture> |
| 500 |
|
| 501 |
<CreateItem Include="@(ResourcesWithNoCulture)" Condition="'%(Extension)' == '.resx'"> |
| 502 |
<Output TaskParameter="Include" ItemName="ResxWithNoCulture"/> |
| 503 |
</CreateItem> |
| 504 |
|
| 505 |
<CreateItem Include="@(ResourcesWithNoCulture)" Condition="'%(Extension)' != '.resx'"> |
| 506 |
<Output TaskParameter="Include" ItemName="NonResxWithNoCulture"/> |
| 507 |
</CreateItem> |
| 508 |
|
| 509 |
<CreateItem Include="@(ResourcesWithCulture)" Condition="'%(Extension)' == '.resx'"> |
| 510 |
<Output TaskParameter="Include" ItemName="ResxWithCulture"/> |
| 511 |
</CreateItem> |
| 512 |
|
| 513 |
<CreateItem Include="@(ResourcesWithCulture)" Condition="'%(Extension)' != '.resx'"> |
| 514 |
<Output TaskParameter="Include" ItemName="NonResxWithCulture"/> |
| 515 |
</CreateItem> |
| 516 |
</Target> |
| 517 |
|
| 518 |
<!-- Copy non-resx resources to their manifest resource names, this is what the compiler expects --> |
| 519 |
<Target Name = "CopyNonResxEmbeddedResources" |
| 520 |
Condition = "'@(NonResxWithCulture)' != '' or '@(NonResxWithNoCulture)' != '' or '@(ManifestNonResxWithCulture)' != '' or '@(ManifestNonResxWithNoCulture)' != ''"> |
| 521 |
|
| 522 |
<MakeDir Directories="$(IntermediateOutputPath)%(ManifestNonResxWithCulture.Culture)"/> |
| 523 |
<Copy SourceFiles = "@(NonResxWithCulture)" |
| 524 |
DestinationFiles = "@(ManifestNonResxWithCulture->'$(IntermediateOutputPath)%(Identity)')" |
| 525 |
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"> |
| 526 |
<Output TaskParameter = "DestinationFiles" ItemName = "ManifestNonResxWithCultureOnDisk"/> |
| 527 |
<Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/> |
| 528 |
</Copy> |
| 529 |
|
| 530 |
<Copy SourceFiles = "@(NonResxWithNoCulture)" |
| 531 |
DestinationFiles = "@(ManifestNonResxWithNoCulture->'$(IntermediateOutputPath)%(Identity)')" |
| 532 |
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"> |
| 533 |
<Output TaskParameter = "DestinationFiles" ItemName = "ManifestNonResxWithNoCultureOnDisk"/> |
| 534 |
<Output TaskParameter = "DestinationFiles" ItemName = "FileWrites"/> |
| 535 |
</Copy> |
| 536 |
</Target> |
| 537 |
|
| 538 |
<Target Name = "GenerateResources"> |
| 539 |
<GenerateResource |
| 540 |
Sources = "@(ResxWithNoCulture)" |
| 541 |
UseSourcePath = "true" |
| 542 |
OutputResources = "@(ManifestResourceWithNoCultureName->'$(IntermediateOutputPath)%(Identity).resources')" |
| 543 |
Condition = "'@(ResxWithNoCulture)' != '' "> |
| 544 |
|
| 545 |
<Output TaskParameter = "OutputResources" ItemName = "ManifestResourceWithNoCulture"/> |
| 546 |
<Output TaskParameter = "FilesWritten" ItemName = "FileWrites"/> |
| 547 |
</GenerateResource> |
| 548 |
|
| 549 |
<GenerateResource |
| 550 |
Sources = "@(ResxWithCulture)" |
| 551 |
UseSourcePath = "true" |
| 552 |
OutputResources = "@(ManifestResourceWithCultureName->'$(IntermediateOutputPath)%(Identity).resources')" |
| 553 |
Condition = "'@(ResxWithCulture)' != '' "> |
| 554 |
|
| 555 |
<Output TaskParameter = "OutputResources" ItemName = "ManifestResourceWithCulture"/> |
| 556 |
<Output TaskParameter = "FilesWritten" ItemName = "FileWrites"/> |
| 557 |
</GenerateResource> |
| 558 |
</Target> |
| 559 |
|
| 560 |
<Target Name="GenerateSatelliteAssemblies" |
| 561 |
Inputs="@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)" |
| 562 |
Outputs="$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll" > |
| 563 |
<!-- @(NonResxWithCulture) - rename files to ManifestNon.. and then use for AL --> |
| 564 |
<MakeDir Directories = "$(IntermediateOutputPath)%(ManifestResourceWithCulture.Culture)" Condition = "'@(ManifestResourceWithCulture)' != ''" /> |
| 565 |
<MakeDir Directories = "$(IntermediateOutputPath)%(ManifestNonResxWithCultureOnDisk.Culture)" Condition = "'@(ManifestNonResxWithCultureOnDisk)' != ''" /> |
| 566 |
|
| 567 |
<AL |
| 568 |
Culture = "%(Culture)" |
| 569 |
DelaySign="$(DelaySign)" |
| 570 |
EmbedResources = "@(ManifestResourceWithCulture);@(ManifestNonResxWithCultureOnDisk)" |
| 571 |
KeyFile="$(KeyOriginatorFile)" |
| 572 |
ToolExe="$(AlToolExe)" |
| 573 |
ToolPath="$(AlToolPath)" |
| 574 |
OutputAssembly = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll" > |
| 575 |
<Output TaskParameter="OutputAssembly" ItemName="FileWrites"/> |
| 576 |
</AL> |
| 577 |
|
| 578 |
|
| 579 |
<CreateItem |
| 580 |
Include = "$(IntermediateOutputPath)%(Culture)\$(AssemblyName).resources.dll" |
| 581 |
AdditionalMetadata = "Culture=%(Culture)" |
| 582 |
Condition = "'@(ManifestResourceWithCulture)' != '' or '@(ManifestNonResxWithCultureOnDisk)' != ''"> |
| 583 |
<Output TaskParameter = "Include" ItemName = "IntermediateSatelliteAssemblies" /> |
| 584 |
</CreateItem> |
| 585 |
</Target> |
| 586 |
|
| 587 |
<PropertyGroup> |
| 588 |
<CompileLicxFilesDependsOn></CompileLicxFilesDependsOn> |
| 589 |
</PropertyGroup> |
| 590 |
|
| 591 |
<Target Name = "CompileLicxFiles" |
| 592 |
Condition = "'@(LicxFiles)' != ''" |
| 593 |
DependsOnTargets = "$(CompileLicxFilesDependsOn)" |
| 594 |
Outputs = "$(IntermediateOutputPath)$(TargetFileName).licenses"> |
| 595 |
<LC |
| 596 |
Sources = "@(LicxFiles)" |
| 597 |
LicenseTarget = "$(TargetFileName)" |
| 598 |
OutputDirectory = "$(IntermediateOutputPath)" |
| 599 |
OutputLicense = "$(IntermediateOutputPath)$(TargetFileName).licenses" |
| 600 |
ReferencedAssemblies = "@(ReferencePath);@(ReferenceDependencyPaths)" |
| 601 |
ToolPath = "$(LCToolPath)" |
| 602 |
ToolExe = "$(LCToolExe)"> |
| 603 |
|
| 604 |
<Output TaskParameter="OutputLicense" ItemName="CompiledLicenseFile"/> |
| 605 |
<Output TaskParameter="OutputLicense" ItemName="FileWrites"/> |
| 606 |
</LC> |
| 607 |
</Target> |
| 608 |
|
| 609 |
<!-- Assign target paths to files that will need to be copied along with the project --> |
| 610 |
<Target Name = "AssignTargetPaths"> |
| 611 |
<AssignTargetPath Files="@(None)" RootFolder="$(MSBuildProjectDirectory)"> |
| 612 |
<Output TaskParameter="AssignedFiles" ItemName="NoneWithTargetPath"/> |
| 613 |
</AssignTargetPath> |
| 614 |
|
| 615 |
<AssignTargetPath Files="@(Content)" RootFolder="$(MSBuildProjectDirectory)"> |
| 616 |
<Output TaskParameter="AssignedFiles" ItemName="ContentWithTargetPath"/> |
| 617 |
</AssignTargetPath> |
| 618 |
|
| 619 |
<AssignTargetPath Files="@(EmbeddedResource)" RootFolder="$(MSBuildProjectDirectory)"> |
| 620 |
<Output TaskParameter="AssignedFiles" ItemName="EmbeddedResourceWithTargetPath"/> |
| 621 |
</AssignTargetPath> |
| 622 |
</Target> |
| 623 |
|
| 624 |
<Target Name="DeployOutputFiles" |
| 625 |
DependsOnTargets="PrepareResources;CoreCompile;_CopyDeployFilesToOutputDirectory;_CopyAppConfigFile"> |
| 626 |
|
| 627 |
<Copy |
| 628 |
SourceFiles="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb" |
| 629 |
Condition="'$(OutDir)' != '' and Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')" |
| 630 |
DestinationFolder="$(OutDir)" |
| 631 |
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" > |
| 632 |
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
| 633 |
</Copy> |
| 634 |
|
| 635 |
<Copy |
| 636 |
SourceFiles="$(IntermediateOutputPath)$(AssemblyName).pdb" |
| 637 |
Condition="'$(OutDir)' != '' and Exists('$(IntermediateOutputPath)$(AssemblyName).pdb')" |
| 638 |
DestinationFolder="$(OutDir)" |
| 639 |
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" > |
| 640 |
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
| 641 |
</Copy> |
| 642 |
|
| 643 |
<Copy SourceFiles="@(IntermediateAssembly)" Condition="'$(OutDir)' != '' and Exists ('@(IntermediateAssembly)')" DestinationFolder="$(OutDir)" SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"> |
| 644 |
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
| 645 |
</Copy> |
| 646 |
|
| 647 |
<Copy |
| 648 |
SourceFiles = "@(IntermediateSatelliteAssemblies)" |
| 649 |
DestinationFiles = "@(IntermediateSatelliteAssemblies->'$(OutDir)\%(Culture)\$(AssemblyName).resources.dll')" |
| 650 |
Condition = "'@(IntermediateSatelliteAssemblies)' != ''" |
| 651 |
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"> |
| 652 |
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
| 653 |
</Copy> |
| 654 |
</Target> |
| 655 |
|
| 656 |
<Target Name="_CopyDeployFilesToOutputDirectory" |
| 657 |
DependsOnTargets="GetCopyToOutputDirectoryItems; |
| 658 |
_CopyDeployFilesToOutputDirectoryAlways; |
| 659 |
_CopyDeployFilesToOutputDirectoryPreserveNewest"/> |
| 660 |
|
| 661 |
<Target Name="_CopyDeployFilesToOutputDirectoryPreserveNewest" |
| 662 |
Condition="'@(ItemsToCopyToOutputDirectoryPreserveNewest)' != ''" |
| 663 |
Inputs="@(ItemsToCopyToOutputDirectoryPreserveNewest)" |
| 664 |
Outputs="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutDir)%(TargetPath)')"> |
| 665 |
|
| 666 |
<Copy SourceFiles="@(ItemsToCopyToOutputDirectoryPreserveNewest)" |
| 667 |
DestinationFiles="@(ItemsToCopyToOutputDirectoryPreserveNewest->'$(OutDir)%(TargetPath)')" |
| 668 |
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)"> |
| 669 |
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
| 670 |
</Copy> |
| 671 |
</Target> |
| 672 |
|
| 673 |
<!-- Copy if newer --> |
| 674 |
<Target Name="_CopyDeployFilesToOutputDirectoryAlways" |
| 675 |
Condition="'@(ItemsToCopyToOutputDirectoryAlways)' != ''"> |
| 676 |
|
| 677 |
<Copy SourceFiles="@(ItemsToCopyToOutputDirectoryAlways)" |
| 678 |
DestinationFiles="@(ItemsToCopyToOutputDirectoryAlways->'$(OutDir)%(TargetPath)')"> |
| 679 |
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
| 680 |
</Copy> |
| 681 |
</Target> |
| 682 |
|
| 683 |
|
| 684 |
<Target Name="_CopyAppConfigFile" Condition="'@(AppConfigWithTargetPath)' != ''" |
| 685 |
Inputs="@(AppConfigWithTargetPath)" |
| 686 |
Outputs="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')"> |
| 687 |
|
| 688 |
<Copy SourceFiles="@(AppConfigWithTargetPath)" |
| 689 |
DestinationFiles="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')"> |
| 690 |
<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/> |
| 691 |
</Copy> |
| 692 |
</Target> |
| 693 |
|
| 694 |
<Target Name="GetTargetPath" Outputs="$(TargetPath)"/> |
| 695 |
|
| 696 |
<Target Name="GetCopyToOutputDirectoryItems" |
| 697 |
Outputs="@(AllItemsFullPathWithTargetPath)" |
| 698 |
DependsOnTargets="AssignTargetPaths;SplitProjectReferencesByExistent"> |
| 699 |
|
| 700 |
<!-- FIXME: handle .vcproj |
| 701 |
FIXME: Private ProjectReferences are honored only in 3.5 |
| 702 |
--> |
| 703 |
<MSBuild |
| 704 |
Projects="@(ProjectReferenceWithConfigurationExistent)" |
| 705 |
Targets="GetCopyToOutputDirectoryItems" |
| 706 |
Condition="'@(ProjectReferenceWithConfigurationExistent)' != '' and '%(ProjectReferenceWithConfigurationExistent.Private)' != 'false'"> |
| 707 |
|
| 708 |
<Output TaskParameter="TargetOutputs" ItemName="AllChildProjectItemsWithTargetPath"/> |
| 709 |
</MSBuild> |
| 710 |
|
| 711 |
<!-- Process items from child project. The outputs need to have full path |
| 712 |
as they'll be used from other projects --> |
| 713 |
|
| 714 |
<CreateItem |
| 715 |
Include="@(AllChildProjectItemsWithTargetPath->'%(FullPath)')" |
| 716 |
Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'"> |
| 717 |
|
| 718 |
<Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/> |
| 719 |
<Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways" |
| 720 |
Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='Always'"/> |
| 721 |
<Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest" |
| 722 |
Condition="'%(AllChildProjectItemsWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/> |
| 723 |
|
| 724 |
</CreateItem> |
| 725 |
|
| 726 |
<!-- Process _this_ project's items --> |
| 727 |
|
| 728 |
<CreateItem |
| 729 |
Include="@(NoneWithTargetPath->'%(FullPath)')" |
| 730 |
Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(NoneWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'"> |
| 731 |
<Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/> |
| 732 |
<Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways" |
| 733 |
Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)'=='Always'"/> |
| 734 |
<Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest" |
| 735 |
Condition="'%(NoneWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/> |
| 736 |
</CreateItem> |
| 737 |
|
| 738 |
<CreateItem |
| 739 |
Include="@(ContentWithTargetPath->'%(FullPath)')" |
| 740 |
Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(ContentWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'"> |
| 741 |
<Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/> |
| 742 |
<Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways" |
| 743 |
Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='Always'"/> |
| 744 |
<Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest" |
| 745 |
Condition="'%(ContentWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/> |
| 746 |
</CreateItem> |
| 747 |
|
| 748 |
<CreateItem |
| 749 |
Include="@(EmbeddedResourceWithTargetPath->'%(FullPath)')" |
| 750 |
Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)' == 'Always' or '%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)' == 'PreserveNewest'"> |
| 751 |
<Output TaskParameter="Include" ItemName="AllItemsFullPathWithTargetPath"/> |
| 752 |
<Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryAlways" |
| 753 |
Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)'=='Always'"/> |
| 754 |
<Output TaskParameter="Include" ItemName="ItemsToCopyToOutputDirectoryPreserveNewest" |
| 755 |
Condition="'%(EmbeddedResourceWithTargetPath.CopyToOutputDirectory)'=='PreserveNewest'"/> |
| 756 |
</CreateItem> |
| 757 |
|
| 758 |
</Target> |
| 759 |
|
| 760 |
<!-- Pre/Post BuildEvents --> |
| 761 |
<PropertyGroup> |
| 762 |
<PreBuildEventDependsOn /> |
| 763 |
</PropertyGroup> |
| 764 |
|
| 765 |
<Target Name="PreBuildEvent" |
| 766 |
Condition="'$(PreBuildEvent)' != ''" |
| 767 |
DependsOnTargets="$(PreBuildEventDependsOn)"> |
| 768 |
|
| 769 |
<Exec WorkingDirectory="$(OutDir)" Command="$(PreBuildEvent)" /> |
| 770 |
</Target> |
| 771 |
|
| 772 |
<!-- PostBuildEvent depends on $(RunPostBuildEvent) |
| 773 |
|
| 774 |
Default: OnBuildSuccess |
| 775 |
OnBuildSuccess: Run after a successful build |
| 776 |
OnOutputUpdated: Run only if the output assembly got updates |
| 777 |
Always: Run always |
| 778 |
--> |
| 779 |
<PropertyGroup> |
| 780 |
<PostBuildEventDependsOn /> |
| 781 |
</PropertyGroup> |
| 782 |
|
| 783 |
<!-- this gets invoked in two cases, from CoreBuildDependsOn, if the build completes |
| 784 |
successfully, OR from OnError in CoreBuild, if the build failed and $(RunPostBuildEvent) |
| 785 |
is 'Always' or 'OnOutputUpdated'. Invoke $(PostBuildEvent) if its either Empty (== OnBuildSuccess) |
| 786 |
or OnBuildSuccess or Always OR (OnOutputUpdated and output assembly got updated) --> |
| 787 |
<Target Name="PostBuildEvent" |
| 788 |
Condition="'$(PostBuildEvent)' != '' and |
| 789 |
('$(RunPostBuildEvent)' != 'OnOutputUpdated' or |
| 790 |
'$(_AssemblyModifiedTimeBeforeCompile)' != '$(_AssemblyModifiedTimeAfterCompile)')" |
| 791 |
DependsOnTargets="$(PostBuildEventDependsOn)"> |
| 792 |
|
| 793 |
<Exec WorkingDirectory="$(OutDir)" Command="$(PostBuildEvent)" /> |
| 794 |
</Target> |
| 795 |
|
| 796 |
<!-- Timestamp the output assemblies, required for PostBuildEvent --> |
| 797 |
<Target Name="_TimestampBeforeCompile" Condition="'$(RunPostBuildEvent)' == 'OnOutputUpdated'"> |
| 798 |
<CreateItem Include="%(IntermediateAssembly.ModifiedTime)"> |
| 799 |
<Output TaskParameter="Include" PropertyName="_AssemblyModifiedTimeBeforeCompile" /> |
| 800 |
</CreateItem> |
| 801 |
</Target> |
| 802 |
<Target Name="_TimestampAfterCompile" Condition="'$(RunPostBuildEvent)' == 'OnOutputUpdated'"> |
| 803 |
<CreateItem Include="%(IntermediateAssembly.ModifiedTime)"> |
| 804 |
<Output TaskParameter="Include" PropertyName="_AssemblyModifiedTimeAfterCompile" /> |
| 805 |
</CreateItem> |
| 806 |
</Target> |
| 807 |
|
| 808 |
<!-- Rebuild --> |
| 809 |
<PropertyGroup> |
| 810 |
<RebuildDependsOn> |
| 811 |
BeforeRebuild; |
| 812 |
Clean; |
| 813 |
$(MSBuildProjectDefaultTargets); |
| 814 |
AfterRebuild; |
| 815 |
</RebuildDependsOn> |
| 816 |
|
| 817 |
<RebuildDependsOn Condition="'$(MSBuildProjectDefaultTargets)' == 'Rebuild'"> |
| 818 |
BeforeRebuild; |
| 819 |
Clean; |
| 820 |
Build; |
| 821 |
AfterRebuild; |
| 822 |
</RebuildDependsOn> |
| 823 |
</PropertyGroup> |
| 824 |
|
| 825 |
<Target Name="BeforeRebuild" /> |
| 826 |
<Target Name="AfterRebuild" /> |
| 827 |
|
| 828 |
<Target Name="Rebuild" |
| 829 |
DependsOnTargets="$(RebuildDependsOn)" |
| 830 |
Outputs="$(TargetPath)"/> |
| 831 |
|
| 832 |
<!-- Clean --> |
| 833 |
<Target Name="_RecordCleanFile" |
| 834 |
DependsOnTargets="_GetCompileOutputsForClean"> |
| 835 |
|
| 836 |
<!-- add to list of previous writes for this platform/config --> |
| 837 |
|
| 838 |
<ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)"> |
| 839 |
<Output TaskParameter="Lines" ItemName="PreviousFileWrites"/> |
| 840 |
</ReadLinesFromFile> |
| 841 |
|
| 842 |
<!-- CopyLocal files: In case all the projects build to common output |
| 843 |
directory, then other projects might depend on some of these |
| 844 |
CopyLocal files, so delete only the ones under *this* project |
| 845 |
directory --> |
| 846 |
<FindUnderPath Path="$(MSBuildProjectDirectory)" Files="@(FileWritesShareable)"> |
| 847 |
<Output TaskParameter="InPath" ItemName="FileWrites"/> |
| 848 |
</FindUnderPath> |
| 849 |
|
| 850 |
<RemoveDuplicates Inputs="@(PreviousFileWrites);@(FileWrites->'%(FullPath)')"> |
| 851 |
<Output TaskParameter="Filtered" ItemName="CombinedFileWrites"/> |
| 852 |
</RemoveDuplicates> |
| 853 |
|
| 854 |
<WriteLinesToFile |
| 855 |
File="$(IntermediateOutputPath)$(CleanFile)" |
| 856 |
Lines="@(CombinedFileWrites)" |
| 857 |
Overwrite="true"/> |
| 858 |
</Target> |
| 859 |
|
| 860 |
<PropertyGroup> |
| 861 |
<CleanDependsOn> |
| 862 |
BeforeClean; |
| 863 |
CleanReferencedProjects; |
| 864 |
CoreClean; |
| 865 |
AfterClean |
| 866 |
</CleanDependsOn> |
| 867 |
</PropertyGroup> |
| 868 |
|
| 869 |
<Target Name="_GetCompileOutputsForClean"> |
| 870 |
<!-- assembly and debug file in the *intermediate output path* --> |
| 871 |
<CreateItem Include="@(IntermediateAssembly)" Condition="Exists('@(IntermediateAssembly)')"> |
| 872 |
<Output TaskParameter="Include" ItemName="FileWrites"/> |
| 873 |
</CreateItem> |
| 874 |
|
| 875 |
<CreateItem Include="$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb" |
| 876 |
Condition="Exists('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt).mdb')"> |
| 877 |
<Output TaskParameter="Include" ItemName="FileWrites"/> |
| 878 |
</CreateItem> |
| 879 |
|
| 880 |
<CreateItem Include="$(IntermediateOutputPath)$(AssemblyName).pdb" |
| 881 |
Condition="Exists('$(IntermediateOutputPath)$(AssemblyName).pdb')"> |
| 882 |
<Output TaskParameter="Include" ItemName="FileWrites"/> |
| 883 |
</CreateItem> |
| 884 |
</Target> |
| 885 |
|
| 886 |
<!-- Get the list of files written, for clean --> |
| 887 |
<Target Name="_GetCleanFileWrites" |
| 888 |
DependsOnTargets="_GetCompileOutputsForClean"> |
| 889 |
<ReadLinesFromFile File="$(IntermediateOutputPath)$(CleanFile)"> |
| 890 |
<Output TaskParameter="Lines" ItemName="PreviousFileWrites"/> |
| 891 |
</ReadLinesFromFile> |
| 892 |
</Target> |
| 893 |
|
| 894 |
<Target Name="CleanReferencedProjects" |
| 895 |
DependsOnTargets="AssignProjectConfiguration"> |
| 896 |
|
| 897 |
<!-- If building from .sln.proj or from IDE, clean will get handled by them, |
| 898 |
else we are building a project directly, from the command line, so |
| 899 |
clean the referenced projects --> |
| 900 |
<MSBuild Projects="@(ProjectReferenceWithConfigurationExistent)" |
| 901 |
Targets="Clean" |
| 902 |
Condition=" '$(BuildingSolutionFile)' != 'true' and '$(BuildingInsideVisualStudio)' != 'true' and '@(ProjectReferenceWithConfigurationExistent)' != ''" /> |
| 903 |
|
| 904 |
</Target> |
| 905 |
|
| 906 |
<Target Name="Clean" DependsOnTargets="$(CleanDependsOn)"/> |
| 907 |
|
| 908 |
<!-- Override in project to run before/after clean tasks --> |
| 909 |
<Target Name="BeforeClean" /> |
| 910 |
<Target Name="AfterClean" /> |
| 911 |
|
| 912 |
<Target Name="CoreClean" DependsOnTargets="_GetCleanFileWrites"> |
| 913 |
<Delete Files="@(PreviousFileWrites);@(FileWrites)" TreatErrorsAsWarnings="true"/> |
| 914 |
|
| 915 |
<!-- all previous files written for this platform/config have been deleted, |
| 916 |
we can safely remove the file list now --> |
| 917 |
<Delete Files="$(IntermediateOutputPath)$(CleanFile)" TreatErrorsAsWarnings="true" /> |
| 918 |
</Target> |
| 919 |
|
| 920 |
<PropertyGroup> |
| 921 |
<ImplicitlyExpandDesignTimeFacades>true</ImplicitlyExpandDesignTimeFacades> |
| 922 |
|
| 923 |
<ResolveReferencesDependsOn> |
| 924 |
$(ResolveReferencesDependsOn); |
| 925 |
ImplicitlyExpandDesignTimeFacades |
| 926 |
</ResolveReferencesDependsOn> |
| 927 |
|
| 928 |
<ImplicitlyExpandDesignTimeFacadesDependsOn> |
| 929 |
$(ImplicitlyExpandDesignTimeFacadesDependsOn); |
| 930 |
GetReferenceAssemblyPaths |
| 931 |
</ImplicitlyExpandDesignTimeFacadesDependsOn> |
| 932 |
</PropertyGroup> |
| 933 |
|
| 934 |
<Target Name="ImplicitlyExpandDesignTimeFacades" Condition="'$(ImplicitlyExpandDesignTimeFacades)' == 'true'" DependsOnTargets="$(ImplicitlyExpandDesignTimeFacadesDependsOn)"> |
| 935 |
|
| 936 |
<PropertyGroup> |
| 937 |
<_HasReferenceToSystemRuntime Condition="'%(_ResolvedDependencyFiles.Filename)' == 'System.Runtime'">true</_HasReferenceToSystemRuntime> |
| 938 |
</PropertyGroup> |
| 939 |
|
| 940 |
<ItemGroup Condition="'$(_HasReferenceToSystemRuntime)' == 'true'"> |
| 941 |
<!-- If the user has manually referenced these assemblies, remove them so we don't end up with duplicates --> |
| 942 |
<ReferencePath Remove="@(_DesignTimeFacadeAssemblies)"/> |
| 943 |
<ReferencePath Include="%(_DesignTimeFacadeAssemblies.Identity)"> |
| 944 |
<WinMDFile>false</WinMDFile> |
| 945 |
<CopyLocal>false</CopyLocal> |
| 946 |
<ResolvedFrom>ImplicitlyExpandDesignTimeFacades</ResolvedFrom> |
| 947 |
</ReferencePath> |
| 948 |
<_ResolveAssemblyReferenceResolvedFiles Include="@(ReferencePath)" Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandDesignTimeFacades'" /> |
| 949 |
</ItemGroup> |
| 950 |
|
| 951 |
<Message Importance="Low" Text="Including @(ReferencePath)" Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandDesignTimeFacades'" /> |
| 952 |
|
| 953 |
</Target> |
| 954 |
|
| 955 |
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter\*" |
| 956 |
Condition="'$(ImportByWildcardAfterMicrosoftCommonTargets)' == 'true' and Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\$(MSBuildThisFile)\ImportAfter')"/> |
| 957 |
</Project> |