Make native builds work when launching the IIS repo from VS and speed up local builds (#11805)

This commit is contained in:
Justin Kotalik 2019-07-09 08:21:10 -07:00 committed by GitHub
parent 401a90633b
commit 3fd32ac7e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -151,7 +151,7 @@
<!-- Projects which reference Microsoft.AspNetCore.Mvc.Testing should import this targets file to ensure dependency .deps.json files are copied into test output. -->
<MvcTestingTargets>$(MSBuildThisFileDirectory)src\Mvc\Mvc.Testing\src\Microsoft.AspNetCore.Mvc.Testing.targets</MvcTestingTargets>
<!-- IIS native projects can only be built on Windows for x86 and x64. -->
<BuildIisNativeProjects Condition="'$(BuildNative)' == 'true' AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64')">true</BuildIisNativeProjects>
<BuildIisNativeProjects Condition="('$(BuildNative)' == 'true' OR '$(BuildingInsideVisualStudio)' == 'true') AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64')">true</BuildIisNativeProjects>
<!-- This property is shared by several projects to layout the AspNetCore.App targeting pack for installers -->
<TargetingPackLayoutRoot>$(ArtifactsObjDir)TargetingPack.Layout\$(Configuration)\</TargetingPackLayoutRoot>
<!-- This property is shared by several projects to layout the AspNetCore.App shared framework for installers -->

View File

@ -1,3 +1,3 @@
@ECHO OFF
SET RepoRoot=%~dp0..\..\..
%RepoRoot%\build.cmd -projects %~dp0**\*.csproj %*
%RepoRoot%\build.cmd -BuildNative -projects %~dp0**\*.csproj %*

View File

@ -5,11 +5,15 @@
</PropertyGroup>
<ItemGroup Condition="@(MessageFile->Count()) != 0">
<CustomBuild Include="@(MessageFile)">
<!-- Checking if the IntDir exists is a local development optimization. Normally, each time the build runs,
the aspnetcore_msg.h file is auto generated. The compiler notices that the file has been updated, and recompiles c++ files.
These files never update (they define message types, which aren't changed). Therefore, if the IntDir exists, don't recreate
the header file. -->
<CustomBuild Include="@(MessageFile)" Condition="!Exists('$(IntDir)MSG00001.bin')">
<FileType>Document</FileType>
<Command>mc "%(FullPath)" -h $(IntDir) -r $(IntDir)</Command>
<Message>Compiling Event Messages ...</Message>
<Outputs>$(IntDir)\%(Filename).rc;$(IntDir)\%(Filename).h;$(IntDir)\MSG0409.bin</Outputs>
<Outputs>$(IntDir)\%(Filename).rc;$(IntDir)\%(Filename).h;$(IntDir)\MSG00001.bin</Outputs>
</CustomBuild>
<MessageFile Remove="@(MessageFile)" />