Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,42 @@

<PropertyGroup>
<TargetFramework>$(AspNetTestTfm)</TargetFramework>
<RestoreAdditionalProjectSources>$(RestoreAdditionalProjectSources);./TestPackages</RestoreAdditionalProjectSources>
</PropertyGroup>

<PropertyGroup>
<!-- We don't want to run build server when not running as tests. -->
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>

<Target Name="BuildLocalNuget" BeforeTargets="Restore">
<MSBuild
Projects="..\PackageLibraryDirectDependency\PackageLibraryDirectDependency.csproj"
Targets="Restore;Pack"
/>
<MSBuild
Projects="..\PackageLibraryTransitiveDependency\PackageLibraryTransitiveDependency.csproj"
Targets="Restore;Pack"
/>
<Target Name="EnsurePackagesExist" BeforeTargets="Restore">
<ItemGroup>
<LocalPackages Include="$(AspNetTestPackageSource)\RazorPackageLibraryDirectDependency.1.0.2.nupkg" />
<LocalPackages Include="$(AspNetTestPackageSource)\RazorPackageLibraryTransitiveDependency.1.0.2.nupkg" />
</ItemGroup>

<Error Condition="!Exists('%(LocalPackages.Identity)')"
Text="Package %(LocalPackages.Identity) does not exist. Ensure the test calls CreatePackCommand(ProjectDirectory, &quot;PackageLibraryDirectDependency&quot;)" />

<Error Condition="'$(RestorePackagesPath)' != '$(AspNetNugetIsolationPath)'"
Text="Packages are not being restored into the expected directory. Ensure that NUGET_PACKAGES and AspNetNugetIsolationPath are set as environment variables. The test should extend IsolatedNuGetPackageFolderAspNetSdkBaselineTest. RestorePackagesPath = '$(RestorePackagesPath)', AspNetNugetIsolationPath = '$(AspNetNugetIsolationPath)'" />
</Target>

<Target Name="EnsureLocalPackageStaticWebAssets" BeforeTargets="UpdateExistingPackageStaticWebAssets">
<PropertyGroup>
<_LocalStaticAssetPath>$(AspNetNugetIsolationPath)\razorpackagelibrarydirectdependency\1.0.2\build\..\staticwebassets\</_LocalStaticAssetPath>
</PropertyGroup>

<ItemGroup>
<_RazorPackageLibraryDirectDependencyAssets Include="@(StaticWebAsset)" Condition="'%(SourceId)' == 'RazorPackageLibraryDirectDependency'" />
<_LocalStaticWebAsset Include="@(_RazorPackageLibraryDirectDependencyAssets)" Condition="'%(ContentRoot)' == '$(_LocalStaticAssetPath)'" />
</ItemGroup>

<Error Condition="'@(_LocalStaticWebAsset)' == ''" Text="Static web assets for RazorPackageLibraryDirectDependency not found in '$(_LocalStaticAssetPath)'. Assets: '@(_RazorPackageLibraryDirectDependencyAssets->'%(Identity) %(ContentRoot)', ' ')'" />

</Target>

<ItemGroup>
<PackageReference Include="PackageLibraryDirectDependency" Version="1.0.0" />
<PackageReference Include="RazorPackageLibraryDirectDependency" Version="1.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
<Company>Microsoft</Company>
<Description>PackageLibraryDirectDependency Description</Description>
<DeterministicSourcePaths>false</DeterministicSourcePaths>
<PackageOutputPath>$(MSBuildThisFileDirectory)..\AppWithPackageAndP2PReference\TestPackages</PackageOutputPath>
<!-- See Directory.Packages.props for details on $(AspNetTestPackageSource).
It essentially creates an additional feed for the tests packages at the root
of the test project
-->
<PackageOutputPath>$(AspNetTestPackageSource)</PackageOutputPath>
<PackageVersion>1.0.2</PackageVersion>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -27,8 +32,12 @@
<!-- <Content Include="build\**" Pack="true" PackagePath="build" /> -->
<!-- We will remove the line below when we do the item to support packing -->
<!-- <Content Update="wwwroot\**" Pack="true" PackagePath="razorContent" /> -->
<ProjectReference Include="..\PackageLibraryTransitiveDependency\PackageLibraryTransitiveDependency.csproj" />
<ProjectReference Include="..\RazorPackageLibraryTransitiveDependency\RazorPackageLibraryTransitiveDependency.csproj" />
</ItemGroup>

<Target Name="EnsureFingerprinting" BeforeTargets="Pack" DependsOnTargets="ResolveStaticWebAssetsConfiguration" >
<!-- Error if StaticWebAssetFingerprintingEnabled is not true -->
<Error Condition="'$(StaticWebAssetFingerprintingEnabled)' != 'true'" Text="$(StaticWebAssetFingerprintingEnabled) must be true for the test to pass." />
</Target>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
</PropertyGroup>

<PropertyGroup>
<TargetFramework>$(AspNetTestTfm)</TargetFramework>
<Copyright>© Microsoft</Copyright>
<Product>Razor Test</Product>
<Company>Microsoft</Company>
<Description>RazorPackageLibraryTransitiveDependency Description</Description>
<DeterministicSourcePaths>false</DeterministicSourcePaths>
<!-- See Directory.Packages.props for details on $(AspNetTestPackageSource).
It essentially creates an additional feed for the tests packages at the root
of the test project
-->
<PackageOutputPath>$(AspNetTestPackageSource)</PackageOutputPath>
<PackageVersion>1.0.2</PackageVersion>
</PropertyGroup>

<PropertyGroup>
<!-- We don't want to run build server when not running as tests. -->
<UseRazorBuildServer>false</UseRazorBuildServer>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<Target Name="EnsureFingerprinting" BeforeTargets="Pack" DependsOnTargets="ResolveStaticWebAssetsConfiguration" >
<!-- Error if StaticWebAssetFingerprintingEnabled is not true -->
<Error Condition="'$(StaticWebAssetFingerprintingEnabled)' != 'true'" Text="$(StaticWebAssetFingerprintingEnabled) must be true for the test to pass." />
</Target>

</Project>
5 changes: 5 additions & 0 deletions src/Assets/WasmOverride/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<Project>
<!-- Overriding only when workload is installed, and targeting net8.0 -->
<Import Project="WasmOverridePacks.targets" Condition="'$(WasmNativeWorkload)' == 'true' and '$(RuntimeIdentifier)' == 'browser-wasm' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionEquals('$(TargetFrameworkVersion)', '8.0'))" />
<Target Name="EnsureAdditionalFolder" BeforeTargets="Restore">
<MakeDir Directories="$(MSBuildThisFileDirectory)TestPackages\" />
</Target>

</Project>

3 changes: 2 additions & 1 deletion src/Assets/WasmOverride/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
<RestoreAdditionalProjectSources Condition="Exists('$(MSBuildProjectDirectory)/TestPackages/')">$(RestoreAdditionalProjectSources);$(MSBuildProjectDirectory)/TestPackages/</RestoreAdditionalProjectSources>
<AspNetTestPackageSource>$(MSBuildThisFileDirectory)TestPackages\</AspNetTestPackageSource>
<RestoreAdditionalProjectSources Condition="Exists('$(AspNetTestPackageSource)')">$(RestoreAdditionalProjectSources);$(AspNetTestPackageSource)</RestoreAdditionalProjectSources>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
<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>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Copyright (c) .NET Foundation. All rights reserved.
Condition="'$(StaticWebAssetsSdkBuildTasksAssembly)' != ''" />

<UsingTask
TaskName="Microsoft.AspNetCore.StaticWebAssets.Tasks.GenerateStaticWebAssetsPropsFile"
TaskName="Microsoft.AspNetCore.StaticWebAssets.Tasks.GenerateStaticWebAssetsPropsFile50"
AssemblyFile="$(StaticWebAssetsSdkBuildTasksAssembly)"
Condition="'$(StaticWebAssetsSdkBuildTasksAssembly)' != ''" />

Expand Down Expand Up @@ -513,7 +513,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<!-- Generates a props file that goes in build\Microsoft.AspNetCore.StaticWebAssets.props
and that describes the static web assets for the package.
-->
<GenerateStaticWebAssetsPropsFile
<GenerateStaticWebAssetsPropsFile50
Condition="'$(_CurrentProjectHasStaticWebAssets)' == 'true'"
StaticWebAssets="@(_CurrentProjectStaticWebAsset)"
AllowEmptySourceType="true"
Expand Down
Loading