This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Add xcframework to ios out #22506
Merged
Merged
Add xcframework to ios out #22506
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/usr/bin/env python | ||
| # 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. | ||
|
|
||
| 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 | ||
|
|
||
| def main(): | ||
| parser = argparse.ArgumentParser( | ||
| description='Creates an XCFramework consisting of the specified universal frameworks') | ||
|
|
||
| parser.add_argument('--frameworks', | ||
| nargs='+', help='The framework paths used to create the XCFramework.', required=True) | ||
| parser.add_argument('--name', help='Name of the XCFramework', type=str, required=True) | ||
| parser.add_argument('--location', help='Output directory', type=str, required=True) | ||
|
|
||
| args = parser.parse_args() | ||
gaaclarke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| output_dir = os.path.abspath(args.location) | ||
| output_xcframework = os.path.join(output_dir, '%s.xcframework' % args.name) | ||
|
|
||
| if not os.path.exists(output_dir): | ||
| os.makedirs(output_dir) | ||
|
|
||
| if os.path.exists(output_xcframework): | ||
| # Remove old xcframework. | ||
| shutil.rmtree(output_xcframework) | ||
|
|
||
| # xcrun xcodebuild -create-xcframework -framework foo/baz.framework -framework bar/baz.framework -output output/ | ||
| command = ['xcrun', | ||
| 'xcodebuild', | ||
| '-quiet', | ||
| '-create-xcframework'] | ||
|
|
||
| for framework in args.frameworks: | ||
| command.extend(['-framework', os.path.abspath(framework)]) | ||
|
|
||
| command.extend(['-output', output_xcframework]) | ||
|
|
||
| subprocess.check_call(command, stdout=open(os.devnull, 'w')) | ||
|
|
||
| if __name__ == '__main__': | ||
| sys.exit(main()) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.This matches the other places we use
from __future__ importengine/build/copy_info_plist.py
Lines 16 to 23 in 8f060b9
engine/build/git_revision.py
Lines 7 to 15 in b7e5940