forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that public framework headers can be cleanly imported from out…
…side the engine root. (flutter#4303)
- Loading branch information
1 parent
277bfe6
commit ac16530
Showing
4 changed files
with
117 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
9 changes: 9 additions & 0 deletions
9
shell/platform/darwin/ios/framework/Source/FlutterUmbrellaImport.m
This file contains 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,9 @@ | ||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
// The only point of this file is to ensure that the Flutter framework umbrella header can be | ||
// cleanly imported from an Objective-C translation unit. The target that uses this file copies the | ||
// headers to a path that simulats how users would actually consume the framework outside of the | ||
// engine source root. | ||
#import "Flutter.h" |
This file contains 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,45 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2017 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import argparse | ||
import errno | ||
import os | ||
import shutil | ||
import subprocess | ||
import sys | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser( | ||
description='Removes existing files and installs the specified headers' + | ||
'at the given location.') | ||
|
||
parser.add_argument('--headers', | ||
nargs='+', help='The headers to install at the location.', required=True) | ||
parser.add_argument('--location', type=str, required=True) | ||
|
||
args = parser.parse_args() | ||
|
||
# Remove old headers. | ||
try: | ||
shutil.rmtree(os.path.normpath(args.location)) | ||
except OSError as e: | ||
# Ignore only "not found" errors. | ||
if e.errno != errno.ENOENT: | ||
raise e | ||
|
||
# Create the directory to copy the files to. | ||
if not os.path.isdir(args.location): | ||
os.makedirs(args.location) | ||
|
||
# Copy all files specified in the args. | ||
for header_file in args.headers: | ||
shutil.copyfile(header_file, | ||
os.path.join(args.location, os.path.basename(header_file))) | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |
This file contains 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