diff --git a/packages/flutter_tools/lib/src/commands/build_macos.dart b/packages/flutter_tools/lib/src/commands/build_macos.dart index 7185d86afcc..641e8fc29b1 100644 --- a/packages/flutter_tools/lib/src/commands/build_macos.dart +++ b/packages/flutter_tools/lib/src/commands/build_macos.dart @@ -25,7 +25,6 @@ class BuildMacosCommand extends BuildSubCommand { 'This can be used in CI/CD process that create an archive to avoid ' 'performing duplicate work.', ); - argParser.addFlag('codesign', defaultsTo: true, help: 'Codesign the application bundle.'); } @override @@ -47,8 +46,6 @@ class BuildMacosCommand extends BuildSubCommand { bool get configOnly => boolArg('config-only'); - bool get shouldCodesign => boolArg('codesign'); - @override Future runCommand() async { final BuildInfo buildInfo = await getBuildInfo(); @@ -60,9 +57,6 @@ class BuildMacosCommand extends BuildSubCommand { if (!supported) { throwToolExit('"build macos" only supported on macOS hosts.'); } - if (!shouldCodesign) { - globals.printStatus('Warning: Building with codesigning disabled.'); - } await buildMacOS( flutterProject: project, buildInfo: buildInfo, @@ -76,7 +70,6 @@ class BuildMacosCommand extends BuildSubCommand { analytics: analytics, ), usingCISystem: usingCISystem, - codesign: shouldCodesign, ); return FlutterCommandResult.success(); } diff --git a/packages/flutter_tools/lib/src/macos/build_macos.dart b/packages/flutter_tools/lib/src/macos/build_macos.dart index 87983663939..974f2a4149a 100644 --- a/packages/flutter_tools/lib/src/macos/build_macos.dart +++ b/packages/flutter_tools/lib/src/macos/build_macos.dart @@ -72,7 +72,6 @@ Future buildMacOS({ bool configOnly = false, SizeAnalyzer? sizeAnalyzer, bool usingCISystem = false, - bool codesign = true, }) async { final Directory? xcodeWorkspace = flutterProject.macos.xcodeWorkspace; if (xcodeWorkspace == null) { @@ -225,11 +224,6 @@ Future buildMacOS({ if (disabledSandboxEntitlementFile != null) 'CODE_SIGN_ENTITLEMENTS=${disabledSandboxEntitlementFile.path}', ...environmentVariablesAsXcodeBuildSettings(globals.platform), - if (!codesign) ...[ - 'CODE_SIGNING_ALLOWED=NO', - 'CODE_SIGNING_REQUIRED=NO', - 'CODE_SIGNING_IDENTITY=""', - ], ], trace: true, stdoutErrorMatcher: verboseLogging ? null : _filteredOutput, diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart index a1ccec64466..9c2bedbd0ff 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_macos_test.dart @@ -1010,58 +1010,4 @@ STDERR STUFF OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_x64), }, ); - - testUsingContext( - 'macos build --no-codesign skips codesigning', - () async { - final BuildCommand command = BuildCommand( - androidSdk: FakeAndroidSdk(), - buildSystem: TestBuildSystem.all(BuildResult(success: true)), - logger: logger, - fileSystem: fileSystem, - osUtils: FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64), - ); - fakeProcessManager.addCommands([ - const FakeCommand( - command: [ - '/usr/bin/env', - 'xcrun', - 'xcodebuild', - '-workspace', - '/macos/Runner.xcworkspace', - '-configuration', - 'Release', - '-scheme', - 'Runner', - '-derivedDataPath', - '/build/macos', - '-destination', - 'generic/platform=macOS', - 'OBJROOT=/build/macos/Build/Intermediates.noindex', - 'SYMROOT=/build/macos/Build/Products', - '-quiet', - 'COMPILER_INDEX_STORE_ENABLE=NO', - 'CODE_SIGNING_ALLOWED=NO', - 'CODE_SIGNING_REQUIRED=NO', - 'CODE_SIGNING_IDENTITY=""', - ], - ), - ]); - createMinimalMockProjectFiles(); - - await createTestCommandRunner( - command, - ).run(const ['build', 'macos', '--no-pub', '--no-codesign']); - expect(fakeProcessManager, hasNoRemainingExpectations); - expect(logger.statusText, contains('Warning: Building with codesigning disabled.')); - }, - overrides: { - FileSystem: () => fileSystem, - Logger: () => logger, - ProcessManager: () => fakeProcessManager, - Pub: ThrowingPub.new, - Platform: () => macosPlatform, - OperatingSystemUtils: () => FakeOperatingSystemUtils(hostPlatform: HostPlatform.darwin_arm64), - }, - ); }