|
1 | 1 | <Project>
|
2 |
| - |
| 2 | + |
3 | 3 | <PropertyGroup>
|
4 | 4 | <_BlazorCopyFilesToOutputDirectoryDependsOn>
|
5 | 5 | $(_BlazorCopyFilesToOutputDirectoryDependsOn);
|
6 |
| - _ComputeServiceWorkerAssetsManifestInputs; |
7 | 6 | _WriteServiceWorkerAssetsManifest;
|
| 7 | + ResolveStaticWebAssetsInputs; |
8 | 8 | </_BlazorCopyFilesToOutputDirectoryDependsOn>
|
9 | 9 | </PropertyGroup>
|
10 | 10 |
|
| 11 | + |
11 | 12 | <Target Name="_ComputeServiceWorkerAssetsManifestInputs"
|
12 | 13 | Condition="'$(ServiceWorkerAssetsManifest)' != ''"
|
13 |
| - DependsOnTargets="PrepareBlazorOutputs"> |
| 14 | + BeforeTargets="_ResolveBlazorOutputs"> |
14 | 15 |
|
15 | 16 | <PropertyGroup>
|
16 | 17 | <_ServiceWorkerAssetsManifestIntermediateOutputPath>$(BlazorIntermediateOutputPath)serviceworkerassets.js</_ServiceWorkerAssetsManifestIntermediateOutputPath>
|
17 | 18 | </PropertyGroup>
|
18 | 19 |
|
19 | 20 | <ItemGroup>
|
20 |
| - <!-- Include _framework/* content --> |
21 |
| - <ServiceWorkerAssetsManifestItem |
22 |
| - Include="@(BlazorOutputWithTargetPath)" |
23 |
| - Condition="$([System.String]::Copy('%(BlazorOutputWithTargetPath.TargetOutputPath)').Replace('\','/').StartsWith('dist/'))"> |
24 |
| - <AssetUrl>$([System.String]::Copy('%(BlazorOutputWithTargetPath.TargetOutputPath)').Replace('\','/').Substring(5))</AssetUrl> |
25 |
| - </ServiceWorkerAssetsManifestItem> |
26 |
| - |
27 |
| - <!-- Include content from wwwroot --> |
28 |
| - <ServiceWorkerAssetsManifestItem |
29 |
| - Include="@(ContentWithTargetPath)" |
30 |
| - Condition=" |
31 |
| - ('%(ContentWithTargetPath.CopyToPublishDirectory)' == 'Always' OR '%(ContentWithTargetPath.CopyToPublishDirectory)' == 'PreserveNewest') |
32 |
| - AND $([System.String]::Copy('%(ContentWithTargetPath.TargetPath)').Replace('\','/').StartsWith('wwwroot/'))"> |
33 |
| - <AssetUrl>$([System.String]::Copy('%(ContentWithTargetPath.TargetPath)').Replace('\','/').Substring(8))</AssetUrl> |
34 |
| - </ServiceWorkerAssetsManifestItem> |
35 |
| - |
36 |
| - <!-- Include SWA from references --> |
37 |
| - <ServiceWorkerAssetsManifestItem |
38 |
| - Include="@(StaticWebAsset)" |
39 |
| - Condition="'%(StaticWebAsset.SourceType)' != ''"> |
40 |
| - <AssetUrl>%(StaticWebAsset.BasePath)/%(StaticWebAsset.RelativePath)</AssetUrl> |
41 |
| - </ServiceWorkerAssetsManifestItem> |
| 21 | + <BlazorOutputWithTargetPath Condition="'$(ServiceWorkerAssetsManifest)' != ''" |
| 22 | + Include="$(_ServiceWorkerAssetsManifestIntermediateOutputPath)" |
| 23 | + TargetOutputPath="$(BaseBlazorDistPath)$(ServiceWorkerAssetsManifest)" /> |
42 | 24 | </ItemGroup>
|
43 | 25 |
|
44 | 26 | </Target>
|
|
56 | 38 | OutputPath="$(_ServiceWorkerAssetsManifestIntermediateOutputPath)" />
|
57 | 39 |
|
58 | 40 | <ItemGroup>
|
59 |
| - <BlazorOutputWithTargetPath |
60 |
| - Include="$(_ServiceWorkerAssetsManifestIntermediateOutputPath)" |
61 |
| - TargetOutputPath="$(BaseBlazorDistPath)$(ServiceWorkerAssetsManifest)" /> |
62 |
| - |
63 | 41 | <FileWrites Include="$(_ServiceWorkerAssetsManifestIntermediateOutputPath)" />
|
64 | 42 | </ItemGroup>
|
65 | 43 |
|
66 | 44 | </Target>
|
67 | 45 |
|
68 | 46 | <Target Name="_ComputeServiceWorkerAssetsManifestFileHashes">
|
| 47 | + |
| 48 | + <ItemGroup> |
| 49 | + <ServiceWorkerAssetsManifestItem Include="%(StaticWebAsset.Identity)" Condition="'%(RelativePath)' != '$(ServiceWorkerAssetsManifest)'"> |
| 50 | + <AssetUrl>$([System.String]::Copy('$([System.String]::Copy('%(StaticWebAsset.BasePath)').TrimEnd('/'))/%(StaticWebAsset.RelativePath)').Replace('\','/').TrimStart('/'))</AssetUrl> |
| 51 | + </ServiceWorkerAssetsManifestItem> |
| 52 | + </ItemGroup> |
| 53 | + |
69 | 54 | <GetFileHash Files="@(ServiceWorkerAssetsManifestItem)" Algorithm="SHA256" HashEncoding="base64">
|
70 | 55 | <Output TaskParameter="Items" ItemName="_ServiceWorkerAssetsManifestItemWithHash" />
|
71 | 56 | </GetFileHash>
|
|
94 | 79 | <ServiceWorkerAssetsManifestVersion>$([System.String]::Copy('%(_ServiceWorkerAssetsManifestCombinedHash.FileHash)').Substring(0, 8))</ServiceWorkerAssetsManifestVersion>
|
95 | 80 | </PropertyGroup>
|
96 | 81 | </Target>
|
97 |
| - |
| 82 | + |
98 | 83 | </Project>
|
0 commit comments