Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev/benchmarks/macrobenchmarks/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
2 changes: 2 additions & 0 deletions dev/integration_tests/android_views/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def parse_KV_file(file, separator='=')
end

target 'Runner' do
use_modular_headers!

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
Expand Down
4 changes: 2 additions & 2 deletions dev/integration_tests/android_views/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
4 changes: 2 additions & 2 deletions dev/integration_tests/channels/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@interface Pair : NSObject
@property(atomic, readonly, strong, nullable) NSObject* left;
Expand Down
4 changes: 2 additions & 2 deletions dev/integration_tests/codegen/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
2 changes: 1 addition & 1 deletion dev/integration_tests/external_ui/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "AppDelegate.h"
#import "AppDelegate.h"

@interface AppDelegate ()
@property (atomic) uint64_t textureId;
Expand Down
4 changes: 2 additions & 2 deletions dev/integration_tests/flavors/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
1 change: 1 addition & 0 deletions dev/integration_tests/ios_add2app/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ flutter_application_path = 'flutterapp/'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')

target 'ios_add2app' do
use_modular_headers!
install_all_flutter_pods(flutter_application_path)
end

Expand Down
9 changes: 7 additions & 2 deletions dev/integration_tests/ios_host_app/Host/ViewController.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#import "ViewController.h"
#import <Flutter/Flutter.h>
#import <FlutterPluginRegistrant/GeneratedPluginRegistrant.h>

@import Flutter;
@import FlutterPluginRegistrant;

// Prove plugins can be module-imported from the host app.
@import device_info;
@import google_maps_flutter;

@implementation ViewController

Expand Down
1 change: 1 addition & 0 deletions dev/integration_tests/ios_host_app/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ flutter_application_path = '../hello'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')

target 'Host' do
use_modular_headers!
install_all_flutter_pods flutter_application_path
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import UIKit

// Prove plugins can be module-imported from the host app.
import device_info
import google_maps_flutter

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
Expand Down
1 change: 1 addition & 0 deletions dev/integration_tests/ios_host_app_swift/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ flutter_application_path = '../hello'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')

target 'Host' do
use_modular_headers!
install_all_flutter_pods flutter_application_path
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
2 changes: 2 additions & 0 deletions dev/integration_tests/release_smoke_test/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def parse_KV_file(file, separator='=')
end

target 'Runner' do
use_modular_headers!

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
4 changes: 2 additions & 2 deletions dev/integration_tests/ui/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
4 changes: 2 additions & 2 deletions dev/manual_tests/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
4 changes: 2 additions & 2 deletions examples/catalog/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
2 changes: 2 additions & 0 deletions examples/flutter_gallery/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def parse_KV_file(file,separator='=')
end

target 'Runner' do
use_modular_headers!

# Flutter Pods
pod 'Flutter', :path => ENV['FLUTTER_FRAMEWORK_DIR']

Expand Down
4 changes: 2 additions & 2 deletions examples/flutter_gallery/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
1 change: 1 addition & 0 deletions examples/flutter_view/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ install! 'cocoapods', :disable_input_output_paths => true
target 'Runner' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
use_modular_headers!

# Pods for Runner
pod 'MaterialControls', '~> 1.2.2'
Expand Down
2 changes: 1 addition & 1 deletion examples/flutter_view/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "AppDelegate.h"
#import "AppDelegate.h"
#import <Flutter/Flutter.h>

@implementation AppDelegate
Expand Down
4 changes: 2 additions & 2 deletions examples/hello_world/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
3 changes: 3 additions & 0 deletions examples/hello_world/ios/Runner/GeneratedPluginRegistrant.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@

#import <Flutter/Flutter.h>

NS_ASSUME_NONNULL_BEGIN

@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end

NS_ASSUME_NONNULL_END
#endif /* GeneratedPluginRegistrant_h */
4 changes: 2 additions & 2 deletions examples/image_list/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
4 changes: 2 additions & 2 deletions examples/layers/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
2 changes: 2 additions & 0 deletions examples/platform_view/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ def parse_KV_file(file, separator='=')
end

target 'Runner' do
use_modular_headers!

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
Expand Down
6 changes: 3 additions & 3 deletions examples/platform_view/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#include "PlatformViewController.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"
#import "PlatformViewController.h"

@implementation AppDelegate {
FlutterResult _flutterResult;
Expand Down
4 changes: 2 additions & 2 deletions examples/stocks/ios/Runner/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
10 changes: 9 additions & 1 deletion packages/flutter_tools/lib/src/plugins.dart
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,13 @@ const String _objcPluginRegistryHeaderTemplate = '''//

#import <{{framework}}/{{framework}}.h>

NS_ASSUME_NONNULL_BEGIN

@interface GeneratedPluginRegistrant : NSObject
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
@end

NS_ASSUME_NONNULL_END
#endif /* GeneratedPluginRegistrant_h */
''';

Expand All @@ -466,10 +469,15 @@ const String _objcPluginRegistryImplementationTemplate = '''//
//

#import "GeneratedPluginRegistrant.h"

{{#plugins}}
#if __has_include(<{{name}}/{{class}}.h>)
Copy link
Member Author

@jmagman jmagman Oct 10, 2019

Choose a reason for hiding this comment

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

Swift plugins should not need to add an Objective-C header if they don't need it.

#import <{{name}}/{{class}}.h>
{{/plugins}}
#else
@import {{name}};
#endif

{{/plugins}}
@implementation GeneratedPluginRegistrant

+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "AppDelegate.h"
#import "GeneratedPluginRegistrant.h"

@implementation AppDelegate

Expand Down
2 changes: 2 additions & 0 deletions packages/flutter_tools/templates/cocoapods/Podfile-ios-objc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def parse_KV_file(file, separator='=')
end

target 'Runner' do
use_modular_headers!

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ end

target 'Runner' do
use_frameworks!
use_modular_headers!

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
Expand Down
1 change: 1 addition & 0 deletions packages/flutter_tools/templates/cocoapods/Podfile-macos
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ end

target 'Runner' do
use_frameworks!
use_modular_headers!

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "AppDelegate.h"
#import "AppDelegate.h"

@implementation AppDelegate

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')
use_frameworks!

target 'Runner' do
use_modular_headers!

install_flutter_engine_pod
install_flutter_plugin_pods flutter_application_path
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "AppDelegate.h"
#import "AppDelegate.h"
#import "FlutterPluginRegistrant/GeneratedPluginRegistrant.h"

@implementation AppDelegate
Expand Down