-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
notSupported.SourceBuild.targets
25 lines (20 loc) · 1.44 KB
/
notSupported.SourceBuild.targets
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
<Project>
<Target Name="_RedefineNotSupportedSourceFile"
BeforeTargets="BeforeCompile"
Condition="'$(DotNetBuildFromSource)' == 'true' and
('$(GeneratePlatformNotSupportedAssembly)' == 'true' or '$(GeneratePlatformNotSupportedAssemblyMessage)' != '')">
<Error Condition="'$(DotNetSourceBuildIntermediatePath)' == ''"
Text="'DotNetSourceBuildIntermediatePath' must be specified when 'DotNetBuildFromSource' is true" />
<PropertyGroup>
<_notSupportedSourceDirectory>$([MSBuild]::NormalizeDirectory('$(DotNetSourceBuildIntermediatePath)', '$(MSBuildProjectName)', '$(TargetFramework)-$(TargetOS)'))</_notSupportedSourceDirectory>
<NotSupportedSourceFile>$(_notSupportedSourceDirectory)$(TargetName).notsupported.cs</NotSupportedSourceFile>
</PropertyGroup>
<MakeDir Condition="'$(DotNetBuildOffline)' != 'true'" Directories="$(_notSupportedSourceDirectory)" />
<Error Condition="'$(DotNetBuildOffline)' == 'true' and !Exists('$(NotSupportedSourceFile)')"
Text="Error NotSupportedSourceFile '$(NotSupportedSourceFile)' did not exist under DotNetSourceBuildIntermediatePath." />
<!-- DotNetBuildOffline == true, don't use GenAPI and include source from DotNetSourceBuildIntermediatePath -->
<ItemGroup Condition="'$(DotNetBuildOffline)' == 'true'">
<Compile Include="$(NotSupportedSourceFile)" />
</ItemGroup>
</Target>
</Project>