Enable custom restore of NPM dependencies for csproj files

Enables custom restore of NPM dependencies for csproj files that require it.
This commit is contained in:
Javier Calvarro Nelson 2019-04-14 15:02:37 +02:00 committed by GitHub
parent 7bd1e5ea20
commit 5889aea06c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 30 additions and 26 deletions

View File

@ -18,12 +18,7 @@
<Target Name="Restore">
<Message Importance="High" Text="Running yarn install on $(MSBuildProjectFullPath)" />
<Yarn Command="install $(InstallArgs)" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="_YarnExitCode"/>
</Yarn>
<Yarn Command="install $(InstallArgs)" Condition="'$(_YarnExitCode)' != '0'">
<Output TaskParameter="ExitCode" PropertyName="_YarnExitCode"/>
</Yarn>
<Yarn Command="install $(InstallArgs)" />
</Target>
<Target Name="PrepareForBuild">

View File

@ -1,2 +1,2 @@
version:3.0.0-build-20190408.1
commithash:8b533cbfa5357e5785f4c4231231c1234cfc2c5f
version:3.0.0-build-20190412.2
commithash:0e543fb8761394491250585d3811bdbb62e350e8

View File

@ -21,12 +21,15 @@
<Target Name="YarnInstall">
<Message Text="Running yarn install on $(MSBuildProjectFile)" Importance="High" />
<Yarn Command="install" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="_YarnExitCode"/>
</Yarn>
<Yarn Command="install" Condition="'$(_YarnExitCode)' != '0'">
<Output TaskParameter="ExitCode" PropertyName="_YarnExitCode"/>
</Yarn>
<Yarn Command="install" />
</Target>
<Target Name="_IsCustomRestoreTargetSupported" Returns="@(CustomRestoreTargets)" Condition="'$(BuildNodeJs)' == 'true'">
<ItemGroup>
<CustomRestoreTargets Include="$(MSBuildProjectFullPath)">
<Targets>YarnInstall</Targets>
</CustomRestoreTargets>
</ItemGroup>
</Target>
<Target Name="PrepublishScript" DependsOnTargets="YarnInstall" BeforeTargets="PrepareForPublish" Condition=" '$(IsCrossTargetingBuild)' != 'true' ">

View File

@ -25,12 +25,15 @@
<Target Name="YarnInstall">
<Message Text="Running yarn install on $(MSBuildProjectFile)" Importance="High" />
<Yarn Command="install" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="_YarnExitCode"/>
</Yarn>
<Yarn Command="install" Condition="'$(_YarnExitCode)' != '0'">
<Output TaskParameter="ExitCode" PropertyName="_YarnExitCode"/>
</Yarn>
<Yarn Command="install" />
</Target>
<Target Name="_IsCustomRestoreTargetSupported" Returns="@(CustomRestoreTargets)" Condition="'$(BuildNodeJs)' == 'true'">
<ItemGroup>
<CustomRestoreTargets Include="$(MSBuildProjectFullPath)">
<Targets>YarnInstall</Targets>
</CustomRestoreTargets>
</ItemGroup>
</Target>
<Target Name="PrepublishScript" DependsOnTargets="YarnInstall" BeforeTargets="PrepareForPublish" Condition=" '$(IsCrossTargetingBuild)' != 'true' ">

View File

@ -11,12 +11,15 @@
Importance="High"
Text="Prerequisites were not enforced at build time. Running Yarn or the E2E tests might fail as a result. Check /src/Shared/E2ETesting/Readme.md for instructions." />
<Yarn Command="install" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="_YarnExitCode"/>
</Yarn>
<Yarn Command="install" Condition="'$(_YarnExitCode)' != '0'">
<Output TaskParameter="ExitCode" PropertyName="_YarnExitCode"/>
</Yarn>
<Yarn Command="install" />
</Target>
<Target Name="_IsCustomRestoreTargetSupported" Returns="@(CustomRestoreTargets)" Condition="'$(BuildNodeJs)' == 'true'">
<ItemGroup>
<CustomRestoreTargets Include="$(MSBuildProjectFullPath)">
<Targets>EnsureNodeJSRestored</Targets>
</CustomRestoreTargets>
</ItemGroup>
</Target>
<Target