-
Notifications
You must be signed in to change notification settings - Fork 559
Add support for Composer Icons #24722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rolfbjarne
wants to merge
10
commits into
main
Choose a base branch
from
dev/rolf/support-composer-icons
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7679b9e
Add support for Composer Icons
paulober 8d29605
[msbuild] Improve support for Composer Icons (.icon)
rolfbjarne 4d27b7f
Add AppWithComposerIcon test project and ComposerIcon integration test
rolfbjarne 3dad65e
Add .xcassets fallback and graceful skip for icon export failure
rolfbjarne c58f712
Fix indentation in csproj files to use tabs
rolfbjarne 24c7f45
Add Makefile logic to AppWithComposerIcon test project
rolfbjarne 478d2c3
Fix icon.json format and remove xcassets fallback
rolfbjarne 99a4a0b
Merge remote-tracking branch 'origin/main' into support-composer-icons
rolfbjarne 1c1bbf4
Merge remote-tracking branch 'origin/main' into support-composer-icons
rolfbjarne 40f00db
Auto-format source code
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| using System; | ||
| using Foundation; | ||
|
|
||
| #if !__MACOS__ | ||
| using UIKit; | ||
| #endif | ||
|
|
||
| #nullable enable | ||
|
|
||
| namespace AppWithComposerIcon { | ||
| #if !(__MACCATALYST__ || __MACOS__) | ||
| public class AppDelegate : UIApplicationDelegate { | ||
| public override bool FinishedLaunching (UIApplication app, NSDictionary options) | ||
| { | ||
| return true; | ||
| } | ||
| } | ||
| #endif | ||
|
|
||
| public class Program { | ||
| static int Main (string [] args) | ||
| { | ||
| #if __MACCATALYST__ || __MACOS__ | ||
| GC.KeepAlive (typeof (NSObject)); // prevent linking away the platform assembly | ||
|
|
||
| Console.WriteLine (Environment.GetEnvironmentVariable ("MAGIC_WORD")); | ||
|
|
||
| return args.Length; | ||
| #else | ||
| UIApplication.Main (args, null, typeof (AppDelegate)); | ||
| return 0; | ||
| #endif | ||
| } | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
tests/dotnet/AppWithComposerIcon/MacCatalyst/AppWithComposerIcon.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <TargetFramework>net$(BundledNETCoreAppTargetFrameworkVersion)-maccatalyst</TargetFramework> | ||
| </PropertyGroup> | ||
| <Import Project="..\shared.csproj" /> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| include ../shared.mk |
Binary file added
BIN
+5.57 KB
...s/dotnet/AppWithComposerIcon/MacCatalyst/Resources/AppIcon.icon/Assets/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.57 KB
.../dotnet/AppWithComposerIcon/MacCatalyst/Resources/AppIcon.icon/Assets/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
tests/dotnet/AppWithComposerIcon/MacCatalyst/Resources/AppIcon.icon/icon.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "groups" : [ | ||
| { | ||
| "layers" : [ | ||
| { | ||
| "image-name" : "back.png", | ||
| "name" : "back" | ||
| }, | ||
| { | ||
| "image-name" : "front.png", | ||
| "name" : "front" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
7 changes: 7 additions & 0 deletions
7
tests/dotnet/AppWithComposerIcon/iOS/AppWithComposerIcon.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <TargetFramework>net$(BundledNETCoreAppTargetFrameworkVersion)-ios</TargetFramework> | ||
| </PropertyGroup> | ||
| <Import Project="..\shared.csproj" /> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| include ../shared.mk |
Binary file added
BIN
+5.57 KB
tests/dotnet/AppWithComposerIcon/iOS/Resources/AppIcon.icon/Assets/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.57 KB
tests/dotnet/AppWithComposerIcon/iOS/Resources/AppIcon.icon/Assets/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
tests/dotnet/AppWithComposerIcon/iOS/Resources/AppIcon.icon/icon.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "groups" : [ | ||
| { | ||
| "layers" : [ | ||
| { | ||
| "image-name" : "back.png", | ||
| "name" : "back" | ||
| }, | ||
| { | ||
| "image-name" : "front.png", | ||
| "name" : "front" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
7 changes: 7 additions & 0 deletions
7
tests/dotnet/AppWithComposerIcon/macOS/AppWithComposerIcon.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <TargetFramework>net$(BundledNETCoreAppTargetFrameworkVersion)-macos</TargetFramework> | ||
| </PropertyGroup> | ||
| <Import Project="..\shared.csproj" /> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| include ../shared.mk |
Binary file added
BIN
+5.57 KB
tests/dotnet/AppWithComposerIcon/macOS/Resources/AppIcon.icon/Assets/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.57 KB
tests/dotnet/AppWithComposerIcon/macOS/Resources/AppIcon.icon/Assets/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
tests/dotnet/AppWithComposerIcon/macOS/Resources/AppIcon.icon/icon.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "groups" : [ | ||
| { | ||
| "layers" : [ | ||
| { | ||
| "image-name" : "back.png", | ||
| "name" : "back" | ||
| }, | ||
| { | ||
| "image-name" : "front.png", | ||
| "name" : "front" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project> | ||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
|
|
||
| <ApplicationTitle>AppWithComposerIcon</ApplicationTitle> | ||
| <ApplicationId>com.xamarin.appwithcomposericon</ApplicationId> | ||
|
|
||
| <UseInterpreter>true</UseInterpreter> <!-- this is only to speed up the build --> | ||
| </PropertyGroup> | ||
|
|
||
| <Import Project="../../common/shared-dotnet.csproj" /> | ||
|
|
||
| <PropertyGroup> | ||
| <AppIcon>AppIcon</AppIcon> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Compile Include="../*.cs" /> | ||
|
|
||
| <!-- ImageAssets: included by default (each platform has a Resources/AppIcon.icon directory) --> | ||
| </ItemGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| TOP=../../../.. | ||
| TESTNAME=AppWithComposerIcon | ||
| include $(TOP)/tests/common/shared-dotnet.mk |
7 changes: 7 additions & 0 deletions
7
tests/dotnet/AppWithComposerIcon/tvOS/AppWithComposerIcon.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <TargetFramework>net$(BundledNETCoreAppTargetFrameworkVersion)-tvos</TargetFramework> | ||
| </PropertyGroup> | ||
| <Import Project="..\shared.csproj" /> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| include ../shared.mk |
Binary file added
BIN
+5.57 KB
tests/dotnet/AppWithComposerIcon/tvOS/Resources/AppIcon.icon/Assets/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.57 KB
tests/dotnet/AppWithComposerIcon/tvOS/Resources/AppIcon.icon/Assets/front.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions
16
tests/dotnet/AppWithComposerIcon/tvOS/Resources/AppIcon.icon/icon.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "groups" : [ | ||
| { | ||
| "layers" : [ | ||
| { | ||
| "image-name" : "back.png", | ||
| "name" : "back" | ||
| }, | ||
| { | ||
| "image-name" : "front.png", | ||
| "name" : "front" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new test verifies that the raw
.iconinputs aren't copied asBundleResources, but it doesn't assert that asset compilation actually produced anAssets.carin the app bundle. Without that assertion, the test could pass even if the icon catalog was ignored (resulting in missing app icons). Consider assertingAssets.carexists (asTestXCAssetsImpldoes) and/or validating that the compiled assets contain at least the expected icon entry.