Skip to content

Commit 6724a3e

Browse files
committed
Improve the control over resource generation
1 parent 040f2f1 commit 6724a3e

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/SingleProject/Resizetizer/src/nuget/buildTransitive/Microsoft.Maui.Resizetizer.After.targets

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@
339339
</ItemGroup>
340340
</Target>
341341

342-
<Target Name="ProcessMauiAssets">
342+
<Target Name="ProcessMauiAssets"
343+
Condition="'$(EnableMauiAssetProcessing)' != 'false'">
343344
<PropertyGroup Condition="'$(_ResizetizerIsWindowsAppSdk)' == 'True'">
344345
<_MauiAssetItemMetadata>TargetPath</_MauiAssetItemMetadata>
345346
</PropertyGroup>
@@ -365,12 +366,16 @@
365366
</Target>
366367

367368
<Target Name="ProcessMauiSplashScreens"
369+
Condition="'$(EnableMauiSplashScreenProcessing)' != 'false'"
368370
Inputs="$(MSBuildThisFileFullPath);$(_ResizetizerTaskAssemblyName);$(_MauiSplashInputsFile);@(MauiSplashScreen)"
369371
Outputs="$(_MauiSplashStampFile)">
370372

371373
<PropertyGroup>
372374
<_MauiHasSplashScreens>false</_MauiHasSplashScreens>
373375
<_MauiHasSplashScreens Condition="'@(MauiSplashScreen->Count())' != '0'">true</_MauiHasSplashScreens>
376+
<_MauiShouldGenerateSplashScreen>false</_MauiShouldGenerateSplashScreen>
377+
<_MauiShouldGenerateSplashScreen Condition="'$(_MauiHasSplashScreens)' == 'true'">true</_MauiShouldGenerateSplashScreen>
378+
<_MauiShouldGenerateSplashScreen Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True' and '$(_MauiHasSplashScreens)' != 'true' and '$(EnableBlankMauiSplashScreen)' == 'true'">true</_MauiShouldGenerateSplashScreen>
374379
</PropertyGroup>
375380

376381
<DetectInvalidResourceOutputFilenamesTask
@@ -400,7 +405,7 @@
400405
</ItemGroup>
401406

402407
<!-- iOS, but not Catalyst -->
403-
<ItemGroup Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True'">
408+
<ItemGroup Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True' and '$(_MauiHasSplashScreens)' == 'true'">
404409
<!-- Add a Link attribute in the form of '<filename>_<inputshash>.<extension>' -->
405410
<_MauiSplashScreenWithHashesInFilename
406411
Include="@(_MauiSplashScreenWithHashes->HasMetadata('Link'))"
@@ -412,22 +417,22 @@
412417
Link="%(Filename)_%(InputsFileHash)%(Extension)" />
413418
</ItemGroup>
414419
<GenerateSplashStoryboard
415-
Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True'"
420+
Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True' and '$(_MauiShouldGenerateSplashScreen)' == 'true'"
416421
IntermediateOutputPath="$(_MauiIntermediateSplashScreen)"
417422
MauiSplashScreen="@(_MauiSplashScreenWithHashesInFilename)"
418423
InputsFile="$(_MauiSplashInputsFile)"
419424
/>
420-
<PropertyGroup Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True'">
425+
<PropertyGroup Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True' and '$(_MauiShouldGenerateSplashScreen)' == 'true'">
421426
<_MauiIntermediateStoryboard>$(_MauiIntermediateSplashScreen)MauiSplash.storyboard</_MauiIntermediateStoryboard>
422427
<_MauiIntermediatePList>$(_MauiIntermediateSplashScreen)MauiInfo.plist</_MauiIntermediatePList>
423428
</PropertyGroup>
424429
<CreatePartialInfoPlistTask
425-
Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True'"
430+
Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True' and '$(_MauiShouldGenerateSplashScreen)' == 'true'"
426431
IntermediateOutputPath="$(_MauiIntermediateSplashScreen)"
427432
PlistName="MauiInfo.plist"
428433
Storyboard="$(_MauiIntermediateStoryboard)"
429434
/>
430-
<ItemGroup Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True'">
435+
<ItemGroup Condition="'$(_ResizetizerIsiOSSpecificApp)' == 'True' and '$(_MauiShouldGenerateSplashScreen)' == 'true'">
431436
<_MauiSplashAssets Include="$(_MauiIntermediateSplashScreen)**\*" />
432437
<_MauiSplashStoryboard Include="$(_MauiIntermediateStoryboard)" />
433438
<_MauiSplashPList Include="$(_MauiIntermediatePList)" />
@@ -481,6 +486,7 @@
481486
</Target>
482487

483488
<Target Name="ProcessMauiFonts"
489+
Condition="'$(EnableMauiFontProcessing)' != 'false'"
484490
Inputs="$(MSBuildThisFileFullPath);$(_ResizetizerTaskAssemblyName);$(_MauiFontInputsFile);@(MauiFont)"
485491
Outputs="$(_MauiFontStampFile)"
486492
AfterTargets="$(ProcessMauiFontsAfterTargets)"
@@ -568,6 +574,7 @@
568574
</Target>
569575

570576
<Target Name="ResizetizeImages"
577+
Condition="'$(EnableMauiImageProcessing)' != 'false'"
571578
Inputs="$(MSBuildThisFileFullPath);$(_ResizetizerTaskAssemblyName);$(_ResizetizerInputsFile);@(MauiImage)"
572579
Outputs="$(_ResizetizerStampFile)"
573580
AfterTargets="$(ResizetizeAfterTargets)"

0 commit comments

Comments
 (0)