Fixing the allconfig build. (#40812)
authorAnirudh Agnihotry <anirudhagnihotry098@gmail.com>
Sat, 15 Aug 2020 01:28:46 +0000 (18:28 -0700)
committerGitHub <noreply@github.com>
Sat, 15 Aug 2020 01:28:46 +0000 (18:28 -0700)
* fixing all config build

* address feedback

Build.proj
src/libraries/Directory.Build.props
src/libraries/Native/build-native.proj

index 2041d3d..2d96f02 100644 (file)
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.Build.Traversal">
 
   <PropertyGroup>
-    <TraversalGlobalProperties>BuildTargetFramework=$([MSBuild]::ValueOrDefault('$(BuildTargetFramework)', '$(NetCoreAppCurrent)'))</TraversalGlobalProperties>
+    <TraversalGlobalProperties Condition="'$(BuildAllConfigurations)' != 'true'">BuildTargetFramework=$([MSBuild]::ValueOrDefault('$(BuildTargetFramework)', '$(NetCoreAppCurrent)'))</TraversalGlobalProperties>
   </PropertyGroup>
 
   <!--
index 98097c8..023ee93 100644 (file)
@@ -45,6 +45,7 @@
     <AdditionalBuildTargetFrameworks Condition="'$(BuildTargetFramework)' == 'net48'">net45;net451;net452;net46;net461;net462;net47;net471;net472</AdditionalBuildTargetFrameworks>
     <AdditionalBuildTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true' and '$(BuildAllProjects)' == 'true'">$(AdditionalBuildTargetFrameworks);netstandard2.0</AdditionalBuildTargetFrameworks>
     <BuildSettings>$(BuildTargetFramework)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)</BuildSettings>
+    <BuildSettings Condition="'$(BuildTargetFramework)' == ''">$(NetCoreAppCurrent)-$(TargetOS)-$(Configuration)-$(TargetArchitecture)</BuildSettings>
   </PropertyGroup>
 
   <!-- Define test projects and companions -->
index 28dc818..beaf309 100644 (file)
@@ -3,7 +3,9 @@
     <!-- Hardcode version paths in a global location. -->
     <NativeVersionFile Condition="'$(TargetOS)' == 'Windows_NT'">$(ArtifactsObjDir)_version.h</NativeVersionFile>
     <NativeVersionFile Condition="'$(TargetOS)' != 'Windows_NT'">$(ArtifactsObjDir)_version.c</NativeVersionFile>
-    <_BuildNativeArgs>$(TargetArchitecture) $(Configuration) outconfig $(BuildTargetFramework)-$(TargetOS)-$(Configuration)-$(TargetArchitecture) -os $(TargetOS)</_BuildNativeArgs>
+    <TargetFramework>$(BuildTargetFramework)</TargetFramework>
+    <TargetFramework Condition="'$(TargetFramework)' == ''">$(NetCoreAppCurrent)</TargetFramework>
+    <_BuildNativeArgs>$(TargetArchitecture) $(Configuration) outconfig $(TargetFramework)-$(TargetOS)-$(Configuration)-$(TargetArchitecture) -os $(TargetOS)</_BuildNativeArgs>
   </PropertyGroup>
 
   <ItemGroup>
@@ -39,7 +41,7 @@
   <Target Name="BuildNativeWindows"
           BeforeTargets="Build"
           Condition="'$(TargetOS)' == 'Windows_NT' and
-                     '$(BuildTargetFramework)' == '$(NetCoreAppCurrent)'">
+                     '$(TargetFramework)' == '$(NetCoreAppCurrent)'">
     <!-- Run script that invokes Cmake to create VS files, and then calls msbuild to compile them -->
     <Message Text="&quot;$(MSBuildThisFileDirectory)build-native.cmd&quot; $(_BuildNativeArgs)" Importance="High"/>
     <Exec Command="&quot;$(MSBuildThisFileDirectory)build-native.cmd&quot; $(_BuildNativeArgs)" />