|
| 1 | +<Project> |
| 2 | + <PropertyGroup> |
| 3 | + <ResolveStaticWebAssetsInputsDependsOn> |
| 4 | + $(ResolveStaticWebAssetsInputsDependsOn); |
| 5 | + _AddBlazorFrameworkStaticWebAssets; |
| 6 | + </ResolveStaticWebAssetsInputsDependsOn> |
| 7 | + </PropertyGroup> |
| 8 | + |
| 9 | + <PropertyGroup> |
| 10 | + <BlazorFrameworkStaticWebAssetRoot Condition="'$(BlazorFrameworkStaticWebAssetRoot)' == ''">$(MSBuildThisFileDirectory)..\_framework</BlazorFrameworkStaticWebAssetRoot> |
| 11 | + </PropertyGroup> |
| 12 | + |
| 13 | + <Target Name="_AddBlazorFrameworkStaticWebAssets" Condition="'$(OutputType)' == 'Exe'"> |
| 14 | + <ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true'"> |
| 15 | + <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.web.js" /> |
| 16 | + <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.server.js" /> |
| 17 | + </ItemGroup> |
| 18 | + |
| 19 | + <ItemGroup Condition="'$(UsingMicrosoftNETSdkWeb)' == 'true' AND '$(UseBlazorFrameworkDebugAssets)' == 'true'"> |
| 20 | + <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.web.js.map" /> |
| 21 | + <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.server.js.map" /> |
| 22 | + </ItemGroup> |
| 23 | + |
| 24 | + <PropertyGroup> |
| 25 | + <_IncludeAssetsInBlazorWebAssemblyProject Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' AND '$(StaticWebAssetProjectMode)' != 'Default'">true</_IncludeAssetsInBlazorWebAssemblyProject> |
| 26 | + </PropertyGroup> |
| 27 | + |
| 28 | + <ItemGroup Condition="'$(_IncludeAssetsInBlazorWebAssemblyProject)' == 'true'"> |
| 29 | + <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.webassembly.js" /> |
| 30 | + </ItemGroup> |
| 31 | + |
| 32 | + <ItemGroup Condition="'$(_IncludeAssetsInBlazorWebAssemblyProject)' == 'true' AND '$(UseBlazorFrameworkDebugAssets)' == 'true'"> |
| 33 | + <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.webassembly.js.map" /> |
| 34 | + </ItemGroup> |
| 35 | + |
| 36 | + <PropertyGroup> |
| 37 | + <_FrameworkAssetsPath>$(IntermediateOutputPath)frameworkassets</_FrameworkAssetsPath> |
| 38 | + </PropertyGroup> |
| 39 | + |
| 40 | + <MakeDir |
| 41 | + Directories="$(_FrameworkAssetsPath)" |
| 42 | + Condition="!Exists('$(_FrameworkAssetsPath)')" /> |
| 43 | + |
| 44 | + <Copy |
| 45 | + SourceFiles="@(_FrameworkStaticWebAssetCandidate)" |
| 46 | + DestinationFolder="$(_FrameworkAssetsPath)" |
| 47 | + SkipUnchangedFiles="true"> |
| 48 | + <Output TaskParameter="CopiedFiles" ItemName="_CopiedFrameworkStaticWebAssetCandidate" /> |
| 49 | + </Copy> |
| 50 | + |
| 51 | + <ItemGroup> |
| 52 | + <_CopiedFrameworkStaticWebAssetCandidate> |
| 53 | + <RelativePath>_framework\%(FileName)%(Extension)</RelativePath> |
| 54 | + <ContentRoot>$(_FrameworkAssetsPath)</ContentRoot> |
| 55 | + </_CopiedFrameworkStaticWebAssetCandidate> |
| 56 | + </ItemGroup> |
| 57 | + |
| 58 | + <DefineStaticWebAssets |
| 59 | + Condition="'@(_CopiedFrameworkStaticWebAssetCandidate->Count())' != '0'" |
| 60 | + CandidateAssets="@(_CopiedFrameworkStaticWebAssetCandidate)" |
| 61 | + SourceId="$(PackageId)" |
| 62 | + SourceType="Discovered" |
| 63 | + AssetKind="All" |
| 64 | + AssetMode="All" |
| 65 | + AssetRole="Primary" |
| 66 | + FingerprintCandidates="true" |
| 67 | + BasePath="$(StaticWebAssetBasePath)"> |
| 68 | + <Output TaskParameter="Assets" ItemName="_FrameworkStaticWebAsset" /> |
| 69 | + </DefineStaticWebAssets> |
| 70 | + |
| 71 | + <DefineStaticWebAssetEndpoints |
| 72 | + Condition="'@(_FrameworkStaticWebAsset)' != ''" |
| 73 | + CandidateAssets="@(_FrameworkStaticWebAsset)" |
| 74 | + ExistingEndpoints="" |
| 75 | + ContentTypeMappings="@(StaticWebAssetContentTypeMapping)"> |
| 76 | + <Output TaskParameter="Endpoints" ItemName="_FrameworkStaticAssetEndpoint" /> |
| 77 | + </DefineStaticWebAssetEndpoints> |
| 78 | + |
| 79 | + <ItemGroup> |
| 80 | + <StaticWebAsset Include="@(_FrameworkStaticWebAsset)" /> |
| 81 | + <StaticWebAssetEndpoint Include="@(_FrameworkStaticAssetEndpoint)" /> |
| 82 | + </ItemGroup> |
| 83 | + </Target> |
| 84 | + |
| 85 | +</Project> |
0 commit comments