-
Notifications
You must be signed in to change notification settings - Fork 6k
Add xcframework to ios out #22506
Add xcframework to ios out #22506
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM I just had a few python nits, also I'd just make sure that --help works correctly. It would be nice to have a very simple test for create_xcframework.py
| # Copyright 2013 The Flutter Authors. All rights reserved. | ||
| # Use of this source code is governed by a BSD-style license that can be | ||
| # found in the LICENSE file. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: google python style guide requires some future imports:
https://google.github.io/styleguide/pyguide.html#from-__future__-imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the minimum python version we support (I have 2.7.16 on my machine), I ran it through futurize.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import errno
import os
import shutil
import subprocess
import sys
This matches the other places we use from __future__ import
engine/build/copy_info_plist.py
Lines 16 to 23 in 8f060b9
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| import subprocess | |
| import sys | |
| import git_revision | |
| import os |
Lines 7 to 15 in b7e5940
| """Get the Git HEAD revision of a specified Git repository.""" | |
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| import sys | |
| import subprocess | |
| import os | |
| import argparse |
sky/tools/create_xcframework.py
Outdated
| output_dir = os.path.abspath(args.location) | ||
| output_xcframework = os.path.join(output_dir, '%s.xcframework' % args.name) | ||
|
|
||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if !os.path.exists(output_dir)
sky/tools/create_xcframework.py
Outdated
| '-quiet', | ||
| '-create-xcframework'] | ||
|
|
||
| [command.extend(['-framework', os.path.abspath(framework)]) for framework in args.frameworks] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typically list comprehensions are used for constructing lists, here you are constructing a list but ignoring the result. A for loop would be idiomatic python here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the idiomatic tips, my python-foo is zero.
@gaaclarke Can you point me to an existing example? The only one I see is |
|
I'm not sure there is an example for you. All tests are run through |
Created flutter/flutter#70654. |
Scenarios.app won't build if the Flutter.xcframework is missing. That's about the same coverage we had with any of the other framework build subscripts, like install_framework_headers.py. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Description
Create Flutter.xcframework in the
out/ios_*directories. It only contains theFlutter.frameworkin the same out directory, and will allow us to start testing XCFrameworks in the tool with--local-engineflags.This doesn't publish
Flutter.xcframeworkas a downloadable engine artifact.Related Issues
Local engine support part of flutter/flutter#60109, which is a dependency to support macOS ARM simulators flutter/flutter#64502
Tests
Adopted the generated
Flutter.xcframeworkin the Scenario app to prove it's working.Checklist
Reviewer Checklist
Breaking Change
Did any tests fail when you ran them? Please read [handling breaking changes].