@@ -991,6 +991,84 @@ void main() {
991991 PlistParser : () => plistUtils,
992992 });
993993
994+ testUsingContext (
995+ 'Validate basic Xcode settings with default bundle identifier prefix' , () async {
996+ const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist' ;
997+ fakeProcessManager.addCommands (< FakeCommand > [
998+ xattrCommand,
999+ setUpFakeXcodeBuildHandler (onRun: () {
1000+ fileSystem.file (plistPath).createSync (recursive: true );
1001+ }),
1002+ exportArchiveCommand (exportOptionsPlist: _exportOptionsPlist),
1003+ ]);
1004+
1005+ createMinimalMockProjectFiles ();
1006+
1007+ plistUtils.fileContents[plistPath] = < String ,String > {
1008+ 'CFBundleIdentifier' : 'com.example.my_app' ,
1009+ };
1010+
1011+ final BuildCommand command = BuildCommand (
1012+ androidSdk: FakeAndroidSdk (),
1013+ buildSystem: TestBuildSystem .all (BuildResult (success: true )),
1014+ fileSystem: MemoryFileSystem .test (),
1015+ logger: BufferLogger .test (),
1016+ osUtils: FakeOperatingSystemUtils (),
1017+ );
1018+ await createTestCommandRunner (command).run (
1019+ < String > ['build' , 'ipa' , '--no-pub' ]);
1020+
1021+ expect (
1022+ testLogger.statusText,
1023+ contains ('Warning: Your application still contains the default "com.example" bundle identifier.' )
1024+ );
1025+ }, overrides: < Type , Generator > {
1026+ FileSystem : () => fileSystem,
1027+ ProcessManager : () => fakeProcessManager,
1028+ Platform : () => macosPlatform,
1029+ XcodeProjectInterpreter : () => FakeXcodeProjectInterpreterWithBuildSettings (),
1030+ PlistParser : () => plistUtils,
1031+ });
1032+
1033+ testUsingContext (
1034+ 'Validate basic Xcode settings with custom bundle identifier prefix' , () async {
1035+ const String plistPath = 'build/ios/archive/Runner.xcarchive/Products/Applications/Runner.app/Info.plist' ;
1036+ fakeProcessManager.addCommands (< FakeCommand > [
1037+ xattrCommand,
1038+ setUpFakeXcodeBuildHandler (onRun: () {
1039+ fileSystem.file (plistPath).createSync (recursive: true );
1040+ }),
1041+ exportArchiveCommand (exportOptionsPlist: _exportOptionsPlist),
1042+ ]);
1043+
1044+ createMinimalMockProjectFiles ();
1045+
1046+ plistUtils.fileContents[plistPath] = < String ,String > {
1047+ 'CFBundleIdentifier' : 'com.my_company.my_app' ,
1048+ };
1049+
1050+ final BuildCommand command = BuildCommand (
1051+ androidSdk: FakeAndroidSdk (),
1052+ buildSystem: TestBuildSystem .all (BuildResult (success: true )),
1053+ fileSystem: MemoryFileSystem .test (),
1054+ logger: BufferLogger .test (),
1055+ osUtils: FakeOperatingSystemUtils (),
1056+ );
1057+ await createTestCommandRunner (command).run (
1058+ < String > ['build' , 'ipa' , '--no-pub' ]);
1059+
1060+ expect (
1061+ testLogger.statusText,
1062+ isNot (contains ('Warning: Your application still contains the default "com.example" bundle identifier.' ))
1063+ );
1064+ }, overrides: < Type , Generator > {
1065+ FileSystem : () => fileSystem,
1066+ ProcessManager : () => fakeProcessManager,
1067+ Platform : () => macosPlatform,
1068+ XcodeProjectInterpreter : () => FakeXcodeProjectInterpreterWithBuildSettings (),
1069+ PlistParser : () => plistUtils,
1070+ });
1071+
9941072
9951073 testUsingContext ('Validate template app icons with conflicts' , () async {
9961074 const String projectIconContentsJsonPath = 'ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json' ;
0 commit comments