forked from flutter/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tools]build ipa validate app icon size (#115594)
* [tools]build ipa validate icon size * add more checks in case apple change the format, and also add device lab tests * do not depend on collection package
- Loading branch information
1 parent
900b395
commit e438a12
Showing
3 changed files
with
474 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -17,6 +17,20 @@ Future<void> main() async { | |
section('Archive'); | ||
|
||
await inDirectory(flutterProject.rootPath, () async { | ||
final File appIconFile = File(path.join( | ||
flutterProject.rootPath, | ||
'ios', | ||
'Runner', | ||
'Assets.xcassets', | ||
'AppIcon.appiconset', | ||
'[email protected]', | ||
)); | ||
// Resizes app icon to 123x456 (it is supposed to be 20x20). | ||
appIconFile.writeAsBytesSync(appIconFile.readAsBytesSync() | ||
..buffer.asByteData().setInt32(16, 123) | ||
..buffer.asByteData().setInt32(20, 456) | ||
); | ||
|
||
final String output = await evalFlutter('build', options: <String>[ | ||
'xcarchive', | ||
'-v', | ||
|
@@ -27,6 +41,15 @@ Future<void> main() async { | |
if (!output.contains('Sending archive event if usage enabled')) { | ||
throw TaskResult.failure('Usage archive event not sent'); | ||
} | ||
|
||
if (!output.contains('Warning: App icon is using the wrong size (e.g. [email protected]).')) { | ||
throw TaskResult.failure('Must validate incorrect app icon image size.'); | ||
} | ||
|
||
// The project is still using Flutter template icon. | ||
if (!output.contains('Warning: App icon is set to the default placeholder icon. Replace with unique icons.')) { | ||
throw TaskResult.failure('Must validate template app icon.'); | ||
} | ||
}); | ||
|
||
final String archivePath = path.join( | ||
|
This file contains 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.