forked from microsoft/WindowsAppSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.props
80 lines (69 loc) · 5.02 KB
/
Directory.Build.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information. -->
<!-- This is a special MSBuild file that is parsed before everything else when MSBuild detects it in our directory structure.
Adding Sdk="Microsoft.NET.Sdk" to a project causes NuGet files to be generated very early on, so we need these defines to be here
to ensure that all of our build output files end up in the same location. -->
<Project InitialTargets="DirectoryBuildPropsInfo" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="eng\Version.Dependencies.props" />
<!-- Due to import ordering inconsistencies between different project types, we import this file from multiple places. -->
<Import Project="$(MSBuildThisFileDirectory)build\EnsureOutputLayout.props" Condition="$(EnsureOutputLayoutPropsIncluded) == ''" />
<PropertyGroup>
<IsTDPConfiguration>false</IsTDPConfiguration>
<GeneratedFilesDir>$(BaseIntermediateOutputPath)Generated Files\</GeneratedFilesDir>
<GenerateProjectSpecificOutputFolder>True</GenerateProjectSpecificOutputFolder>
<ForceImportAfterCppTargets>$(BuildRoot)AfterCpp.targets</ForceImportAfterCppTargets>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<NugetPackageDirectory>$(RepoRoot)\packages</NugetPackageDirectory>
</PropertyGroup>
<!-- Compilation differs for the build pipeline vs local development -->
<PropertyGroup Condition="$(WindowsAppSDKBuildPipeline) != '1'">
<!-- If not set, default it to no . -->
<WindowsAppSDKBuildPipeline>0</WindowsAppSDKBuildPipeline>
</PropertyGroup>
<Target Name="DirectoryBuildPropsInfo">
<Message Condition="'$(WindowsAppSDKBuildPipeline)' == '1'" Importance="High" Text="Directory.Build.props detects WindowsAppSDKBuildPipeline=$(WindowsAppSDKBuildPipeline)"/>
<Error Condition="!Exists('$(RepoTestCertificatePFX)')" Text="$(RepoTestCertificatePFX) not found. Run '$(RepoRoot)\DevCheck.cmd' to generate the test certificate." />
<Error Condition="!Exists('$(RepoTestCertificatePWD)')" Text="$(RepoTestCertificatePWD) not found. Run '$(RepoRoot)\DevCheck.cmd' to generate the test certificate." />
</Target>
<!-- Conditional behavior for build pipeline vs local development -->
<ItemDefinitionGroup Condition="$(WindowsAppSDKBuildPipeline) == '1'">
<ClCompile>
<PreprocessorDefinitions>WINDOWSAPPSDK_BUILD_PIPELINE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\build\override;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>WINDOWSAPPSDK_BUILD_PIPELINE=1;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\build\override;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
<Midl>
<PreprocessorDefinitions>WINDOWSAPPSDK_BUILD_PIPELINE=1;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\build\override;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</Midl>
</ItemDefinitionGroup>
<!-- The standard props files do not set _DEBUG for the resource compiler, but we need that to build the correct file
flags in the version info resource -->
<ItemDefinitionGroup Condition="$(Configuration) == 'Debug'">
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions);</PreprocessorDefinitions>
</ResourceCompile>
</ItemDefinitionGroup>
<!-- Define our standardardized options for C/C++ builds -->
<Import Project="$(MSBuildThisFileDirectory)WindowsAppSDK.Build.Cpp.props" />
<!-- Load the test certificate's password (so we do it once for reuse across projects) -->
<PropertyGroup Condition="'$(RepoTestCertificatePFX)' == ''">
<RepoTestCertificatePFX>$(RepoRoot)\.user\winappsdk.certificate.test.pfx</RepoTestCertificatePFX>
</PropertyGroup>
<PropertyGroup Condition="'$(RepoTestCertificatePWD)' == ''">
<RepoTestCertificatePWD>$(RepoRoot)\.user\winappsdk.certificate.test.pwd</RepoTestCertificatePWD>
</PropertyGroup>
<PropertyGroup Condition="('$(RepoTestCertificatePWD)' != '') and Exists('$(RepoTestCertificatePWD)')">
<RepoTestCertificatePassword>$([System.IO.File]::ReadAllText('$(RepoTestCertificatePWD)').TrimEnd())</RepoTestCertificatePassword>
<RepoTestCertificatePasswordRedacted>...redacted...</RepoTestCertificatePasswordRedacted>
</PropertyGroup>
<!-- 'Clean As We Go' if necessary (specified). Prevents build agents from running out of disk space -->
<Target Name="CleanIntermediateFiles" AfterTargets="Build" Condition="'$(WindowsAppSDKCleanIntermediateFiles)' == 'true'">
<RemoveDir Directories="$(IntermediateOutputPath)" />
</Target>
</Project>