File: Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.csproj
Web Access
Project: ..\..\..\src\BlazorWasmSdk\Tasks\Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.csproj (Microsoft.NET.Sdk.BlazorWebAssembly.Tasks)
<Project>
 
  <PropertyGroup>
    <BlazorWasmSdkRoot>$(RepoRoot)\src\BlazorWasmSdk\</BlazorWasmSdkRoot>
    <PackageId>Microsoft.NET.Sdk.BlazorWebAssembly</PackageId>
    <OutDirName>$(Configuration)\Sdks\$(PackageId)\tools</OutDirName>
    <DefineConstants>$(DefineConstants);WASM_TASKS</DefineConstants>
  </PropertyGroup>
 
  <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
 
  <PropertyGroup>
    <OutputType>Library</OutputType>
 
    <EnableDefaultItems>false</EnableDefaultItems>
    <GenerateDependencyFile>false</GenerateDependencyFile>
    <IncludeBuildOutput>false</IncludeBuildOutput>
 
    <NoPackageAnalysis>true</NoPackageAnalysis>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
 
    <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
    <!-- MSBuild Task DLLs need to be versioned with every build -->
    <AutoGenerateAssemblyVersion>true</AutoGenerateAssemblyVersion>
 
    <OutputPath>$(BaseOutputPath)</OutputPath>
    <IsPackable>true</IsPackable>
    <PackageLayoutOutputPath>$(ArtifactsBinDir)$(Configuration)\Sdks\$(PackageId)\</PackageLayoutOutputPath>
    <NoDefaultExcludes>true</NoDefaultExcludes>
 
    <!-- Avoid https://github.com/dotnet/arcade/issues/9305 -->
    <AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
  </PropertyGroup>
 
  <PropertyGroup>
    <Description>SDK for building and publishing Blazor WebAssembly applications.</Description>
    <OutputType>Library</OutputType>
    <RootNamespace>Microsoft.NET.Sdk.BlazorWebAssembly</RootNamespace>
  </PropertyGroup>
 
  <PropertyGroup>
    <TargetFrameworks>$(SdkTargetFramework);net472</TargetFrameworks>
  </PropertyGroup>
 
  <ItemGroup>
    <AdditionalContent Include="$(BlazorWasmSdkRoot)Targets\**\*.*">
      <Pack>true</Pack>
      <PackagePath>targets</PackagePath>
    </AdditionalContent>
    <AdditionalContent Include="$(BlazorWasmSdkRoot)Sdk\**\*.*">
      <Pack>true</Pack>
      <PackagePath>Sdk</PackagePath>
    </AdditionalContent>
  </ItemGroup>
 
  <ItemDefinitionGroup>
    <PackageReference>
      <PrivateAssets>All</PrivateAssets>
      <Publish>true</Publish>
    </PackageReference>
  </ItemDefinitionGroup>
 
  <ItemGroup>
    <PackageReference Include="Microsoft.Build.Framework" ExcludeAssets="Runtime" />
    <PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="Runtime" />
    <PackageReference Include="System.IO.Hashing" />
  </ItemGroup>
 
  <ItemGroup>
    <Compile Include="**\*.cs" />
    <Compile LinkBase="StaticWebAssets" Include="..\..\StaticWebAssetsSdk\Tasks\Data\**\StaticwebAsset.cs" />
    <Compile LinkBase="StaticWebAssets" Include="..\..\StaticWebAssetsSdk\Tasks\Data\**\StaticwebAssetPathPattern.cs" />
    <Compile LinkBase="StaticWebAssets" Include="..\..\StaticWebAssetsSdk\Tasks\Data\**\StaticwebAssetPathSegment.cs" />
    <Compile LinkBase="StaticWebAssets" Include="..\..\StaticWebAssetsSdk\Tasks\Data\**\StaticwebAssetSegmentPart.cs" />
    <Compile LinkBase="StaticWebAssets" Include="..\..\StaticWebAssetsSdk\Tasks\Data\**\StaticwebAssetTokenResolver.cs" />
    <Compile LinkBase="StaticWebAssets" Include="..\..\StaticWebAssetsSdk\Tasks\Utils\FileHasher.cs" />
  </ItemGroup>
 
  <Target Name="PrepareAdditionalFilesToLayout" BeforeTargets="AssignTargetPaths">
    <ItemGroup>
      <LayoutFile Include="@(AdditionalContent)" Condition="'%(AdditionalContent.PackagePath)' != '' and '%(AdditionalContent.PackagePath)' != 'Icon.png'">
        <TargetPath>%(AdditionalContent.PackagePath)\%(AdditionalContent.RecursiveDir)%(AdditionalContent.Filename)%(AdditionalContent.Extension)</TargetPath>
      </LayoutFile>
    </ItemGroup>
  </Target>
 
  <Target Name="CopyAdditionalFilesToLayout"
          Condition="'$(TargetFramework)' == ''"
          DependsOnTargets="PrepareAdditionalFilesToLayout"
          AfterTargets="Build" Inputs="@(LayoutFile)"
          Outputs="@(LayoutFile-&gt;'$(PackageLayoutOutputPath)%(TargetPath)')">
    <Copy SourceFiles="@(LayoutFile)" DestinationFiles="@(LayoutFile-&gt;'$(PackageLayoutOutputPath)%(TargetPath)')">
      <Output TaskParameter="DestinationFiles" ItemName="FileWrites" />
    </Copy>
  </Target>
 
  <Target Name="PackLayout" DependsOnTargets="CopyAdditionalFilesToLayout" BeforeTargets="$(GenerateNuspecDependsOn)">
    <ItemGroup>
      <Content Include="$(PackageLayoutOutputPath)**\*" PackagePath="\" />
    </ItemGroup>
  </Target>
 
  <!-- Global usings -->
  <!-- See: https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#using -->
  <ItemGroup>
    <!-- This causes conflicts with System.Threading.Tasks.Task. Giving it an alias to avoid the conflict. -->
    <Using Include="Microsoft.Build.Utilities.Task" Alias="Task" />
  </ItemGroup>
 
  <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>