8000 Build App.framework directly to build directory by jmagman · Pull Request #69699 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Build App.framework directly to build directory #69699

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

Merged
merged 3 commits into from
Nov 3, 2020

Conversation

jmagman
Copy link
Member
@jmagman jmagman commented Nov 3, 2020

#69612 with updated ios_content_validation_test.

Description

Since #51453 we no longer need to build the App.framework to a known directory like project/ios/Flutter/App.framework. Instead, build the frameworks directly to the build products directory. For example, flutter build ios -v --simulator will build to /build/ios/Debug-iphonesimulator/App.framework.

Additionally, this sets us up to no longer need to lipo the simulator and non-simulator frameworks together since they will build to different directories.

final String resultPath = environment.fileSystem.path.join(environment.buildDir.path, 'App.framework', 'App');
environment.fileSystem.directory(resultPath).parent.createSync(recursive: true);
final ProcessResult result = await environment.processManager.run(<String>[
'lipo',
...darwinArchs.map((DarwinArch iosArch) =>
environment.fileSystem.path.join(buildOutputPath, getNameForDarwinArch(iosArch), 'App.framework', 'App')),
'-create',
'-output',
resultPath,
]);

When Apple Silicon ships and ARM simulators are supported, this lipo will fail since the simulator and real device frameworks will both contain arm64.

Also stop copying the .DS_Store directories, while we're at it (already done with Flutter.framework). These files shouldn't be copied, and it adds spew during the installation phase:

[        ] [ 31%] Copying
/build/ios/iphoneos/Runner.app/Frameworks/App.framework/flutter_assets/assets/navbar/.DS_Store to
device

Related Issues

#60118

Tests

Updated ios_content_validation_test. Already many many integration tests that will blow up in the compiled dart code or flutter_assets are missing.

@jmagman jmagman added the t: xcode "xcodebuild" on iOS and general Xcode project management label Nov 3, 2020
@jmagman jmagman requested a review from jonahwilliams November 3, 2020 18:51
@jmagman jmagman self-assigned this Nov 3, 2020
@flutter-dashboard flutter-dashboard bot added team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels. labels Nov 3, 2020
@google-cla google-cla bot added the cla: yes label Nov 3, 2020
Comment on lines +122 to +127
'BUILT_PRODUCTS_DIR': path.join(
flutterProject.rootPath,
'build',
'ios',
'Release-iphoneos',
),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been added to #69612.

This test fakes out some Xcode build settings to directly test xcode_backend. We can always rely on BUILT_PRODUCTS_DIR being present when run directly in Xcode.

Copy link
Member
@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-host-arm Building on an ARM-based platform t: xcode "xcodebuild" on iOS and general Xcode project management team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0