|
| 1 | +<Project Sdk="Microsoft.NET.Sdk.Web" DefaultTargets="Pack"> |
| 2 | + |
| 3 | + <PropertyGroup> |
| 4 | + <TargetFramework>$(DefaultNetCoreTargetFramework)</TargetFramework> |
| 5 | + <Description>ASP.NET Core static framework assets</Description> |
| 6 | + <PackageId>Microsoft.AspNetCore.Assets.Pack</PackageId> |
| 7 | + <IsPackable>true</IsPackable> |
| 8 | + <OutputType>Library</OutputType> |
| 9 | + <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory> |
| 10 | + <IncludeBuildOutput>false</IncludeBuildOutput> |
| 11 | + <IncludeSymbols>false</IncludeSymbols> |
| 12 | + |
| 13 | + <!-- The package doesn't produce any lib or ref assemblies --> |
| 14 | + <NoWarn>$(NoWarn);NU5128</NoWarn> |
| 15 | + |
| 16 | + <StaticWebAssetBasePath>_framework</StaticWebAssetBasePath> |
| 17 | + <DisableStaticWebAssetsBuildPropsFileGeneration>true</DisableStaticWebAssetsBuildPropsFileGeneration> |
| 18 | + <DisableStaticWebAssetEndpointsBuildPropsFileGeneration>true</DisableStaticWebAssetEndpointsBuildPropsFileGeneration> |
| 19 | + <StaticWebAssetsDisableProjectBuildPropsFileGeneration>true</StaticWebAssetsDisableProjectBuildPropsFileGeneration> |
| 20 | + <StaticWebAssetsDisableProjectBuildMultiTargetingPropsFileGeneration>true</StaticWebAssetsDisableProjectBuildMultiTargetingPropsFileGeneration> |
| 21 | + <StaticWebAssetsDisableProjectBuildTransitivePropsFileGeneration>true</StaticWebAssetsDisableProjectBuildTransitivePropsFileGeneration> |
| 22 | + </PropertyGroup> |
| 23 | + |
| 24 | + <ItemGroup> |
| 25 | + <None Include="build\*" Pack="true" PackagePath="%(Identity)" /> |
| 26 | + </ItemGroup> |
| 27 | + |
| 28 | + <PropertyGroup> |
| 29 | + <_BlazorJSContentRoot Condition="'$(Configuration)' == 'Debug'">..\..\Components\Web.JS\dist\Debug</_BlazorJSContentRoot> |
| 30 | + <_BlazorJSContentRoot Condition="'$(Configuration)' == 'Release'">..\..\Components\Web.JS\dist\Release</_BlazorJSContentRoot> |
| 31 | + </PropertyGroup> |
| 32 | + |
| 33 | + <ItemGroup> |
| 34 | + <_BlazorJSFilename Include="blazor.web.js" /> |
| 35 | + <_BlazorJSFilename Include="blazor.server.js" /> |
| 36 | + <_BlazorJSFilename Include="blazor.webassembly.js" /> |
| 37 | + |
| 38 | + <_BlazorJSFile Include="@(_BlazorJSFilename->'$(_BlazorJSContentRoot)\%(Identity)')" /> |
| 39 | + </ItemGroup> |
| 40 | + |
| 41 | + <Target Name="_CheckBlazorJSPath" AfterTargets="ResolveProjectReferences"> |
| 42 | + |
| 43 | + <ItemGroup> |
| 44 | + <_MissingBlazorJSFile Include="@(_BlazorJSFile)" Condition="!EXISTS('%(_BlazorJSFile.FullPath)')" /> |
| 45 | + </ItemGroup> |
| 46 | + |
| 47 | + <Warning |
| 48 | + Condition="'@(_MissingBlazorJSFile)' != ''" |
| 49 | + Text="'%(_MissingBlazorJSFile.Identity)' does not exist. Falling back to checked-in copy." /> |
| 50 | + |
| 51 | + <ItemGroup> |
| 52 | + <_BlazorJSFile Remove="@(_MissingBlazorJSFile)" /> |
| 53 | + <_BlazorJSFile Include="@(_MissingBlazorJSFile->'..\..\Components\Web.JS\dist\Release\%(Filename)%(Extension)')" /> |
| 54 | + </ItemGroup> |
| 55 | + |
| 56 | + </Target> |
| 57 | + |
| 58 | + <Target Name="_GenerateFrameworkPackItems" BeforeTargets="GenerateStaticWebAssetsPackFiles"> |
| 59 | + <ItemGroup> |
| 60 | + <_AssetCandidates Include="@(_BlazorJSFile)" /> |
| 61 | + <_AssetCandidates> |
| 62 | + <RelativePath>%(RecursiveDir)%(FileName)%(Extension)</RelativePath> |
| 63 | + </_AssetCandidates> |
| 64 | + </ItemGroup> |
| 65 | + |
| 66 | + <DefineStaticWebAssets |
| 67 | + Condition="'@(_AssetCandidates->Count())' != '0'" |
| 68 | + CandidateAssets="@(_AssetCandidates)" |
| 69 | + ContentRoot="_framework" |
| 70 | + SourceId="$(PackageId)" |
| 71 | + SourceType="Discovered" |
| 72 | + FingerprintCandidates="true" |
| 73 | + BasePath="$(StaticWebAssetBasePath)" |
| 74 | + > |
| 75 | + <Output TaskParameter="Assets" ItemName="_FrameworkAssets" /> |
| 76 | + </DefineStaticWebAssets> |
| 77 | + |
| 78 | + <DefineStaticWebAssetEndpoints |
| 79 | + Condition="'@(_FrameworkAssets)' != ''" |
| 80 | + CandidateAssets="@(_FrameworkAssets)" |
| 81 | + ExistingEndpoints="@()" |
| 82 | + ContentTypeMappings="@(StaticWebAssetContentTypeMapping)"> |
| 83 | + <Output TaskParameter="Endpoints" ItemName="_FrameworkAssetEndpoints" /> |
| 84 | + </DefineStaticWebAssetEndpoints> |
| 85 | + |
| 86 | + <ComputeEndpointsForReferenceStaticWebAssets |
| 87 | + Assets="@(_FrameworkAssets)" |
| 88 | + CandidateEndpoints="@(_FrameworkAssetEndpoints)"> |
| 89 | + <Output TaskParameter="Endpoints" ItemName="_PackFrameworkAssetEndpoints" /> |
| 90 | + </ComputeEndpointsForReferenceStaticWebAssets> |
| 91 | + |
| 92 | + <GenerateStaticWebAssetsPropsFile |
| 93 | + StaticWebAssets="@(_FrameworkAssets)" |
| 94 | + PackagePathPrefix="staticwebassets" |
| 95 | + TargetPropsFilePath="$(IntermediateOutputPath)StaticWebAssets.targets" /> |
| 96 | + |
| 97 | + <GenerateStaticWebAssetEndpointsPropsFile |
| 98 | + StaticWebAssets="@(_FrameworkAssets)" |
| 99 | + StaticWebAssetEndpoints="@(_PackFrameworkAssetEndpoints)" |
| 100 | + TargetPropsFilePath="$(IntermediateOutputPath)StaticWebAssets.endpoints.targets" /> |
| 101 | + |
| 102 | + <ItemGroup> |
| 103 | + <StaticWebAssetPackageFile Include="$(IntermediateOutputPath)StaticWebAssets.targets"> |
| 104 | + <PackagePath>build\Microsoft.AspNetCore.StaticWebAssets.targets</PackagePath> |
| 105 | + </StaticWebAssetPackageFile> |
| 106 | + <StaticWebAssetPackageFile Include="$(IntermediateOutputPath)StaticWebAssets.endpoints.targets"> |
| 107 | + <PackagePath>build\Microsoft.AspNetCore.StaticWebAssets.endpoints.targets</PackagePath> |
| 108 | + </StaticWebAssetPackageFile> |
| 109 | + </ItemGroup> |
| 110 | + |
| 111 | + </Target> |
| 112 | + |
| 113 | + <Target Name="CreateManifestResourceNames" /> |
| 114 | + <Target Name="CoreCompile" /> |
| 115 | + |
| 116 | +</Project> |
0 commit comments