Rename OfflineBuild property to DotNetBuildOffline (dotnet/corefx#39926)
authorEric StJohn <ericstj@microsoft.com>
Fri, 2 Aug 2019 15:27:28 +0000 (08:27 -0700)
committerGitHub <noreply@github.com>
Fri, 2 Aug 2019 15:27:28 +0000 (08:27 -0700)
* Rename OfflineBuild property to DotNetBuildOffline

* Change sequencing of _RedefineNotSupportedSourceFile

When running as an initial target _RedefineNotSupportedSourceFile would
run too many times, as currently the config system will evaluate projects
under the parent project's Configuration.

Commit migrated from https://github.com/dotnet/corefx/commit/1ea5d5816f31b237252b6b369560d103683329b1

eng/notSupported.SourceBuild.targets

index a6a0f11..373fc1d 100644 (file)
@@ -1,24 +1,24 @@
-<Project InitialTargets="_RedefineNotSupportedSourceFile">
-
+<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)', '$(TargetGroup)-$(OSGroup)'))</_notSupportedSourceDirectory>
       <NotSupportedSourceFile>$(_notSupportedSourceDirectory)$(TargetName).notsupported.cs</NotSupportedSourceFile>
     </PropertyGroup>
+
+    <MakeDir Condition="'$(DotNetBuildOffline)' != 'true'" Directories="$(_notSupportedSourceDirectory)" />
     
-    <MakeDir Condition="'$(OfflineBuild)' != 'true'" Directories="$(_notSupportedSourceDirectory)" />
-    
-    <Error Condition="'$(OfflineBuild)' == 'true' AND !Exists('$(NotSupportedSourceFile)')"
+    <Error Condition="'$(DotNetBuildOffline)' == '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'">
+
+    <!-- DotNetBuildOffline == true, don't use GenAPI and include source from DotNetSourceBuildIntermediatePath -->  
+    <ItemGroup Condition="'$(DotNetBuildOffline)' == 'true'">
       <Compile Include="$(NotSupportedSourceFile)" />
     </ItemGroup>
   </Target>