|
10 | 10 | that is done by the file that imports us.
|
11 | 11 | -->
|
12 | 12 |
|
| 13 | + <!-- Define Environmental conditionals --> |
| 14 | + <!-- Determined by environmental settings set in build-and-test.yml--> |
| 15 | + <PropertyGroup> |
| 16 | + <IsContinuousIntegration Condition="'$(CI)' == 'true'">true</IsContinuousIntegration> |
| 17 | + <IsCodeCoverage Condition="'$(codecov)' != ''">true</IsCodeCoverage> |
| 18 | + </PropertyGroup> |
| 19 | + <Choose> |
| 20 | + <When Condition="'$(IsContinuousIntegration)'=='true'"> |
| 21 | + <PropertyGroup> |
| 22 | + <DefineConstants>$(DefineConstants);ENV_CI</DefineConstants> |
| 23 | + </PropertyGroup> |
| 24 | + </When> |
| 25 | + <When Condition="'$(IsCodeCoverage)'=='true'"> |
| 26 | + <PropertyGroup> |
| 27 | + <DefineConstants>$(DefineConstants);ENV_CODECOV</DefineConstants> |
| 28 | + </PropertyGroup> |
| 29 | + </When> |
| 30 | + </Choose> |
| 31 | + |
| 32 | + <!--Define OS platform conditions and constants. |
| 33 | + https://docs.microsoft.com/en-us/visualstudio/msbuild/property-functions?view=vs-2019#msbuild-property-functions |
| 34 | + https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.osplatform?view=net-5.0#properties |
| 35 | + --> |
| 36 | + <PropertyGroup> |
| 37 | + <IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows> |
| 38 | + <IsOSX Condition="$([MSBuild]::IsOSPlatform('OSX'))">true</IsOSX> |
| 39 | + <IsLinux Condition="$([MSBuild]::IsOSPlatform('Linux'))">true</IsLinux> |
| 40 | + <IsFreeBSD Condition="$([MSBuild]::IsOSPlatform('FreeBSD'))">true</IsFreeBSD> |
| 41 | + </PropertyGroup> |
| 42 | + <Choose> |
| 43 | + <When Condition="'$(IsWindows)'=='true'"> |
| 44 | + <PropertyGroup> |
| 45 | + <DefineConstants>$(DefineConstants);OS_WINDOWS</DefineConstants> |
| 46 | + </PropertyGroup> |
| 47 | + </When> |
| 48 | + <When Condition="'$(IsOSX)'=='true'"> |
| 49 | + <PropertyGroup> |
| 50 | + <DefineConstants>$(DefineConstants);OS_OSX</DefineConstants> |
| 51 | + </PropertyGroup> |
| 52 | + </When> |
| 53 | + <When Condition="'$(IsLinux)'=='true'"> |
| 54 | + <PropertyGroup> |
| 55 | + <DefineConstants>$(DefineConstants);OS_LINUX</DefineConstants> |
| 56 | + </PropertyGroup> |
| 57 | + </When> |
| 58 | + <When Condition="'$(IsFreeBSD)'=='true'"> |
| 59 | + <PropertyGroup> |
| 60 | + <DefineConstants>$(DefineConstants);OS_FREEBSD</DefineConstants> |
| 61 | + </PropertyGroup> |
| 62 | + </When> |
| 63 | + </Choose> |
| 64 | + |
13 | 65 | <!-- Compilation settings that explicitly differ from the Sdk.props/targets defaults -->
|
14 | 66 | <PropertyGroup>
|
15 | 67 | <LangVersion Condition="'$(LangVersion)' == ''">8.0</LangVersion>
|
|
19 | 71 | <NeutralLanguage>en</NeutralLanguage>
|
20 | 72 | <OverwriteReadOnlyFiles>true</OverwriteReadOnlyFiles>
|
21 | 73 | <DebugType>portable</DebugType>
|
22 |
| - <DebugType Condition="'$(codecov)' != ''">full</DebugType> |
| 74 | + <DebugType Condition="'$(IsCodeCoverage)'=='true'">full</DebugType> |
23 | 75 | <NullableContextOptions>disable</NullableContextOptions>
|
24 | 76 | <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
|
25 | 77 | <CheckEolTargetFramework>false</CheckEolTargetFramework>
|
|
46 | 98 |
|
47 | 99 | <!-- Ensure deterministic builds work when triggered against individual projects. -->
|
48 | 100 | <!-- https://github.com/dotnet/roslyn/issues/37379#issuecomment-513371985 -->
|
49 |
| - <ItemGroup Condition="'$(CI)' == 'true'"> |
| 101 | + <ItemGroup Condition="'$(IsContinuousIntegration)'=='true'"> |
50 | 102 | <SourceRoot Include="$(MSBuildThisFileDirectory)/"/>
|
51 | 103 | </ItemGroup>
|
52 | 104 |
|
|
69 | 121 | <AdditionalFiles Include="$(MSBuildThisFileDirectory)..\..\stylecop.json" />
|
70 | 122 | </ItemGroup>
|
71 | 123 |
|
72 |
| - <!--Define OS platform conditions and constants. |
73 |
| - https://docs.microsoft.com/en-us/visualstudio/msbuild/property-functions?view=vs-2019#msbuild-property-functions |
74 |
| - https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.osplatform?view=net-5.0#properties |
75 |
| - --> |
76 |
| - <PropertyGroup> |
77 |
| - <IsWindows Condition="$([MSBuild]::IsOSPlatform('Windows'))">true</IsWindows> |
78 |
| - <IsOSX Condition="$([MSBuild]::IsOSPlatform('OSX'))">true</IsOSX> |
79 |
| - <IsLinux Condition="$([MSBuild]::IsOSPlatform('Linux'))">true</IsLinux> |
80 |
| - <IsFreeBSD Condition="$([MSBuild]::IsOSPlatform('FreeBSD'))">true</IsFreeBSD> |
81 |
| - </PropertyGroup> |
82 |
| - <Choose> |
83 |
| - <When Condition="'$(IsWindows)'=='true'"> |
84 |
| - <PropertyGroup> |
85 |
| - <DefineConstants>$(DefineConstants);OS_WINDOWS</DefineConstants> |
86 |
| - </PropertyGroup> |
87 |
| - </When> |
88 |
| - <When Condition="'$(IsOSX)'=='true'"> |
89 |
| - <PropertyGroup> |
90 |
| - <DefineConstants>$(DefineConstants);OS_OSX</DefineConstants> |
91 |
| - </PropertyGroup> |
92 |
| - </When> |
93 |
| - <When Condition="'$(IsLinux)'=='true'"> |
94 |
| - <PropertyGroup> |
95 |
| - <DefineConstants>$(DefineConstants);OS_LINUX</DefineConstants> |
96 |
| - </PropertyGroup> |
97 |
| - </When> |
98 |
| - <When Condition="'$(IsFreeBSD)'=='true'"> |
99 |
| - <PropertyGroup> |
100 |
| - <DefineConstants>$(DefineConstants);OS_FREEBSD</DefineConstants> |
101 |
| - </PropertyGroup> |
102 |
| - </When> |
103 |
| - </Choose> |
104 |
| - |
105 | 124 | <!-- Define target framework specific constants.
|
106 | 125 | https://apisof.net/
|
107 | 126 | +===================+=======+==========+=====================+=============+=================+====================+==============+=========+============|
|
|
0 commit comments