forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it so GenAPI is only used during online source build (dotnet/cor…
…efx#38433) Commit migrated from dotnet/corefx@548e58e
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<Project InitialTargets="_RedefineNotSupportedSourceFile"> | ||
|
||
<Target Name="_RedefineNotSupportedSourceFile" | ||
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)', '$(TargetGroup)-$(OSGroup)'))</_notSupportedSourceDirectory> | ||
<NotSupportedSourceFile>$(_notSupportedSourceDirectory)$(TargetName).notsupported.cs</NotSupportedSourceFile> | ||
</PropertyGroup> | ||
|
||
<MakeDir Condition="'$(OfflineBuild)' != 'true'" Directories="$(_notSupportedSourceDirectory)" /> | ||
|
||
<Error Condition="'$(OfflineBuild)' == 'true' AND !Exists('$(NotSupportedSourceFile)')" | ||
Text="Error NotSupportedSourceFile '$(NotSupportedSourceFile)' did not exist under DotNetSourceBuildIntermediatePath." /> | ||
|
||
<!-- OfflineBuild == true, don't use GenAPI and include source from DotNetSourceBuildIntermediatePath --> | ||
<ItemGroup Condition="'$(OfflineBuild)' == 'true'"> | ||
<Compile Include="$(NotSupportedSourceFile)" /> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |