Skip to content

Commit

Permalink
Move items setup to target
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrzesniewski committed Dec 11, 2024
1 parent 81eb578 commit bbb595a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/RazorBlade/RazorBlade.targets
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
<Project>

<ItemGroup>
<RazorBlade Update="@(RazorBlade)" Namespace="$([MSBuild]::ValueOrDefault('$(RootNamespace).%(RelativeDir)', '').Replace('\', '.').Replace('/', '.').Trim('.'))" />
<RazorBlade Update="@(RazorBlade)" IsRazorBlade="True" />

<None Remove="@(RazorBlade)" />
<AdditionalFiles Include="@(RazorBlade)" />
</ItemGroup>

<ItemGroup>
<AvailableItemName Include="RazorBlade" />
<PropertyPageSchema Include="$(MSBuildThisFileDirectory)RazorBlade.xaml" Context="File;BrowseObject" />

<CompilerVisibleProperty Include="RazorBladeEmbeddedLibrary" />
<CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="IsRazorBlade" />
<CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="Namespace" />

<None Remove="**/*.cshtml" Condition="'$(EnableDefaultItems)' == 'true' and '$(EnableDefaultRazorBladeItems)' == 'true'" />
</ItemGroup>

<Target Name="RazorBladeBeforeCompile" BeforeTargets="BeforeCompile">
Expand All @@ -26,6 +20,13 @@
<PropertyGroup>
<RazorBladeEmbeddedLibrary Condition="'$(RazorBladeEmbeddedLibrary)' == '' and @(PackageReference->WithMetadataValue('Identity', 'RazorBlade')->AnyHaveMetadataValue('PrivateAssets', 'all'))">True</RazorBladeEmbeddedLibrary>
</PropertyGroup>

<ItemGroup>
<RazorBlade Update="@(RazorBlade)" Namespace="$([MSBuild]::ValueOrDefault('$(RootNamespace).%(RelativeDir)', '').Replace('\', '.').Replace('/', '.').Trim('.'))" />
<RazorBlade Update="@(RazorBlade)" IsRazorBlade="True" />

<AdditionalFiles Include="@(RazorBlade)" />
</ItemGroup>
</Target>

</Project>

0 comments on commit bbb595a

Please sign in to comment.