From 04bb954a7d6a21dda7ca52888b9fdd372c0b1362 Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Thu, 6 May 2021 19:04:23 -0700 Subject: [PATCH] Revert "Allow users to pass in Xcode build settings as env variables to flutter build macos FLUTTER_XCODE_ (#81384)" (#82004) This reverts commit 0bba935b7694f9aa30afa60b936b3f4299518d91. --- .../lib/src/macos/build_macos.dart | 1 - .../hermetic/build_macos_test.dart | 57 ------------------- 2 files changed, 58 deletions(-) diff --git a/packages/flutter_tools/lib/src/macos/build_macos.dart b/packages/flutter_tools/lib/src/macos/build_macos.dart index b5f166b571..a225e28423 100644 --- a/packages/flutter_tools/lib/src/macos/build_macos.dart +++ b/packages/flutter_tools/lib/src/macos/build_macos.dart @@ -114,7 +114,6 @@ Future buildMacOS({ else '-quiet', 'COMPILER_INDEX_STORE_ENABLE=NO', - ...environmentVariablesAsXcodeBuildSettings(globals.platform) ], trace: true, stdoutErrorMatcher: verboseLogging ? null : _anyOutput, 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 5ae6e72fae..16a8fb0c96 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 @@ -45,15 +45,6 @@ final Platform macosPlatform = FakePlatform( 'HOME': '/', } ); - -final FakePlatform macosPlatformCustomEnv = FakePlatform( - operatingSystem: 'macos', - environment: { - 'FLUTTER_ROOT': '/', - 'HOME': '/', - } -); - final Platform notMacosPlatform = FakePlatform( operatingSystem: 'linux', environment: { @@ -64,8 +55,6 @@ final Platform notMacosPlatform = FakePlatform( void main() { FileSystem fileSystem; TestUsage usage; - FakeProcessManager fakeProcessManager; - XcodeProjectInterpreter xcodeProjectInterpreter; setUpAll(() { Cache.disableLocking(); @@ -74,8 +63,6 @@ void main() { setUp(() { fileSystem = MemoryFileSystem.test(); usage = TestUsage(); - fakeProcessManager = FakeProcessManager.empty(); - xcodeProjectInterpreter = FakeXcodeProjectInterpreter(); }); // Sets up the minimal mock project files necessary to look like a Flutter project. @@ -314,50 +301,6 @@ void main() { Artifacts: () => Artifacts.test(), }); - testUsingContext('build settings contains Flutter Xcode environment variables', () async { - - macosPlatformCustomEnv.environment = Map.unmodifiable({ - 'FLUTTER_XCODE_ASSETCATALOG_COMPILER_APPICON_NAME': 'AppIcon.special' - }); - - final FlutterProject flutterProject = FlutterProject.fromDirectory(fileSystem.currentDirectory); - final Directory flutterBuildDir = fileSystem.directory(getMacOSBuildDirectory()); - - fakeProcessManager.addCommands([ - FakeCommand( - command: [ - '/usr/bin/env', - 'xcrun', - 'xcodebuild', - '-workspace', flutterProject.macos.xcodeWorkspace.path, - '-configuration', 'Debug', - '-scheme', 'Runner', - '-derivedDataPath', flutterBuildDir.absolute.path, - 'OBJROOT=${fileSystem.path.join(flutterBuildDir.absolute.path, 'Build', 'Intermediates.noindex')}', - 'SYMROOT=${fileSystem.path.join(flutterBuildDir.absolute.path, 'Build', 'Products')}', - '-quiet', - 'COMPILER_INDEX_STORE_ENABLE=NO', - 'ASSETCATALOG_COMPILER_APPICON_NAME=AppIcon.special', - ], - ), - ]); - - final BuildCommand command = BuildCommand(); - createMinimalMockProjectFiles(); - - await createTestCommandRunner(command).run( - const ['build', 'macos', '--debug', '--no-pub'] - ); - - expect(fakeProcessManager.hasRemainingExpectations, isFalse); - }, overrides: { - FileSystem: () => fileSystem, - ProcessManager: () => fakeProcessManager, - Platform: () => macosPlatformCustomEnv, - FeatureFlags: () => TestFeatureFlags(isMacOSEnabled: true), - XcodeProjectInterpreter: () => xcodeProjectInterpreter, - }); - testUsingContext('macOS build supports build-name and build-number', () async { final BuildCommand command = BuildCommand(); createMinimalMockProjectFiles();