Skip to content

Commit d55847e

Browse files
committed
Only build the target platform in native projs for the VMR
1 parent f470910 commit d55847e

File tree

6 files changed

+33
-24
lines changed

6 files changed

+33
-24
lines changed

eng/Common.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('OSX'))">osx</TargetOsName>
55
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('Linux'))">linux</TargetOsName>
66
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('FreeBSD'))">freebsd</TargetOsName>
7+
78
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
9+
<NativePlatform>$(TargetArchitecture)</NativePlatform>
10+
<NativePlatform Condition=" '$(NativePlatform)' == 'x86' ">Win32</NativePlatform>
11+
812
<TargetRuntimeIdentifier Condition="'$(TargetRuntimeIdentifier)' == ''">$(TargetOsName)-$(TargetArchitecture)</TargetRuntimeIdentifier>
913
<PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
1014
<DefaultAppHostRuntimeIdentifier Condition=" '$(DotNetBuild)' == 'true' ">$(TargetRuntimeIdentifier)</DefaultAppHostRuntimeIdentifier>

src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@
7070
</Target>
7171

7272
<!-- Add native dependencies to the package when required. -->
73-
<PropertyGroup>
74-
<NativePlatform>$(TargetArchitecture)</NativePlatform>
75-
<NativePlatform Condition=" '$(NativePlatform)' == 'x86' ">Win32</NativePlatform>
76-
</PropertyGroup>
7773
<ItemGroup>
7874
<ProjectReference Condition=" '$(UseIisNativeAssets)' == 'true' AND $(BuildNative) AND '$(MSBuildRestoreSessionId)' == ''"
7975
Include="$(RepoRoot)src\Servers\IIS\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj">

src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@
6868
</ItemGroup>
6969

7070
<!-- Add native dependencies to the package when required. -->
71-
<PropertyGroup>
72-
<NativePlatform>$(TargetArchitecture)</NativePlatform>
73-
<NativePlatform Condition=" '$(NativePlatform)' == 'x86' ">Win32</NativePlatform>
74-
</PropertyGroup>
7571
<ItemGroup>
7672
<ProjectReference Condition=" '$(UseIisNativeAssets)' == 'true' AND $(BuildNative) AND '$(MSBuildRestoreSessionId)' == ''"
7773
Include="$(RepoRoot)src\Servers\IIS\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj">

src/Installers/Windows/AspNetCoreModule-Setup/Directory.Build.props

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,45 +40,52 @@
4040
</DefineConstants>
4141
</PropertyGroup>
4242

43+
<!-- Only build the target platform for product build (DotNetBuild=true). -->
4344
<ItemGroup Condition="'$(BuildNative)' == 'true'">
4445
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj">
4546
<Name>AspNetCoreV2</Name>
4647
<Private>True</Private>
4748
<DoNotHarvest>True</DoNotHarvest>
4849
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
49-
<SetPlatform>Platform=x64</SetPlatform>
50+
<SetPlatform Condition="'$(DotNetBuild)' != 'true'">Platform=x64</SetPlatform>
51+
<SetPlatform Condition="'$(DotNetBuild)' == 'true'">Platform=$(NativePlatform)</SetPlatform>
5052
</ProjectReference>
5153
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj">
5254
<Name>AspNetCoreV2Handler</Name>
5355
<Private>True</Private>
5456
<DoNotHarvest>True</DoNotHarvest>
5557
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
56-
<SetPlatform>Platform=x64</SetPlatform>
58+
<SetPlatform Condition="'$(DotNetBuild)' != 'true'">Platform=x64</SetPlatform>
59+
<SetPlatform Condition="'$(DotNetBuild)' == 'true'">Platform=$(NativePlatform)</SetPlatform>
5760
</ProjectReference>
5861

59-
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj">
62+
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj"
63+
Condition="'$(DotNetBuild)' != 'true'">
6064
<Name>AspNetCoreV2WoW64</Name>
6165
<Private>True</Private>
6266
<DoNotHarvest>True</DoNotHarvest>
6367
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
6468
<SetPlatform>Platform=Win32</SetPlatform>
6569
</ProjectReference>
66-
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj">
70+
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj"
71+
Condition="'$(DotNetBuild)' != 'true'">
6772
<Name>AspNetCoreV2HandlerWoW64</Name>
6873
<Private>True</Private>
6974
<DoNotHarvest>True</DoNotHarvest>
7075
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
7176
<SetPlatform>Platform=Win32</SetPlatform>
7277
</ProjectReference>
73-
74-
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj">
78+
79+
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj"
80+
Condition="'$(DotNetBuild)' != 'true'">
7581
<Name>AspNetCoreV2ARM64</Name>
7682
<Private>True</Private>
7783
<DoNotHarvest>True</DoNotHarvest>
7884
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
7985
<SetPlatform>Platform=ARM64</SetPlatform>
8086
</ProjectReference>
81-
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj">
87+
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj"
88+
Condition="'$(DotNetBuild)' != 'true'">
8289
<Name>AspNetCoreV2HandlerARM64</Name>
8390
<Private>True</Private>
8491
<DoNotHarvest>True</DoNotHarvest>

src/Servers/IIS/IIS/src/Microsoft.AspNetCore.Server.IIS.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@
4545
</Target>
4646

4747
<ItemGroup Condition=" '$(UseIisNativeAssets)' == 'true' ">
48-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="x64" />
49-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="Win32" />
50-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="ARM64" />
48+
<!-- Only build the target platform for product build (DotNetBuild=true). -->
49+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="x64" Condition="'$(DotNetBuild)' != 'true'" />
50+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="Win32" Condition="'$(DotNetBuild)' != 'true'" />
51+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="ARM64" Condition="'$(DotNetBuild)' != 'true'" />
52+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="$(NativePlatform)" Condition="'$(DotNetBuild)' == 'true'" />
5153

5254
<UpToDateCheckInput Include="$(AspNetCoreModuleV2InProcessHandlerDll)" />
5355
</ItemGroup>

src/Servers/IIS/IntegrationTesting.IIS/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,19 @@
3535
Condition="!Exists('$(AspNetCoreModuleV2ShimDll)') OR !Exists('$(AspNetCoreModuleV2OutOfProcessHandlerDll)')" />
3636
</Target>
3737

38+
<!-- Only build the target platform for product build (DotNetBuild=true). -->
3839
<ItemGroup Condition="'$(UseIisNativeAssets)' == 'true' AND '$(TestGroupName)' != 'IISNewHandler.FunctionalTests'">
39-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="x64"/>
40-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="x64" />
40+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="x64" Condition="'$(DotNetBuild)' != 'true'" />
41+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="x64" Condition="'$(DotNetBuild)' != 'true'" />
4142

42-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="Win32" />
43-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="Win32" />
43+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="Win32" Condition="'$(DotNetBuild)' != 'true'" />
44+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="Win32" Condition="'$(DotNetBuild)' != 'true'" />
4445

45-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="ARM64" />
46-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="ARM64" />
46+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="ARM64" Condition="'$(DotNetBuild)' != 'true'" />
47+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="ARM64" Condition="'$(DotNetBuild)' != 'true'" />
48+
49+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="$(NativePlatform)" Condition="'$(DotNetBuild)' == 'true'" />
50+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="$(NativePlatform)" Condition="'$(DotNetBuild)' == 'true'" />
4751

4852
<UpToDateCheckInput Include="$(AspNetCoreModuleV2ShimDll)" />
4953
<UpToDateCheckInput Include="$(AspNetCoreModuleV2OutOfProcessHandlerDll)" />

0 commit comments

Comments
 (0)