Skip to content

Commit

Permalink
Fix some dependencies, make Brotli conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
MackinnonBuck committed Apr 25, 2023
1 parent b82ba20 commit d1883b0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 9 deletions.
18 changes: 16 additions & 2 deletions src/RazorSdk/Targets/Sdk.Razor.CurrentVersion.targets
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ Copyright (c) .NET Foundation. All rights reserved.
ResolveRazorComponentInputs;
AssignRazorComponentTargetPaths
</_RazorGenerateComponentDesignTimeDependsOn>

<AssignRazorComponentTargetPathsDependsOn Condition="'$(ScopedCssEnabled)' == 'true'">
$(AssignRazorComponentTargetPathsDependsOn);
ResolveCssScopes;
</AssignRazorComponentTargetPathsDependsOn>

<AssignRazorGenerateTargetPathsDependsOn Condition="'$(ScopedCssEnabled)' == 'true'">
$(AssignRazorGenerateTargetPathsDependsOn);
ResolveCssScopes;
</AssignRazorGenerateTargetPathsDependsOn>
</PropertyGroup>

<!--
Expand Down Expand Up @@ -554,7 +564,9 @@ Copyright (c) .NET Foundation. All rights reserved.
</Content>
</ItemGroup>

<Target Name="AssignRazorComponentTargetPaths" Condition="'@(RazorComponent)' != ''">
<Target Name="AssignRazorComponentTargetPaths"
Condition="'@(RazorComponent)' != ''"
DependsOnTargets="$(AssignRazorComponentTargetPathsDependsOn)">
<AssignTargetPath Files="@(RazorComponent)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="RazorComponentWithTargetPath" />
</AssignTargetPath>
Expand All @@ -574,7 +586,9 @@ Copyright (c) .NET Foundation. All rights reserved.
</ItemGroup>
</Target>

<Target Name="AssignRazorGenerateTargetPaths" Condition="'@(RazorGenerate)' != ''">
<Target Name="AssignRazorGenerateTargetPaths"
Condition="'@(RazorGenerate)' != ''"
DependsOnTargets="$(AssignRazorGenerateTargetPathsDependsOn)">
<AssignTargetPath Files="@(RazorGenerate)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="RazorGenerateWithTargetPath" />
</AssignTargetPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<GZipCompress Condition="'@(_GZipCompressedStaticWebAssets)' != ''"
FilesToCompress="@(_GZipCompressedStaticWebAssets)" />

<BrotliCompress
<BrotliCompress Condition="'@(_BrotliCompressedStaticWebAssets)' != ''"
FilesToCompress="@(_BrotliCompressedStaticWebAssets)"
CompressionLevel="$(_BlazorBrotliCompressionLevel)"
ToolAssembly="$(_StaticWebAssetsSdkToolAssembly)"
Expand All @@ -155,7 +155,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<GZipCompress Condition="'@(_GZipCompressedStaticWebAssetsForPublish)' != ''"
FilesToCompress="@(_GZipCompressedStaticWebAssetsForPublish)" />

<BrotliCompress
<BrotliCompress Condition="'@(_BrotliCompressedStaticWebAssetsForPublish)' != ''"
FilesToCompress="@(_BrotliCompressedStaticWebAssetsForPublish)"
CompressionLevel="$(_BlazorBrotliCompressionLevel)"
ToolAssembly="$(_StaticWebAssetsSdkToolAssembly)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Copyright (c) .NET Foundation. All rights reserved.

</PropertyGroup>

<Target Name="_ResolveJsModuleInputs" BeforeTargets="AssignRazorComponentTargetPaths;AssignRazorGenerateTargetPaths" DependsOnTargets="ResolveProjectStaticWebAssets">
<Target Name="_ResolveJsModuleInputs" DependsOnTargets="ResolveProjectStaticWebAssets">

<ItemGroup>
<_JSModuleCandidates Include="@(StaticWebAsset)" Condition="'%(SourceType)' == 'Discovered'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Integration with static web assets:
<!-- This target validates that there is at most one scoped css file per component, that there are no scoped css files without a
matching component, and then adds the associated scope to the razor components that have a matching scoped css file.
-->
<Target Name="_ResolveCssScopes" BeforeTargets="AssignRazorComponentTargetPaths;AssignRazorGenerateTargetPaths" DependsOnTargets="_ComputeCssScope;ResolveRazorComponentInputs;ResolveRazorGenerateInputs">
<Target Name="ResolveCssScopes" DependsOnTargets="_ComputeCssScope;ResolveRazorComponentInputs;ResolveRazorGenerateInputs">
<ApplyCssScopes RazorComponents="@(RazorComponent)" RazorGenerate="@(RazorGenerate)" ScopedCss="@(_ScopedCss)">
<Output TaskParameter="RazorComponentsWithScopes" ItemName="_RazorComponentsWithScopes" />
<Output TaskParameter="RazorGenerateWithScopes" ItemName="_RazorGenerateWithScopes" />
Expand All @@ -159,7 +159,7 @@ Integration with static web assets:

<!-- Sets the output path for the processed scoped css files. They will all have a '.rz.scp.css' extension to flag them as processed
scoped css files. -->
<Target Name="_ResolveScopedCssOutputs" DependsOnTargets="_ResolveCssScopes">
<Target Name="_ResolveScopedCssOutputs" DependsOnTargets="ResolveCssScopes">
<PropertyGroup>
<_ScopedCssIntermediatePath>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)scopedcss\))</_ScopedCssIntermediatePath>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Integration with static web assets:
<!-- This target validates that there is at most one scoped css file per component, that there are no scoped css files without a
matching component, and then adds the associated scope to the razor components that have a matching scoped css file.
-->
<Target Name="_ResolveCssScopes" BeforeTargets="AssignRazorComponentTargetPaths;AssignRazorGenerateTargetPaths" DependsOnTargets="_ComputeCssScope;ResolveRazorComponentInputs;ResolveRazorGenerateInputs">
<Target Name="ResolveCssScopes" DependsOnTargets="_ComputeCssScope;ResolveRazorComponentInputs;ResolveRazorGenerateInputs">
<ApplyCssScopes RazorComponents="@(RazorComponent)" RazorGenerate="@(RazorGenerate)" ScopedCss="@(_ScopedCss)">
<Output TaskParameter="RazorComponentsWithScopes" ItemName="_RazorComponentsWithScopes" />
<Output TaskParameter="RazorGenerateWithScopes" ItemName="_RazorGenerateWithScopes" />
Expand All @@ -137,7 +137,7 @@ Integration with static web assets:

<!-- Sets the output path for the processed scoped css files. They will all have a '.rz.scp.css' extension to flag them as processed
scoped css files. -->
<Target Name="_ResolveScopedCssOutputs" DependsOnTargets="_ResolveCssScopes">
<Target Name="_ResolveScopedCssOutputs" DependsOnTargets="ResolveCssScopes">
<PropertyGroup>
<_ScopedCssIntermediatePath>$([System.IO.Path]::GetFullPath($(IntermediateOutputPath)scopedcss\))</_ScopedCssIntermediatePath>
</PropertyGroup>
Expand Down

0 comments on commit d1883b0

Please sign in to comment.