|
| 1 | +<Project InitialTargets="VerifyBuildProps"> |
| 2 | + <!-- See: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019#directorybuildprops-and-directorybuildtargets --> |
| 3 | + <PropertyGroup> |
| 4 | + <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> |
| 5 | + <IsOfficialBuild Condition="'$(IsOfficialBuild)' == ''">false</IsOfficialBuild> |
| 6 | + |
| 7 | + <!-- Because the default value in MSBuild doesn't get set until after Directory.Build.props, and we need it, we set the default here. --> |
| 8 | + <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration> |
| 9 | + </PropertyGroup> |
| 10 | + |
| 11 | + <PropertyGroup Label="Build layout"> |
| 12 | + <RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot> |
| 13 | + <SrcRoot>$(RepoRoot)src\</SrcRoot> |
| 14 | + </PropertyGroup> |
| 15 | + |
| 16 | + <PropertyGroup Label="Official build defaults" Condition="'$(IsOfficialBuild)' == 'true'"> |
| 17 | + <Enable_Telemetry>true</Enable_Telemetry> |
| 18 | + </PropertyGroup> |
| 19 | + |
| 20 | + <!-- Use our dev nuget config when requested. --> |
| 21 | + <PropertyGroup Label="Dev Nuget config" Condition="'$(UseNugetDevConfig)' == 'true' and '$(IsOfficialBuild)' != 'true'"> |
| 22 | + <RestoreConfigFile Condition="'$(RestoreConfigFile)' == ''">$(RepoRoot)nuget.dev.config</RestoreConfigFile> |
| 23 | + |
| 24 | + <!-- since we're using dev nuget packages, lets prevent dirtying up the local nuget cache folder --> |
| 25 | + <RestorePackagesPath>$(RepoRoot)obj\.nuget-cache</RestorePackagesPath> |
| 26 | + </PropertyGroup> |
| 27 | + |
| 28 | + <Target Name="VerifyBuildProps"> |
| 29 | + <Error Condition="'$(isOfficialBuild)' == 'true' and '$(UseNugetDevConfig)' == 'true'" |
| 30 | + Text="UseNugetDevConfig cannot be set for official builds." /> |
| 31 | + <Error Condition="'$(isOfficialBuild)' == 'true' and '$(PublishToDevNugetFeed)' == 'true'" |
| 32 | + Text="PublishToDevNugetFeed cannot be set for official builds." /> |
| 33 | + |
| 34 | + <Error Condition="('$(UseNugetDevConfig)' == 'true' or '$(PublishToDevNugetFeed)' == 'true') and '$(NUGET_LOCAL_DEV_PACKAGES)' == ''" |
| 35 | + Text="The environment variable 'NUGET_LOCAL_DEV_PACKAGES' is not set. This is required to use any of the arguments: UseNugetDevConfig, PublishToDevNugetFeed" /> |
| 36 | + <Error Condition="'$(NUGET_LOCAL_DEV_PACKAGES)' != '' and !Exists('$(NUGET_LOCAL_DEV_PACKAGES)')" |
| 37 | + Text="The environment variable 'NUGET_LOCAL_DEV_PACKAGES' is set, but does not exist. Ensure it exists if specified." /> |
| 38 | + </Target> |
| 39 | +</Project> |
0 commit comments