|
8 | 8 | <IsShippingPackage>true</IsShippingPackage>
|
9 | 9 | <HasReferenceAssembly>false</HasReferenceAssembly>
|
10 | 10 | <RazorLangVersion>3.0</RazorLangVersion>
|
11 |
| - <YarnWorkingDir>$(MSBuildThisFileDirectory)Interop\</YarnWorkingDir> |
12 |
| - <ResolveCurrentProjectStaticWebAssetsInputsDependsOn> |
13 |
| - CompileInterop; |
14 |
| - $(ResolveCurrentProjectStaticWebAssetsInputsDependsOn) |
15 |
| - </ResolveCurrentProjectStaticWebAssetsInputsDependsOn> |
16 | 11 | </PropertyGroup>
|
17 | 12 |
|
18 |
| - <ItemGroup> |
19 |
| - <Content Remove="$(YarnWorkingDir)*" /> |
20 |
| - <Content Remove="wwwroot\.gitignore" /> |
21 |
| - <YarnInputs Include="$(YarnWorkingDir)**" Exclude="$(YarnWorkingDir)node_modules\**;$(YarnWorkingDir)*.d.ts" /> |
22 |
| - <YarnOutputs Include="wwwroot\AuthenticationService.js" /> |
23 |
| - <YarnOutputs Include="wwwroot\AuthenticationService.js.map" /> |
24 |
| - <Content Include="@(YarnOutputs)" /> |
25 |
| - <None Include="Interop\AuthenticationService.ts" /> |
26 |
| - <None Include="Interop\package.json" /> |
27 |
| - <None Include="Interop\tsconfig.json" /> |
28 |
| - <None Include="Interop\webpack.config.js" /> |
29 |
| - <None Include="Interop\yarn.lock" /> |
30 |
| - <None Include="wwwroot\.gitignore" /> |
31 |
| - </ItemGroup> |
32 |
| - |
33 | 13 | <ItemGroup>
|
34 | 14 | <Reference Include="Mono.WebAssembly.Interop" />
|
35 | 15 | <Reference Include="Microsoft.AspNetCore.Blazor" />
|
|
42 | 22 | <InternalsVisibleTo Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication.Tests" />
|
43 | 23 | </ItemGroup>
|
44 | 24 |
|
45 |
| - <Target Name="CompileInterop" Condition="'$(DesignTimeBuild)' != 'true'" Inputs="@(YarnInputs)" Outputs="@(YarnOutputs)"> |
| 25 | + <PropertyGroup> |
| 26 | + <YarnWorkingDir>$(MSBuildThisFileDirectory)Interop\</YarnWorkingDir> |
| 27 | + <ResolveCurrentProjectStaticWebAssetsInputsDependsOn> |
| 28 | + CompileInterop; |
| 29 | + $(ResolveCurrentProjectStaticWebAssetsInputsDependsOn) |
| 30 | + </ResolveCurrentProjectStaticWebAssetsInputsDependsOn> |
| 31 | + </PropertyGroup> |
| 32 | + |
| 33 | + <ItemGroup> |
| 34 | + <YarnInputs Include="$(YarnWorkingDir)**" Exclude="$(YarnWorkingDir)node_modules\**;$(YarnWorkingDir)*.d.ts;$(YarnWorkingDir)dist\**" /> |
| 35 | + <YarnOutputs Include="$(YarnWorkingDir)dist\$(Configuration)\AuthenticationService.js" /> |
| 36 | + <YarnOutputs Include="$(YarnWorkingDir)dist\$(Configuration)\AuthenticationService.js.map" Condition="'$(Configuration)' == 'Debug'" /> |
| 37 | + |
| 38 | + <Content Remove="$(YarnWorkingDir)**" /> |
| 39 | + <None Include="$(YarnWorkingDir)*" Exclude="$(YarnWorkingDir)node_modules\**" /> |
| 40 | + </ItemGroup> |
| 41 | + |
| 42 | + <Target Name="_CreateInteropHash" BeforeTargets="CompileInterop" Condition="'$(DesignTimeBuild)' != 'true'"> |
| 43 | + |
| 44 | + <PropertyGroup> |
| 45 | + <InteropCompilationCacheFile>$(IntermediateOutputPath)interop.cache</InteropCompilationCacheFile> |
| 46 | + </PropertyGroup> |
| 47 | + |
| 48 | + <Hash ItemsToHash="@(YarnInputs)"> |
| 49 | + <Output TaskParameter="HashResult" PropertyName="_YarnInputsHash" /> |
| 50 | + </Hash> |
| 51 | + |
| 52 | + <WriteLinesToFile |
| 53 | + Lines="$(_YarnInputsHash)" |
| 54 | + File="$(InteropCompilationCacheFile)" |
| 55 | + Overwrite="True" |
| 56 | + WriteOnlyWhenDifferent="True" /> |
| 57 | + |
| 58 | + <ItemGroup> |
| 59 | + <FileWrites Include="$(InteropCompilationCacheFile)" /> |
| 60 | + </ItemGroup> |
| 61 | + |
| 62 | + </Target> |
| 63 | + |
| 64 | + <Target Name="CompileInterop" Condition="'$(DesignTimeBuild)' != 'true'" Inputs="$(InteropCompilationCacheFile)" Outputs="@(YarnOutputs)"> |
46 | 65 | <Yarn Command="install --mutex network" WorkingDirectory="$(YarnWorkingDir)" />
|
47 | 66 | <Yarn Command="run build:release" WorkingDirectory="$(YarnWorkingDir)" Condition="'$(Configuration)' == 'Release'" />
|
48 | 67 | <Yarn Command="run build:debug" WorkingDirectory="$(YarnWorkingDir)" Condition="'$(Configuration)' == 'Debug'" />
|
| 68 | + |
49 | 69 | <ItemGroup>
|
50 |
| - <Content Include="$(YarnOutputPattern)" /> |
| 70 | + <_InteropBuildOutput Include="$(YarnWorkingDir)dist\$(Configuration)\**" Exclude="$(YarnWorkingDir)dist\.gitignore" /> |
| 71 | + |
| 72 | + <StaticWebAsset Include="@(_InteropBuildOutput->'%(FullPath)')"> |
| 73 | + <SourceType></SourceType> |
| 74 | + <SourceId>$(PackageId)</SourceId> |
| 75 | + <ContentRoot>$([MSBuild]::NormalizeDirectory('$(YarnWorkingDir)\dist\$(Configuration)'))</ContentRoot> |
| 76 | + <BasePath>_content/$(PackageId)</BasePath> |
| 77 | + <RelativePath>$([System.String]::Copy('%(RecursiveDir)%(FileName)%(Extension)').Replace('\','/'))</RelativePath> |
| 78 | + </StaticWebAsset> |
| 79 | + |
| 80 | + <FileWrites Include="$(_InteropBuildOutput)" /> |
51 | 81 | </ItemGroup>
|
| 82 | + |
| 83 | + <Message Importance="high" Text="@(_InteropBuildOutput->'Emitted %(FullPath)')" /> |
| 84 | + |
52 | 85 | </Target>
|
53 | 86 |
|
54 | 87 | </Project>
|
0 commit comments