Conversation
Signed-off-by: paulober <44974737+paulober@users.noreply.github.com>
|
@dotnet-policy-service agree |
rolfbjarne
left a comment
There was a problem hiding this comment.
I could not figure out based on the docs how to get it installed locally to test it with my MAUI app. Advices would be appreciated.
Were you able to build the repository locally?
If so, the easiest way is to build your MAUI app using the local build by executing dotnet from the checkout:
cd /path/to/dotnet/macios
# build macios
make all -j8 && make install -j9
# install the MAUI workload
dotnet workload install maui-ios --skip-manifest-update
# build your project
dotnet build /path/to/your/maui-project.csprojIf you could also add an .icon resource to this test project:
https://github.com/dotnet/macios/tree/main/tests/dotnet/AppWithXCAssets
that would be great!
| [Test] | ||
| [TestCase (ApplePlatform.iOS)] | ||
| [TestCase (ApplePlatform.MacCatalyst)] | ||
| [TestCase (ApplePlatform.MacOSX)] |
There was a problem hiding this comment.
It should work on tvOS I just forget to add it
|
Hi @@paulober. Due to inactivity, we will close this pull request in 7 days. |
- Add .icon glob patterns to ImageAsset auto-include and BundleResource exclusion in Microsoft.Sdk.DefaultItems.template.props - Fix tvOS support: register .icon assets in both brandAssetsInAssets and imageStacksInAssets for primary/alternate icon validation - Add tvOS test case to IconFileSupport - Add tests: IconFileSupportWithIncludeAllAppIcons, IconFileSupportAsAlternateIcon, InexistentIconFile, MixedXCAssetsAndIconFile - Update DefaultCompilationIncludes.md and build-items.md documentation Fixes dotnet#24132
Add a test project that uses .icon (Xcode Icon Composer) directories instead of .xcassets for app icons. The test builds the project for all platforms and verifies that raw .icon files don't end up in the app bundle as BundleResources (they should be processed by actool).
Add a basic .xcassets directory alongside .icon in the test project so the build can succeed even when actool's icon export subprocess fails (status 255 on some systems). The test gracefully skips with Assert.Ignore when icon export is not supported.
The icon.json format used 'version'+'layers'+'filename' but the correct Icon Composer format uses 'groups' containing 'layers' with 'image-name'. The old format caused actool's icon export subprocess to fail with status 255. With the correct format, actool successfully compiles .icon files into app icons on all platforms. Also removed the Images.xcassets fallback from the test project (no longer needed) and updated the integration test to assert success instead of skipping.
|
Continued in #24722. |
Sorry, did not have the time to continue working on this at the moment. Thanks for continuing. In case anyone needs an immediate solution, I currently have this workaround for MAUI in-place: <Target Name="RebuildAssetCatalogWithLiquidGlassAppIcon"
AfterTargets="_CoreCompileImageAssets"
BeforeTargets="_ComputeBundleResourceOutputPaths"
Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'
and $([System.IO.Directory]::Exists('$(ProjectDir)$(IntermediateOutputPath)$(_ActoolClonedAssets)'))
and $([System.IO.Directory]::Exists('$(MSBuildProjectDirectory)/Platforms/iOS/AppIcon.icon'))">
<!-- Late-bind: at this point IntermediateOutputPath is fully resolved (incl. RID/DeviceSpecific) -->
<PropertyGroup>
<_LiquidGlassAppIconName>AppIcon</_LiquidGlassAppIconName>
<_ActoolRoot>$(IntermediateOutputPath)actool</_ActoolRoot>
<_ActoolClonedAssets>$(_ActoolRoot)/cloned-assets/Assets.xcassets</_ActoolClonedAssets>
<_ActoolBundleOut>$(_ActoolRoot)/bundle</_ActoolBundleOut>
<_ActoolPartialPlist>$(_ActoolRoot)/partial-info.plist</_ActoolPartialPlist>
<_LiquidGlassIconBundle>$(MSBuildProjectDirectory)/Platforms/iOS/AppIcon.icon</_LiquidGlassIconBundle>
<_AssetsCar>$(_ActoolBundleOut)/Assets.car</_AssetsCar>
</PropertyGroup>
<!-- Only run if MAUI already generated the cloned asset catalog -->
<Message Importance="high"
Condition="$([System.IO.Directory]::Exists('$(_ActoolClonedAssets)'))"
Text="Rebuilding Assets.car (With Composer Icon) | IOP=$(IntermediateOutputPath) | actoolRoot=$(_ActoolRoot)" />
<Error Condition="!$([System.IO.Directory]::Exists('$(_ActoolClonedAssets)'))"
Text="actool cloned asset catalog not found: $(_ActoolClonedAssets). Make sure _CoreCompileImageAssets ran and produced the intermediate actool folder." />
<!-- Ensure output exists (actool will fail otherwise) -->
<MakeDir Directories="$(_ActoolBundleOut)" />
<!-- delete the previously generated Assets.car so we KNOW we replaced it -->
<Delete Files="$(_AssetsCar)" ContinueOnError="true" />
<!-- rerun actool with the same essential args MAUI uses, plus app-icon flags -->
<Exec Command="/usr/bin/xcrun actool "$(_LiquidGlassIconBundle)" --errors --warnings --notices --output-format xml1 --compress-pngs --target-device iphone --target-device ipad --minimum-deployment-target $(SupportedOSPlatformVersion) --platform iphoneos --include-all-app-icons --app-icon $(_LiquidGlassAppIconName) --output-partial-info-plist "$(_ActoolPartialPlist)" --compile "$(_ActoolBundleOut)" "$(_ActoolClonedAssets)"" />
<!-- sanity check: fail fast if actool didn't produce Assets.car -->
<Error Condition="!Exists('$(_AssetsCar)')"
Text="Actool rebuild did not produce Assets.car at $(_AssetsCar)" />
</Target> |
Add support for Icon Composer (.icon) app icons
This adds support for Xcode Icon Composer based
.iconfolders introduced in macOS 26 Tahoe's Liquid Glass design system (see #24132).Changes
.iconfolders: Treats.icondirectories as asset catalogs alongside.xcassetsicon.jsonfiles: Handlesicon.jsonmetadata files in addition toContents.json--app-iconflag:.icon-based icons now pass validation and get the--app-iconflag passed toactoolIncludeAllAppIconsfor runtime icon switchingBackground
The new
.iconformat is a folder structure containing:icon.json- Icon metadata (layers, materials, effects)Assets/subfolder - Vector graphics and image assetsThis replaces static
.icnsfiles to support Liquid Glass features like translucency, specular lighting, and cross-platform rendering.Usage
Add
.iconfolders to your project:The build system will:
.iconfolder as a valid app iconactoolwith the--app-icon AppIconflagAssets.carTesting
I could not figure out based on the docs how to get it installed locally to test it with my MAUI app. Advices would be appreciated.