diff --git a/PackMauiAssets.targets b/PackMauiAssets.targets new file mode 100644 index 00000000..39e0d401 --- /dev/null +++ b/PackMauiAssets.targets @@ -0,0 +1,119 @@ + + + + + true + + + **\.DS_Store + + + + + + <_SafeMauiImage Include="@(MauiImage)" Exclude="$(PackMauiItemsExcludes)" /> + <_SafeMauiIcon Include="@(MauiIcon)" Exclude="$(PackMauiItemsExcludes)" /> + <_SafeMauiSplashScreen Include="@(MauiSplashScreen)" Exclude="$(PackMauiItemsExcludes)" /> + <_SafeMauiAsset Include="@(MauiAsset)" Exclude="$(PackMauiItemsExcludes)" /> + <_SafeMauiFont Include="@(MauiFont)" Exclude="$(PackMauiItemsExcludes)" /> + + + <_PackageFiles Include="@(_SafeMauiImage)" Pack="True" PackagePath="buildTransitive\_MauiItems\Images\%(Filename)%(Extension)" /> + <_MauiImageForegroundProxy Include="@(_SafeMauiImage->HasMetadata('ForegroundFile'))" BackgroundFile="%(Filename)%(Extension)" /> + <_PackageFiles Include="@(_MauiImageForegroundProxy->'%(ForegroundFile)')" Pack="True" PackagePath="buildTransitive\_MauiItems\Images\Foreground\%(BackgroundFile)" /> + + <_PackageFiles Include="@(_SafeMauiIcon)" Pack="True" PackagePath="buildTransitive\_MauiItems\AppIcon\%(Filename)%(Extension)" /> + <_MauiIconForegroundProxy Include="@(_SafeMauiIcon->HasMetadata('ForegroundFile'))" BackgroundFile="%(Filename)%(Extension)" /> + <_PackageFiles Include="@(_MauiIconForegroundProxy->'%(ForegroundFile)')" Pack="True" PackagePath="buildTransitive\_MauiItems\AppIcon\Foreground\%(BackgroundFile)" /> + + <_PackageFiles Include="@(_SafeMauiSplashScreen)" Pack="True" PackagePath="buildTransitive\_MauiItems\Splash\%(Filename)%(Extension)" /> + + <_PackageFiles Include="@(_SafeMauiFont)" Pack="True" PackagePath="buildTransitive\_MauiItems\Fonts\%(Filename)%(Extension)" /> + + <_PackageFiles Include="@(_SafeMauiAsset)" Pack="True" PackagePath="buildTransitive\_MauiItems\Raw\%(RecursiveDir)%(Filename)%(Extension)" /> + + + + + + <_IncludeMauiItemsTargetsBoilerplate> + + + {{MauiItems}} + + + ]]> + + + + + + + <_IncludeMauiItems Include="@(_SafeMauiImage->'<MauiImage + Include="%24(MSBuildThisFileDirectory)_MauiItems\Images\%(Filename)%(Extension)" + Link="%(Link)" + BaseSize="%(BaseSize)" + Resize="%(Resize)" + TintColor="%(TintColor)" + Color="%(Color)" + Visible="False" + />')" /> + + <_IncludeMauiItems Include="@(_SafeMauiIcon->'<MauiIcon + Include="%24(MSBuildThisFileDirectory)_MauiItems\AppIcon\%(Filename)%(Extension)" + ForegroundFile="%24(MSBuildThisFileDirectory)_MauiItems\AppIcon\Foreground\%(Filename)%(Extension)" + Link="%(Link)" + BaseSize="%(BaseSize)" + Resize="%(Resize)" + TintColor="%(TintColor)" + Color="%(Color)" + ForegroundScale="%(ForegroundScale)" + Visible="False" + />')" /> + + <_IncludeMauiItems Include="@(_SafeMauiSplashScreen->'<MauiSplashScreen + Include="%24(MSBuildThisFileDirectory)_MauiItems\Splash\%(Filename)%(Extension)" + Link="%(Link)" + BaseSize="%(BaseSize)" + Resize="%(Resize)" + TintColor="%(TintColor)" + Color="%(Color)" + Visible="False" + />')" /> + + <_IncludeMauiItems Include="@(_SafeMauiFont->'<MauiFont + Include="%24(MSBuildThisFileDirectory)_MauiItems\Fonts\%(Filename)%(Extension)" + Link="%(Link)" + Visible="False" + />')" /> + + <_IncludeMauiItems Include="@(_SafeMauiAsset->'<MauiAsset + Include="%24(MSBuildThisFileDirectory)_MauiItems\Raw\%(RecursiveDir)%(Filename)%(Extension)" + Link="%(Link)" + LogicalName="%(LogicalName)" + Visible="False" + />')" /> + + + + + <_IncludeMauiItem>@(_IncludeMauiItems, '%0A ') + <_IncludeMauiItemsTargetsBoilerplate>$(_IncludeMauiItemsTargetsBoilerplate.Replace('{{MauiItems}}', '$(_IncludeMauiItem)')) + <_FinalPackMauiItemsTargetsFileName>$(PackageId).targets + + + <_IncludeMauiItemsTargetsLines Include="$(_IncludeMauiItemsTargetsBoilerplate)" /> + + + + + <_PackageFiles Include="$(IntermediateOutputPath)_IncludeMauiAssets.g.targets" Pack="True" PackagePath="buildTransitive\$(_FinalPackMauiItemsTargetsFileName)" /> + + + + + \ No newline at end of file diff --git a/src/SharedMauiXamlStylesLibrary.SampleApp/SharedMauiXamlStylesLibrary.SampleApp.csproj b/src/SharedMauiXamlStylesLibrary.SampleApp/SharedMauiXamlStylesLibrary.SampleApp.csproj index 76f85be5..162a6fec 100644 --- a/src/SharedMauiXamlStylesLibrary.SampleApp/SharedMauiXamlStylesLibrary.SampleApp.csproj +++ b/src/SharedMauiXamlStylesLibrary.SampleApp/SharedMauiXamlStylesLibrary.SampleApp.csproj @@ -191,7 +191,7 @@ - - + + diff --git a/src/SharedMauiXamlStylesLibrary.SampleApp/Views/ButtonsPage.xaml b/src/SharedMauiXamlStylesLibrary.SampleApp/Views/ButtonsPage.xaml index 004e00c0..d3450e42 100644 --- a/src/SharedMauiXamlStylesLibrary.SampleApp/Views/ButtonsPage.xaml +++ b/src/SharedMauiXamlStylesLibrary.SampleApp/Views/ButtonsPage.xaml @@ -101,6 +101,20 @@ Text="{x:Static icons:MaterialIcons.ProgressCheck}" Style="{StaticResource Style.Core.Button.IconPrimary.MaterialDesign}" /> +