diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index e48f0eec1bc..861b58d6e19 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,7 @@ +## 10.1.0 + +* [objc] Adds macOS support to facilitate code sharing with existing iOS plugins. + ## 10.0.1 * Requires `analyzer 5.13.0` and replaces use of deprecated APIs. diff --git a/packages/pigeon/README.md b/packages/pigeon/README.md index 857ef5c3a7b..525b6262c31 100644 --- a/packages/pigeon/README.md +++ b/packages/pigeon/README.md @@ -6,9 +6,8 @@ host platform type-safe, easier and faster. ## Supported Platforms Currently Pigeon supports generating: -* Kotlin and Java code for Android, -* Swift and Objective-C code for iOS -* Swift code for macOS +* Kotlin and Java code for Android +* Swift and Objective-C code for iOS and macOS * C++ code for Windows ## Runtime Requirements diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index f7b0fc0a9f7..ce2d0655d2b 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -11,7 +11,7 @@ import 'ast.dart'; /// The current version of pigeon. /// /// This must match the version in pubspec.yaml. -const String pigeonVersion = '10.0.1'; +const String pigeonVersion = '10.1.0'; /// Read all the content from [stdin] to a String. String readStdin() { diff --git a/packages/pigeon/lib/objc_generator.dart b/packages/pigeon/lib/objc_generator.dart index f5b18f2eef9..1d6f93a716d 100644 --- a/packages/pigeon/lib/objc_generator.dart +++ b/packages/pigeon/lib/objc_generator.dart @@ -349,7 +349,12 @@ class ObjcSourceGenerator extends StructuredGenerator { void writeFileImports( ObjcOptions generatorOptions, Root root, Indent indent) { indent.writeln('#import "${generatorOptions.headerIncludePath}"'); + indent.newln(); + indent.writeln('#if TARGET_OS_OSX'); + indent.writeln('#import '); + indent.writeln('#else'); indent.writeln('#import '); + indent.writeln('#endif'); indent.newln(); indent.writeln('#if !__has_feature(objc_arc)'); diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/integration_test/test.dart b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/integration_test/test.dart index a3f66ec5912..699d5f2bd9e 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/integration_test/test.dart +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/integration_test/test.dart @@ -12,7 +12,7 @@ TargetGenerator _getTarget() { if (Platform.isAndroid) { return TargetGenerator.java; } - if (Platform.isIOS) { + if (Platform.isIOS || Platform.isMacOS) { return TargetGenerator.objc; } throw UnimplementedError('Unsupported target.'); diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/.gitignore b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/.gitignore new file mode 100644 index 00000000000..746adbb6b9e --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 00000000000..4b81f9b2d20 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Flutter/Flutter-Release.xcconfig b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 00000000000..5caa9d1579e --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Podfile b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Podfile new file mode 100644 index 00000000000..c795730db8e --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcodeproj/project.pbxproj b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 00000000000..7bfbd26eff5 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,791 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 0D7AA04F867B850C58216739 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CF8BB4081B46FB8120727E26 /* Pods_Runner.framework */; }; + 175F934430D0CAB10EA34579 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 682C75DDB5CD4EB8D08360C5 /* Pods_RunnerTests.framework */; }; + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* RunnerTests.swift */; }; + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC10EC2044A3C60003C045; + remoteInfo = Runner; + }; + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* alternate_language_test_plugin_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = alternate_language_test_plugin_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 5EE3C0398E9AC1B8C35AE87D /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 682C75DDB5CD4EB8D08360C5 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 7671709AF50BB50842EA8B2B /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 7B755EC1B70C6DE5D62ECE5B /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + CF8BB4081B46FB8120727E26 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D2B4CC0DCD712A73FC4805C2 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + DAFBE1E70BF8E058B1A22B17 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + EC8E2B4AD109E092CD6B9C41 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 331C80D2294CF70F00263BE5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 175F934430D0CAB10EA34579 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0D7AA04F867B850C58216739 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1EC62CB395CE8E1EC824E078 /* Pods */ = { + isa = PBXGroup; + children = ( + D2B4CC0DCD712A73FC4805C2 /* Pods-Runner.debug.xcconfig */, + 7671709AF50BB50842EA8B2B /* Pods-Runner.release.xcconfig */, + DAFBE1E70BF8E058B1A22B17 /* Pods-Runner.profile.xcconfig */, + 5EE3C0398E9AC1B8C35AE87D /* Pods-RunnerTests.debug.xcconfig */, + EC8E2B4AD109E092CD6B9C41 /* Pods-RunnerTests.release.xcconfig */, + 7B755EC1B70C6DE5D62ECE5B /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 331C80D6294CF71000263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C80D7294CF71000263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 331C80D6294CF71000263BE5 /* RunnerTests */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + 1EC62CB395CE8E1EC824E078 /* Pods */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* alternate_language_test_plugin_example.app */, + 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CF8BB4081B46FB8120727E26 /* Pods_Runner.framework */, + 682C75DDB5CD4EB8D08360C5 /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C80D4294CF70F00263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + D1118CDCC1A944FBF64A562E /* [CP] Check Pods Manifest.lock */, + 331C80D1294CF70F00263BE5 /* Sources */, + 331C80D2294CF70F00263BE5 /* Frameworks */, + 331C80D3294CF70F00263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C80DA294CF71000263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 6922B9504013AEB23F67302D /* [CP] Check Pods Manifest.lock */, + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + 271CA0FEC73C4F272B016320 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* alternate_language_test_plugin_example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1300; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C80D4294CF70F00263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 33CC10EC2044A3C60003C045; + }; + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 331C80D4294CF70F00263BE5 /* RunnerTests */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C80D3294CF70F00263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 271CA0FEC73C4F272B016320 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; + 6922B9504013AEB23F67302D /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + D1118CDCC1A944FBF64A562E /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C80D1294CF70F00263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C80D8294CF71000263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC10EC2044A3C60003C045 /* Runner */; + targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; + }; + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 331C80DB294CF71000263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5EE3C0398E9AC1B8C35AE87D /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.alternateLanguageTestPluginExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/alternate_language_test_plugin_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/alternate_language_test_plugin_example"; + }; + name = Debug; + }; + 331C80DC294CF71000263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EC8E2B4AD109E092CD6B9C41 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.alternateLanguageTestPluginExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/alternate_language_test_plugin_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/alternate_language_test_plugin_example"; + }; + name = Release; + }; + 331C80DD294CF71000263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7B755EC1B70C6DE5D62ECE5B /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.alternateLanguageTestPluginExample.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/alternate_language_test_plugin_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/alternate_language_test_plugin_example"; + }; + name = Profile; + }; + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C80DB294CF71000263BE5 /* Debug */, + 331C80DC294CF71000263BE5 /* Release */, + 331C80DD294CF71000263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000000..18d981003d6 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 00000000000..a485857be2f --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000000..21a3cc14c74 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000000..18d981003d6 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/AppDelegate.swift b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/AppDelegate.swift new file mode 100644 index 00000000000..5cec4c48f62 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +// 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. + +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000000..a2ec33f19f1 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 00000000000..82b6f9d9a33 Binary files /dev/null and b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 00000000000..13b35eba55c Binary files /dev/null and b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 00000000000..0a3f5fa40fb Binary files /dev/null and b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 00000000000..bdb57226d5f Binary files /dev/null and b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 00000000000..f083318e09c Binary files /dev/null and b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 00000000000..326c0e72c9d Binary files /dev/null and b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 00000000000..2f1632cfddf Binary files /dev/null and b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Base.lproj/MainMenu.xib b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 00000000000..80e867a4e06 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/AppInfo.xcconfig b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 00000000000..817eb0e849f --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = alternate_language_test_plugin_example + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.alternateLanguageTestPluginExample + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/Debug.xcconfig b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 00000000000..36b0fd9464f --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/Release.xcconfig b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 00000000000..dff4f49561c --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/Warnings.xcconfig b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 00000000000..42bcbf4780b --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/DebugProfile.entitlements b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 00000000000..dddb8a30c85 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Info.plist b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Info.plist new file mode 100644 index 00000000000..4789daa6a44 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/MainFlutterWindow.swift b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 00000000000..f21908966e9 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,19 @@ +// 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. + +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Release.entitlements b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Release.entitlements new file mode 100644 index 00000000000..852fa1a4728 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/RunnerTests/RunnerTests.swift b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 00000000000..e332af122ac --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,15 @@ +// 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. + +import FlutterMacOS +import Cocoa +import XCTest + +@testable import alternate_language_test_plugin + +class RunnerTests: XCTestCase { + // Currently there are no macOS Objective-C unit tests, since the expectation + // is that the iOS Objective-C unit tests provide sufficient native unit test + // coverage. If macOS-specific issue come up, they can be tested here. +} diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m index 3f2a9669e7e..34c07a7a091 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m @@ -6,7 +6,12 @@ // See also: https://pub.dev/packages/pigeon #import "CoreTests.gen.h" + +#if TARGET_OS_OSX +#import +#else #import +#endif #if !__has_feature(objc_arc) #error File requires ARC to be enabled. diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/.gitignore b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/.gitignore new file mode 100644 index 00000000000..55a15533a3f --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/.gitignore @@ -0,0 +1,5 @@ +# TODO(stuartmorgan): Remove this once more of the files that macOS doesn't +# use have been eliminated via test consolidation. +*.gen.h +*.gen.m +!CoreTests.gen.* diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.h new file mode 100644 index 00000000000..6e1e3393fa7 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.h @@ -0,0 +1,10 @@ +// 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. + +#import + +#import "CoreTests.gen.h" + +@interface AlternateLanguageTestPlugin : NSObject +@end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m new file mode 100644 index 00000000000..276b9a05f4a --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m @@ -0,0 +1,431 @@ +// 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. + +#import "AlternateLanguageTestPlugin.h" + +#import "CoreTests.gen.h" + +@interface AlternateLanguageTestPlugin () +@property(nonatomic) FlutterIntegrationCoreApi *flutterAPI; +@end + +/** + * This plugin handles the native side of the integration tests in example/integration_test/. + */ +@implementation AlternateLanguageTestPlugin ++ (void)registerWithRegistrar:(NSObject *)registrar { + AlternateLanguageTestPlugin *plugin = [[AlternateLanguageTestPlugin alloc] init]; + HostIntegrationCoreApiSetup(registrar.messenger, plugin); + plugin.flutterAPI = + [[FlutterIntegrationCoreApi alloc] initWithBinaryMessenger:registrar.messenger]; +} + +#pragma mark HostIntegrationCoreApi implementation + +- (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error { +} + +- (nullable AllTypes *)echoAllTypes:(AllTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error { + return everything; +} + +- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error { + return everything; +} + +- (nullable id)throwErrorWithError:(FlutterError *_Nullable *_Nonnull)error { + *error = [FlutterError errorWithCode:@"An error" message:nil details:nil]; + return nil; +} + +- (void)throwErrorFromVoidWithError:(FlutterError *_Nullable *_Nonnull)error { + *error = [FlutterError errorWithCode:@"An error" message:nil details:nil]; +} + +- (nullable id)throwFlutterErrorWithError:(FlutterError *_Nullable *_Nonnull)error { + *error = [FlutterError errorWithCode:@"code" message:@"message" details:@"details"]; + return nil; +} + +- (nullable NSNumber *)echoInt:(NSNumber *)anInt error:(FlutterError *_Nullable *_Nonnull)error { + return anInt; +} + +- (nullable NSNumber *)echoDouble:(NSNumber *)aDouble + error:(FlutterError *_Nullable *_Nonnull)error { + return aDouble; +} + +- (nullable NSNumber *)echoBool:(NSNumber *)aBool error:(FlutterError *_Nullable *_Nonnull)error { + return aBool; +} + +- (nullable NSString *)echoString:(NSString *)aString + error:(FlutterError *_Nullable *_Nonnull)error { + return aString; +} + +- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List + error:(FlutterError *_Nullable *_Nonnull)error { + return aUint8List; +} + +- (nullable id)echoObject:(id)anObject error:(FlutterError *_Nullable *_Nonnull)error { + return anObject; +} + +- (nullable NSArray *)echoList:(NSArray *)aList + error:(FlutterError *_Nullable *_Nonnull)error { + return aList; +} + +- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap + error:(FlutterError *_Nullable *_Nonnull)error { + return aMap; +} + +- (nullable NSString *)extractNestedNullableStringFrom:(AllNullableTypesWrapper *)wrapper + error:(FlutterError *_Nullable *_Nonnull)error { + return wrapper.values.aNullableString; +} + +- (nullable AllNullableTypesWrapper *) + createNestedObjectWithNullableString:(nullable NSString *)nullableString + error:(FlutterError *_Nullable *_Nonnull)error { + AllNullableTypes *innerObject = [[AllNullableTypes alloc] init]; + innerObject.aNullableString = nullableString; + return [AllNullableTypesWrapper makeWithValues:innerObject]; +} + +- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull) + error { + AllNullableTypes *someTypes = [[AllNullableTypes alloc] init]; + someTypes.aNullableBool = aNullableBool; + someTypes.aNullableInt = aNullableInt; + someTypes.aNullableString = aNullableString; + return someTypes; +} + +- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt + error:(FlutterError *_Nullable *_Nonnull)error { + return aNullableInt; +} + +- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble + error:(FlutterError *_Nullable *_Nonnull)error { + return aNullableDouble; +} + +- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool + error:(FlutterError *_Nullable *_Nonnull)error { + return aNullableBool; +} + +- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error { + return aNullableString; +} + +- (nullable FlutterStandardTypedData *) + echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List + error:(FlutterError *_Nullable *_Nonnull)error { + return aNullableUint8List; +} + +- (nullable id)echoNullableObject:(nullable id)aNullableObject + error:(FlutterError *_Nullable *_Nonnull)error { + return aNullableObject; +} + +- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList + error:(FlutterError *_Nullable *_Nonnull)error { + return aNullableList; +} + +- (nullable NSDictionary *) + echoNullableMap:(nullable NSDictionary *)aNullableMap + error:(FlutterError *_Nullable *_Nonnull)error { + return aNullableMap; +} + +- (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { + completion(nil); +} + +- (void)throwAsyncErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { + completion(nil, [FlutterError errorWithCode:@"An error" message:nil details:nil]); +} + +- (void)throwAsyncErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { + completion([FlutterError errorWithCode:@"An error" message:nil details:nil]); +} + +- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, + FlutterError *_Nullable))completion { + completion(nil, [FlutterError errorWithCode:@"code" message:@"message" details:@"details"]); +} + +- (void)echoAsyncAllTypes:(AllTypes *)everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { + completion(everything, nil); +} + +- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + completion(everything, nil); +} + +- (void)echoAsyncInt:(NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + completion(anInt, nil); +} + +- (void)echoAsyncDouble:(NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + completion(aDouble, nil); +} + +- (void)echoAsyncBool:(NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + completion(aBool, nil); +} + +- (void)echoAsyncString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + completion(aString, nil); +} + +- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion { + completion(aUint8List, nil); +} + +- (void)echoAsyncObject:(id)anObject + completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { + completion(anObject, nil); +} + +- (void)echoAsyncList:(NSArray *)aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + completion(aList, nil); +} + +- (void)echoAsyncMap:(NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(aMap, nil); +} + +- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + completion(anInt, nil); +} + +- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + completion(aDouble, nil); +} + +- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + completion(aBool, nil); +} + +- (void)echoAsyncNullableString:(nullable NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + completion(aString, nil); +} + +- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion { + completion(aUint8List, nil); +} + +- (void)echoAsyncNullableObject:(nullable id)anObject + completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { + completion(anObject, nil); +} + +- (void)echoAsyncNullableList:(nullable NSArray *)aList + completion: + (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + completion(aList, nil); +} + +- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(aMap, nil); +} + +- (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion { + [self.flutterAPI noopWithCompletion:^(FlutterError *error) { + completion(error); + }]; +} + +- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI throwErrorWithCompletion:^(id value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { + [self.flutterAPI throwErrorFromVoidWithCompletion:^(FlutterError *error) { + completion(error); + }]; +} + +- (void)callFlutterEchoAllTypes:(AllTypes *)everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoAllTypes:everything + completion:^(AllTypes *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI sendMultipleNullableTypesABool:aNullableBool + anInt:aNullableInt + aString:aNullableString + completion:^(AllNullableTypes *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoBool:(NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoBool:aBool + completion:^(NSNumber *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoInt:(NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoInt:anInt + completion:^(NSNumber *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoDouble:(NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoDouble:aDouble + completion:^(NSNumber *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoString:aString + completion:^(NSString *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)aList + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoUint8List:aList + completion:^(FlutterStandardTypedData *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoList:(NSArray *)aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoList:aList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoMap:(NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoMap:aMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableBool:aBool + completion:^(NSNumber *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableInt:anInt + completion:^(NSNumber *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableDouble:aDouble + completion:^(NSNumber *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableString:(nullable NSString *)aString + completion: + (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableString:aString + completion:^(NSString *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)aList + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableUint8List:aList + completion:^(FlutterStandardTypedData *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableList:(nullable NSArray *)aList + completion: + (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableList:aList + completion:^(NSArray *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoNullableMap:aMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +@end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h new file mode 100644 index 00000000000..cbe0a6a80f4 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h @@ -0,0 +1,449 @@ +// 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. +// +// Autogenerated from Pigeon, do not edit directly. +// See also: https://pub.dev/packages/pigeon + +#import + +@protocol FlutterBinaryMessenger; +@protocol FlutterMessageCodec; +@class FlutterError; +@class FlutterStandardTypedData; + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger, AnEnum) { + AnEnumOne = 0, + AnEnumTwo = 1, + AnEnumThree = 2, +}; + +@class AllTypes; +@class AllNullableTypes; +@class AllNullableTypesWrapper; +@class TestMessage; + +@interface AllTypes : NSObject +/// `init` unavailable to enforce nonnull fields, see the `make` class method. +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)makeWithABool:(NSNumber *)aBool + anInt:(NSNumber *)anInt + anInt64:(NSNumber *)anInt64 + aDouble:(NSNumber *)aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + aList:(NSArray *)aList + aMap:(NSDictionary *)aMap + anEnum:(AnEnum)anEnum + aString:(NSString *)aString; +@property(nonatomic, strong) NSNumber *aBool; +@property(nonatomic, strong) NSNumber *anInt; +@property(nonatomic, strong) NSNumber *anInt64; +@property(nonatomic, strong) NSNumber *aDouble; +@property(nonatomic, strong) FlutterStandardTypedData *aByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *a4ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *a8ByteArray; +@property(nonatomic, strong) FlutterStandardTypedData *aFloatArray; +@property(nonatomic, strong) NSArray *aList; +@property(nonatomic, strong) NSDictionary *aMap; +@property(nonatomic, assign) AnEnum anEnum; +@property(nonatomic, copy) NSString *aString; +@end + +@interface AllNullableTypes : NSObject ++ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableList:(nullable NSArray *)aNullableList + aNullableMap:(nullable NSDictionary *)aNullableMap + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(AnEnum)aNullableEnum + aNullableString:(nullable NSString *)aNullableString; +@property(nonatomic, strong, nullable) NSNumber *aNullableBool; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt; +@property(nonatomic, strong, nullable) NSNumber *aNullableInt64; +@property(nonatomic, strong, nullable) NSNumber *aNullableDouble; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; +@property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; +@property(nonatomic, strong, nullable) NSArray *aNullableList; +@property(nonatomic, strong, nullable) NSDictionary *aNullableMap; +@property(nonatomic, strong, nullable) NSArray *> *nullableNestedList; +@property(nonatomic, strong, nullable) + NSDictionary *nullableMapWithAnnotations; +@property(nonatomic, strong, nullable) NSDictionary *nullableMapWithObject; +@property(nonatomic, assign) AnEnum aNullableEnum; +@property(nonatomic, copy, nullable) NSString *aNullableString; +@end + +@interface AllNullableTypesWrapper : NSObject +/// `init` unavailable to enforce nonnull fields, see the `make` class method. +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)makeWithValues:(AllNullableTypes *)values; +@property(nonatomic, strong) AllNullableTypes *values; +@end + +/// A data class containing a List, used in unit tests. +@interface TestMessage : NSObject ++ (instancetype)makeWithTestList:(nullable NSArray *)testList; +@property(nonatomic, strong, nullable) NSArray *testList; +@end + +/// The codec used by HostIntegrationCoreApi. +NSObject *HostIntegrationCoreApiGetCodec(void); + +/// The core interface that each host language plugin must implement in +/// platform_test integration tests. +@protocol HostIntegrationCoreApi +/// A no-op function taking no arguments and returning no value, to sanity +/// test basic calling. +- (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed object, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable AllTypes *)echoAllTypes:(AllTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns an error, to test error handling. +- (nullable id)throwErrorWithError:(FlutterError *_Nullable *_Nonnull)error; +/// Returns an error from a void function, to test error handling. +- (void)throwErrorFromVoidWithError:(FlutterError *_Nullable *_Nonnull)error; +/// Returns a Flutter error, to test error handling. +- (nullable id)throwFlutterErrorWithError:(FlutterError *_Nullable *_Nonnull)error; +/// Returns passed in int. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSNumber *)echoInt:(NSNumber *)anInt error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns passed in double. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSNumber *)echoDouble:(NSNumber *)aDouble + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed in boolean. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSNumber *)echoBool:(NSNumber *)aBool error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed in string. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSString *)echoString:(NSString *)aString + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed in Uint8List. +/// +/// @return `nil` only when `error != nil`. +- (nullable FlutterStandardTypedData *)echoUint8List:(FlutterStandardTypedData *)aUint8List + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed in generic Object. +/// +/// @return `nil` only when `error != nil`. +- (nullable id)echoObject:(id)anObject error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSArray *)echoList:(NSArray *)aList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed object, to test serialization and deserialization. +- (nullable AllNullableTypes *)echoAllNullableTypes:(nullable AllNullableTypes *)everything + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the inner `aString` value from the wrapped object, to test +/// sending of nested objects. +- (nullable NSString *)extractNestedNullableStringFrom:(AllNullableTypesWrapper *)wrapper + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the inner `aString` value from the wrapped object, to test +/// sending of nested objects. +/// +/// @return `nil` only when `error != nil`. +- (nullable AllNullableTypesWrapper *) + createNestedObjectWithNullableString:(nullable NSString *)nullableString + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns passed in arguments of multiple types. +/// +/// @return `nil` only when `error != nil`. +- (nullable AllNullableTypes *)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull) + error; +/// Returns passed in int. +- (nullable NSNumber *)echoNullableInt:(nullable NSNumber *)aNullableInt + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns passed in double. +- (nullable NSNumber *)echoNullableDouble:(nullable NSNumber *)aNullableDouble + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed in boolean. +- (nullable NSNumber *)echoNullableBool:(nullable NSNumber *)aNullableBool + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed in string. +- (nullable NSString *)echoNullableString:(nullable NSString *)aNullableString + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed in Uint8List. +- (nullable FlutterStandardTypedData *) + echoNullableUint8List:(nullable FlutterStandardTypedData *)aNullableUint8List + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed in generic Object. +- (nullable id)echoNullableObject:(nullable id)aNullableObject + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed list, to test serialization and deserialization. +- (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *)echoNullableMap: + (nullable NSDictionary *)aNullableMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// A no-op function taking no arguments and returning no value, to sanity +/// test basic asynchronous calling. +- (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; +/// Returns passed in int asynchronously. +- (void)echoAsyncInt:(NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns passed in double asynchronously. +- (void)echoAsyncDouble:(NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed in boolean asynchronously. +- (void)echoAsyncBool:(NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed string asynchronously. +- (void)echoAsyncString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed in Uint8List asynchronously. +- (void)echoAsyncUint8List:(FlutterStandardTypedData *)aUint8List + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed in generic Object asynchronously. +- (void)echoAsyncObject:(id)anObject + completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization asynchronously. +- (void)echoAsyncList:(NSArray *)aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization asynchronously. +- (void)echoAsyncMap:(NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Responds with an error from an async function returning a value. +- (void)throwAsyncErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +/// Responds with an error from an async void function. +- (void)throwAsyncErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; +/// Responds with a Flutter error from an async function returning a value. +- (void)throwAsyncFlutterErrorWithCompletion:(void (^)(id _Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed object, to test async serialization and deserialization. +- (void)echoAsyncAllTypes:(AllTypes *)everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed object, to test serialization and deserialization. +- (void)echoAsyncNullableAllNullableTypes:(nullable AllNullableTypes *)everything + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; +/// Returns passed in int asynchronously. +- (void)echoAsyncNullableInt:(nullable NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns passed in double asynchronously. +- (void)echoAsyncNullableDouble:(nullable NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed in boolean asynchronously. +- (void)echoAsyncNullableBool:(nullable NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed string asynchronously. +- (void)echoAsyncNullableString:(nullable NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed in Uint8List asynchronously. +- (void)echoAsyncNullableUint8List:(nullable FlutterStandardTypedData *)aUint8List + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed in generic Object asynchronously. +- (void)echoAsyncNullableObject:(nullable id)anObject + completion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization asynchronously. +- (void)echoAsyncNullableList:(nullable NSArray *)aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization asynchronously. +- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterNoopWithCompletion:(void (^)(FlutterError *_Nullable))completion; +- (void)callFlutterThrowErrorWithCompletion:(void (^)(id _Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterThrowErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; +- (void)callFlutterEchoAllTypes:(AllTypes *)everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterSendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoBool:(NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoInt:(NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoDouble:(NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoUint8List:(FlutterStandardTypedData *)aList + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoList:(NSArray *)aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableBool:(nullable NSNumber *)aBool + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableInt:(nullable NSNumber *)anInt + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableDouble:(nullable NSNumber *)aDouble + completion: + (void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableString:(nullable NSString *)aString + completion: + (void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableUint8List:(nullable FlutterStandardTypedData *)aList + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableList:(nullable NSArray *)aList + completion: + (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +@end + +extern void HostIntegrationCoreApiSetup(id binaryMessenger, + NSObject *_Nullable api); + +/// The codec used by FlutterIntegrationCoreApi. +NSObject *FlutterIntegrationCoreApiGetCodec(void); + +/// The core interface that the Dart platform_test code implements for host +/// integration tests to call into. +@interface FlutterIntegrationCoreApi : NSObject +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +/// A no-op function taking no arguments and returning no value, to sanity +/// test basic calling. +- (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion; +/// Responds with an error from an async function returning a value. +- (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion; +/// Responds with an error from an async void function. +- (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; +/// Returns the passed object, to test serialization and deserialization. +- (void)echoAllTypes:(AllTypes *)everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed object, to test serialization and deserialization. +- (void)echoAllNullableTypes:(AllNullableTypes *)everything + completion: + (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion; +/// Returns passed in arguments of multiple types. +/// +/// Tests multiple-arity FlutterApi handling. +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)aNullableBool + anInt:(nullable NSNumber *)aNullableInt + aString:(nullable NSString *)aNullableString + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed boolean, to test serialization and deserialization. +- (void)echoBool:(NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed int, to test serialization and deserialization. +- (void)echoInt:(NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed double, to test serialization and deserialization. +- (void)echoDouble:(NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed string, to test serialization and deserialization. +- (void)echoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed byte list, to test serialization and deserialization. +- (void)echoUint8List:(FlutterStandardTypedData *)aList + completion: + (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoList:(NSArray *)aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoMap:(NSDictionary *)aMap + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed boolean, to test serialization and deserialization. +- (void)echoNullableBool:(nullable NSNumber *)aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed int, to test serialization and deserialization. +- (void)echoNullableInt:(nullable NSNumber *)anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed double, to test serialization and deserialization. +- (void)echoNullableDouble:(nullable NSNumber *)aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed string, to test serialization and deserialization. +- (void)echoNullableString:(nullable NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed byte list, to test serialization and deserialization. +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)aList + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed list, to test serialization and deserialization. +- (void)echoNullableList:(nullable NSArray *)aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableMap:(nullable NSDictionary *)aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// A no-op function taking no arguments and returning no value, to sanity +/// test basic asynchronous calling. +- (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion; +/// Returns the passed in generic Object asynchronously. +- (void)echoAsyncString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +@end + +/// The codec used by HostTrivialApi. +NSObject *HostTrivialApiGetCodec(void); + +/// An API that can be implemented for minimal, compile-only tests. +@protocol HostTrivialApi +- (void)noopWithError:(FlutterError *_Nullable *_Nonnull)error; +@end + +extern void HostTrivialApiSetup(id binaryMessenger, + NSObject *_Nullable api); + +/// The codec used by HostSmallApi. +NSObject *HostSmallApiGetCodec(void); + +/// A simple API implemented in some unit tests. +@protocol HostSmallApi +- (void)echoString:(NSString *)aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion; +- (void)voidVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion; +@end + +extern void HostSmallApiSetup(id binaryMessenger, + NSObject *_Nullable api); + +/// The codec used by FlutterSmallApi. +NSObject *FlutterSmallApiGetCodec(void); + +/// A simple API called in some unit tests. +@interface FlutterSmallApi : NSObject +- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; +- (void)echoWrappedList:(TestMessage *)msg + completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion; +@end + +NS_ASSUME_NONNULL_END diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m new file mode 100644 index 00000000000..34c07a7a091 --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m @@ -0,0 +1,2286 @@ +// 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. +// +// Autogenerated from Pigeon, do not edit directly. +// See also: https://pub.dev/packages/pigeon + +#import "CoreTests.gen.h" + +#if TARGET_OS_OSX +#import +#else +#import +#endif + +#if !__has_feature(objc_arc) +#error File requires ARC to be enabled. +#endif + +static NSArray *wrapResult(id result, FlutterError *error) { + if (error) { + return @[ + error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] + ]; + } + return @[ result ?: [NSNull null] ]; +} +static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { + id result = array[key]; + return (result == [NSNull null]) ? nil : result; +} + +@interface AllTypes () ++ (AllTypes *)fromList:(NSArray *)list; ++ (nullable AllTypes *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@interface AllNullableTypes () ++ (AllNullableTypes *)fromList:(NSArray *)list; ++ (nullable AllNullableTypes *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@interface AllNullableTypesWrapper () ++ (AllNullableTypesWrapper *)fromList:(NSArray *)list; ++ (nullable AllNullableTypesWrapper *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@interface TestMessage () ++ (TestMessage *)fromList:(NSArray *)list; ++ (nullable TestMessage *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@implementation AllTypes ++ (instancetype)makeWithABool:(NSNumber *)aBool + anInt:(NSNumber *)anInt + anInt64:(NSNumber *)anInt64 + aDouble:(NSNumber *)aDouble + aByteArray:(FlutterStandardTypedData *)aByteArray + a4ByteArray:(FlutterStandardTypedData *)a4ByteArray + a8ByteArray:(FlutterStandardTypedData *)a8ByteArray + aFloatArray:(FlutterStandardTypedData *)aFloatArray + aList:(NSArray *)aList + aMap:(NSDictionary *)aMap + anEnum:(AnEnum)anEnum + aString:(NSString *)aString { + AllTypes *pigeonResult = [[AllTypes alloc] init]; + pigeonResult.aBool = aBool; + pigeonResult.anInt = anInt; + pigeonResult.anInt64 = anInt64; + pigeonResult.aDouble = aDouble; + pigeonResult.aByteArray = aByteArray; + pigeonResult.a4ByteArray = a4ByteArray; + pigeonResult.a8ByteArray = a8ByteArray; + pigeonResult.aFloatArray = aFloatArray; + pigeonResult.aList = aList; + pigeonResult.aMap = aMap; + pigeonResult.anEnum = anEnum; + pigeonResult.aString = aString; + return pigeonResult; +} ++ (AllTypes *)fromList:(NSArray *)list { + AllTypes *pigeonResult = [[AllTypes alloc] init]; + pigeonResult.aBool = GetNullableObjectAtIndex(list, 0); + NSAssert(pigeonResult.aBool != nil, @""); + pigeonResult.anInt = GetNullableObjectAtIndex(list, 1); + NSAssert(pigeonResult.anInt != nil, @""); + pigeonResult.anInt64 = GetNullableObjectAtIndex(list, 2); + NSAssert(pigeonResult.anInt64 != nil, @""); + pigeonResult.aDouble = GetNullableObjectAtIndex(list, 3); + NSAssert(pigeonResult.aDouble != nil, @""); + pigeonResult.aByteArray = GetNullableObjectAtIndex(list, 4); + NSAssert(pigeonResult.aByteArray != nil, @""); + pigeonResult.a4ByteArray = GetNullableObjectAtIndex(list, 5); + NSAssert(pigeonResult.a4ByteArray != nil, @""); + pigeonResult.a8ByteArray = GetNullableObjectAtIndex(list, 6); + NSAssert(pigeonResult.a8ByteArray != nil, @""); + pigeonResult.aFloatArray = GetNullableObjectAtIndex(list, 7); + NSAssert(pigeonResult.aFloatArray != nil, @""); + pigeonResult.aList = GetNullableObjectAtIndex(list, 8); + NSAssert(pigeonResult.aList != nil, @""); + pigeonResult.aMap = GetNullableObjectAtIndex(list, 9); + NSAssert(pigeonResult.aMap != nil, @""); + pigeonResult.anEnum = [GetNullableObjectAtIndex(list, 10) integerValue]; + pigeonResult.aString = GetNullableObjectAtIndex(list, 11); + NSAssert(pigeonResult.aString != nil, @""); + return pigeonResult; +} ++ (nullable AllTypes *)nullableFromList:(NSArray *)list { + return (list) ? [AllTypes fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + (self.aBool ?: [NSNull null]), + (self.anInt ?: [NSNull null]), + (self.anInt64 ?: [NSNull null]), + (self.aDouble ?: [NSNull null]), + (self.aByteArray ?: [NSNull null]), + (self.a4ByteArray ?: [NSNull null]), + (self.a8ByteArray ?: [NSNull null]), + (self.aFloatArray ?: [NSNull null]), + (self.aList ?: [NSNull null]), + (self.aMap ?: [NSNull null]), + @(self.anEnum), + (self.aString ?: [NSNull null]), + ]; +} +@end + +@implementation AllNullableTypes ++ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableList:(nullable NSArray *)aNullableList + aNullableMap:(nullable NSDictionary *)aNullableMap + nullableNestedList:(nullable NSArray *> *)nullableNestedList + nullableMapWithAnnotations: + (nullable NSDictionary *)nullableMapWithAnnotations + nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject + aNullableEnum:(AnEnum)aNullableEnum + aNullableString:(nullable NSString *)aNullableString { + AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; + pigeonResult.aNullableBool = aNullableBool; + pigeonResult.aNullableInt = aNullableInt; + pigeonResult.aNullableInt64 = aNullableInt64; + pigeonResult.aNullableDouble = aNullableDouble; + pigeonResult.aNullableByteArray = aNullableByteArray; + pigeonResult.aNullable4ByteArray = aNullable4ByteArray; + pigeonResult.aNullable8ByteArray = aNullable8ByteArray; + pigeonResult.aNullableFloatArray = aNullableFloatArray; + pigeonResult.aNullableList = aNullableList; + pigeonResult.aNullableMap = aNullableMap; + pigeonResult.nullableNestedList = nullableNestedList; + pigeonResult.nullableMapWithAnnotations = nullableMapWithAnnotations; + pigeonResult.nullableMapWithObject = nullableMapWithObject; + pigeonResult.aNullableEnum = aNullableEnum; + pigeonResult.aNullableString = aNullableString; + return pigeonResult; +} ++ (AllNullableTypes *)fromList:(NSArray *)list { + AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; + pigeonResult.aNullableBool = GetNullableObjectAtIndex(list, 0); + pigeonResult.aNullableInt = GetNullableObjectAtIndex(list, 1); + pigeonResult.aNullableInt64 = GetNullableObjectAtIndex(list, 2); + pigeonResult.aNullableDouble = GetNullableObjectAtIndex(list, 3); + pigeonResult.aNullableByteArray = GetNullableObjectAtIndex(list, 4); + pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); + pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); + pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); + pigeonResult.aNullableList = GetNullableObjectAtIndex(list, 8); + pigeonResult.aNullableMap = GetNullableObjectAtIndex(list, 9); + pigeonResult.nullableNestedList = GetNullableObjectAtIndex(list, 10); + pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 11); + pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 12); + pigeonResult.aNullableEnum = [GetNullableObjectAtIndex(list, 13) integerValue]; + pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 14); + return pigeonResult; +} ++ (nullable AllNullableTypes *)nullableFromList:(NSArray *)list { + return (list) ? [AllNullableTypes fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + (self.aNullableBool ?: [NSNull null]), + (self.aNullableInt ?: [NSNull null]), + (self.aNullableInt64 ?: [NSNull null]), + (self.aNullableDouble ?: [NSNull null]), + (self.aNullableByteArray ?: [NSNull null]), + (self.aNullable4ByteArray ?: [NSNull null]), + (self.aNullable8ByteArray ?: [NSNull null]), + (self.aNullableFloatArray ?: [NSNull null]), + (self.aNullableList ?: [NSNull null]), + (self.aNullableMap ?: [NSNull null]), + (self.nullableNestedList ?: [NSNull null]), + (self.nullableMapWithAnnotations ?: [NSNull null]), + (self.nullableMapWithObject ?: [NSNull null]), + @(self.aNullableEnum), + (self.aNullableString ?: [NSNull null]), + ]; +} +@end + +@implementation AllNullableTypesWrapper ++ (instancetype)makeWithValues:(AllNullableTypes *)values { + AllNullableTypesWrapper *pigeonResult = [[AllNullableTypesWrapper alloc] init]; + pigeonResult.values = values; + return pigeonResult; +} ++ (AllNullableTypesWrapper *)fromList:(NSArray *)list { + AllNullableTypesWrapper *pigeonResult = [[AllNullableTypesWrapper alloc] init]; + pigeonResult.values = [AllNullableTypes nullableFromList:(GetNullableObjectAtIndex(list, 0))]; + NSAssert(pigeonResult.values != nil, @""); + return pigeonResult; +} ++ (nullable AllNullableTypesWrapper *)nullableFromList:(NSArray *)list { + return (list) ? [AllNullableTypesWrapper fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + (self.values ? [self.values toList] : [NSNull null]), + ]; +} +@end + +@implementation TestMessage ++ (instancetype)makeWithTestList:(nullable NSArray *)testList { + TestMessage *pigeonResult = [[TestMessage alloc] init]; + pigeonResult.testList = testList; + return pigeonResult; +} ++ (TestMessage *)fromList:(NSArray *)list { + TestMessage *pigeonResult = [[TestMessage alloc] init]; + pigeonResult.testList = GetNullableObjectAtIndex(list, 0); + return pigeonResult; +} ++ (nullable TestMessage *)nullableFromList:(NSArray *)list { + return (list) ? [TestMessage fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + (self.testList ?: [NSNull null]), + ]; +} +@end + +@interface HostIntegrationCoreApiCodecReader : FlutterStandardReader +@end +@implementation HostIntegrationCoreApiCodecReader +- (nullable id)readValueOfType:(UInt8)type { + switch (type) { + case 128: + return [AllNullableTypes fromList:[self readValue]]; + case 129: + return [AllNullableTypesWrapper fromList:[self readValue]]; + case 130: + return [AllTypes fromList:[self readValue]]; + case 131: + return [TestMessage fromList:[self readValue]]; + default: + return [super readValueOfType:type]; + } +} +@end + +@interface HostIntegrationCoreApiCodecWriter : FlutterStandardWriter +@end +@implementation HostIntegrationCoreApiCodecWriter +- (void)writeValue:(id)value { + if ([value isKindOfClass:[AllNullableTypes class]]) { + [self writeByte:128]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[AllNullableTypesWrapper class]]) { + [self writeByte:129]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[AllTypes class]]) { + [self writeByte:130]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[TestMessage class]]) { + [self writeByte:131]; + [self writeValue:[value toList]]; + } else { + [super writeValue:value]; + } +} +@end + +@interface HostIntegrationCoreApiCodecReaderWriter : FlutterStandardReaderWriter +@end +@implementation HostIntegrationCoreApiCodecReaderWriter +- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { + return [[HostIntegrationCoreApiCodecWriter alloc] initWithData:data]; +} +- (FlutterStandardReader *)readerWithData:(NSData *)data { + return [[HostIntegrationCoreApiCodecReader alloc] initWithData:data]; +} +@end + +NSObject *HostIntegrationCoreApiGetCodec(void) { + static FlutterStandardMessageCodec *sSharedObject = nil; + static dispatch_once_t sPred = 0; + dispatch_once(&sPred, ^{ + HostIntegrationCoreApiCodecReaderWriter *readerWriter = + [[HostIntegrationCoreApiCodecReaderWriter alloc] init]; + sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; + }); + return sSharedObject; +} + +void HostIntegrationCoreApiSetup(id binaryMessenger, + NSObject *api) { + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic calling. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.noop" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(noopWithError:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopWithError:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + FlutterError *error; + [api noopWithError:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed object, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoAllTypes:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAllTypes:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + AllTypes *output = [api echoAllTypes:arg_everything error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns an error, to test error handling. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwError" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(throwErrorWithError:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(throwErrorWithError:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + FlutterError *error; + id output = [api throwErrorWithError:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns an error from a void function, to test error handling. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwErrorFromVoid" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(throwErrorFromVoidWithError:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwErrorFromVoidWithError:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + FlutterError *error; + [api throwErrorFromVoidWithError:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns a Flutter error, to test error handling. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwFlutterError" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(throwFlutterErrorWithError:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwFlutterErrorWithError:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + FlutterError *error; + id output = [api throwFlutterErrorWithError:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns passed in int. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoInt" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoInt:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoInt:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoInt:arg_anInt error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns passed in double. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoDouble:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoDouble:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoDouble:arg_aDouble error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in boolean. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoBool" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoBool:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoBool:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoBool:arg_aBool error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in string. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoString" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoString:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSString *output = [api echoString:arg_aString error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in Uint8List. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoUint8List:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoUint8List:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + FlutterStandardTypedData *output = [api echoUint8List:arg_aUint8List error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in generic Object. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoObject" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoObject:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoObject:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + id arg_anObject = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + id output = [api echoObject:arg_anObject error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed list, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoList" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoList:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoList:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_aList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoList:arg_aList error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoMap" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoMap:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoMap:arg_aMap error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed object, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAllNullableTypes:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAllNullableTypes:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + AllNullableTypes *output = [api echoAllNullableTypes:arg_everything error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the inner `aString` value from the wrapped object, to test + /// sending of nested objects. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(extractNestedNullableStringFrom:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(extractNestedNullableStringFrom:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + AllNullableTypesWrapper *arg_wrapper = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSString *output = [api extractNestedNullableStringFrom:arg_wrapper error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the inner `aString` value from the wrapped object, to test + /// sending of nested objects. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(createNestedObjectWithNullableString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(createNestedObjectWithNullableString:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_nullableString = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + AllNullableTypesWrapper *output = + [api createNestedObjectWithNullableString:arg_nullableString error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns passed in arguments of multiple types. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(sendMultipleNullableTypesABool: + anInt:aString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(sendMultipleNullableTypesABool:anInt:aString:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); + FlutterError *error; + AllNullableTypes *output = [api sendMultipleNullableTypesABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns passed in int. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoNullableInt:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableInt:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoNullableInt:arg_aNullableInt error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns passed in double. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoNullableDouble:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableDouble:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aNullableDouble = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoNullableDouble:arg_aNullableDouble error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in boolean. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoNullableBool:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableBool:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api echoNullableBool:arg_aNullableBool error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in string. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoNullableString:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableString:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSString *output = [api echoNullableString:arg_aNullableString error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in Uint8List. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoNullableUint8List:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableUint8List:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FlutterStandardTypedData *arg_aNullableUint8List = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + FlutterStandardTypedData *output = [api echoNullableUint8List:arg_aNullableUint8List + error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in generic Object. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoNullableObject:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableObject:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + id arg_aNullableObject = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + id output = [api echoNullableObject:arg_aNullableObject error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed list, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableList" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoNullableList:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableList:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_aNullableList = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSArray *output = [api echoNullableList:arg_aNullableList error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableMap" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoNullableMap:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoNullableMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_aNullableMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableMap:arg_aNullableMap error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// A no-op function taking no arguments and returning no value, to sanity + /// test basic asynchronous calling. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(noopAsyncWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(noopAsyncWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api noopAsyncWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns passed in int asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncInt" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoAsyncInt:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncInt:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); + [api echoAsyncInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns passed in double asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncDouble" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncDouble:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncDouble:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); + [api echoAsyncDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in boolean asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncBool" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncBool:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncBool:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); + [api echoAsyncBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed string asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api echoAsyncString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in Uint8List asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncUint8List" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncUint8List:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncUint8List:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); + [api echoAsyncUint8List:arg_aUint8List + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in generic Object asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncObject" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncObject:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncObject:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + id arg_anObject = GetNullableObjectAtIndex(args, 0); + [api echoAsyncObject:arg_anObject + completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed list, to test serialization and deserialization asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncList" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncList:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_aList = GetNullableObjectAtIndex(args, 0); + [api echoAsyncList:arg_aList + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncMap" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoAsyncMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoAsyncMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Responds with an error from an async function returning a value. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncError" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncErrorWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api throwAsyncErrorWithCompletion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Responds with an error from an async void function. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncErrorFromVoid" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(throwAsyncErrorFromVoidWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncErrorFromVoidWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api throwAsyncErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Responds with a Flutter error from an async function returning a value. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.throwAsyncFlutterError" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(throwAsyncFlutterErrorWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(throwAsyncFlutterErrorWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api throwAsyncFlutterErrorWithCompletion:^(id _Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed object, to test async serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncAllTypes" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncAllTypes:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncAllTypes:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api echoAsyncAllTypes:arg_everything + completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed object, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + @"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableAllNullableTypes" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableAllNullableTypes:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableAllNullableTypes:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + AllNullableTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableAllNullableTypes:arg_everything + completion:^(AllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns passed in int asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableInt" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableInt:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableInt:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns passed in double asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableDouble" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableDouble:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableDouble:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in boolean asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableBool" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableBool:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableBool:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed string asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableString" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in Uint8List asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableUint8List" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableUint8List:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableUint8List:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FlutterStandardTypedData *arg_aUint8List = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableUint8List:arg_aUint8List + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed in generic Object asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableObject" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableObject:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableObject:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + id arg_anObject = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableObject:arg_anObject + completion:^(id _Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed list, to test serialization and deserialization asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableList" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableList:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_aList = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableList:arg_aList + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization asynchronously. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncNullableMap" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterNoopWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterNoopWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api callFlutterNoopWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowError" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterThrowErrorWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api callFlutterThrowErrorWithCompletion:^(id _Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterThrowErrorFromVoid" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterThrowErrorFromVoidWithCompletion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterThrowErrorFromVoidWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api callFlutterThrowErrorFromVoidWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoAllTypes:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoAllTypes:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + AllTypes *arg_everything = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoAllTypes:arg_everything + completion:^(AllTypes *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + @"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterSendMultipleNullableTypes" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector + (callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterSendMultipleNullableTypesABool:anInt:aString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aNullableBool = GetNullableObjectAtIndex(args, 0); + NSNumber *arg_aNullableInt = GetNullableObjectAtIndex(args, 1); + NSString *arg_aNullableString = GetNullableObjectAtIndex(args, 2); + [api callFlutterSendMultipleNullableTypesABool:arg_aNullableBool + anInt:arg_aNullableInt + aString:arg_aNullableString + completion:^(AllNullableTypes *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoBool:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoBool:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoBool:arg_aBool + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoInt:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoInt:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoInt:arg_anInt + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoDouble:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoDouble:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoUint8List:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoUint8List:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FlutterStandardTypedData *arg_aList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoUint8List:arg_aList + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoList:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_aList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoList:arg_aList + completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableBool:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableBool:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aBool = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableBool:arg_aBool + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableInt:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableInt:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_anInt = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableInt:arg_anInt + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableDouble" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableDouble:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableDouble:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSNumber *arg_aDouble = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableDouble:arg_aDouble + completion:^(NSNumber *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableString" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableString:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableString:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableString:arg_aString + completion:^(NSString *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + @"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableUint8List" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableUint8List:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableUint8List:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FlutterStandardTypedData *arg_aList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableUint8List:arg_aList + completion:^(FlutterStandardTypedData *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableList:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableList:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSArray *arg_aList = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableList:arg_aList + completion:^(NSArray *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap" + binaryMessenger:binaryMessenger + codec:HostIntegrationCoreApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableMap:arg_aMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } +} +@interface FlutterIntegrationCoreApiCodecReader : FlutterStandardReader +@end +@implementation FlutterIntegrationCoreApiCodecReader +- (nullable id)readValueOfType:(UInt8)type { + switch (type) { + case 128: + return [AllNullableTypes fromList:[self readValue]]; + case 129: + return [AllNullableTypesWrapper fromList:[self readValue]]; + case 130: + return [AllTypes fromList:[self readValue]]; + case 131: + return [TestMessage fromList:[self readValue]]; + default: + return [super readValueOfType:type]; + } +} +@end + +@interface FlutterIntegrationCoreApiCodecWriter : FlutterStandardWriter +@end +@implementation FlutterIntegrationCoreApiCodecWriter +- (void)writeValue:(id)value { + if ([value isKindOfClass:[AllNullableTypes class]]) { + [self writeByte:128]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[AllNullableTypesWrapper class]]) { + [self writeByte:129]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[AllTypes class]]) { + [self writeByte:130]; + [self writeValue:[value toList]]; + } else if ([value isKindOfClass:[TestMessage class]]) { + [self writeByte:131]; + [self writeValue:[value toList]]; + } else { + [super writeValue:value]; + } +} +@end + +@interface FlutterIntegrationCoreApiCodecReaderWriter : FlutterStandardReaderWriter +@end +@implementation FlutterIntegrationCoreApiCodecReaderWriter +- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { + return [[FlutterIntegrationCoreApiCodecWriter alloc] initWithData:data]; +} +- (FlutterStandardReader *)readerWithData:(NSData *)data { + return [[FlutterIntegrationCoreApiCodecReader alloc] initWithData:data]; +} +@end + +NSObject *FlutterIntegrationCoreApiGetCodec(void) { + static FlutterStandardMessageCodec *sSharedObject = nil; + static dispatch_once_t sPred = 0; + dispatch_once(&sPred, ^{ + FlutterIntegrationCoreApiCodecReaderWriter *readerWriter = + [[FlutterIntegrationCoreApiCodecReaderWriter alloc] init]; + sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; + }); + return sSharedObject; +} + +@interface FlutterIntegrationCoreApi () +@property(nonatomic, strong) NSObject *binaryMessenger; +@end + +@implementation FlutterIntegrationCoreApi + +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { + self = [super init]; + if (self) { + _binaryMessenger = binaryMessenger; + } + return self; +} +- (void)noopWithCompletion:(void (^)(FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.noop" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil + reply:^(id reply) { + completion(nil); + }]; +} +- (void)throwErrorWithCompletion:(void (^)(id _Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.throwError" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil + reply:^(id reply) { + id output = reply; + completion(output, nil); + }]; +} +- (void)throwErrorFromVoidWithCompletion:(void (^)(FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.throwErrorFromVoid" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil + reply:^(id reply) { + completion(nil); + }]; +} +- (void)echoAllTypes:(AllTypes *)arg_everything + completion:(void (^)(AllTypes *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(id reply) { + AllTypes *output = reply; + completion(output, nil); + }]; +} +- (void)echoAllNullableTypes:(AllNullableTypes *)arg_everything + completion: + (void (^)(AllNullableTypes *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_everything ?: [NSNull null] ] + reply:^(id reply) { + AllNullableTypes *output = reply; + completion(output, nil); + }]; +} +- (void)sendMultipleNullableTypesABool:(nullable NSNumber *)arg_aNullableBool + anInt:(nullable NSNumber *)arg_aNullableInt + aString:(nullable NSString *)arg_aNullableString + completion:(void (^)(AllNullableTypes *_Nullable, + FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName: + @"dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ + arg_aNullableBool ?: [NSNull null], arg_aNullableInt ?: [NSNull null], + arg_aNullableString ?: [NSNull null] + ] + reply:^(id reply) { + AllNullableTypes *output = reply; + completion(output, nil); + }]; +} +- (void)echoBool:(NSNumber *)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; +} +- (void)echoInt:(NSNumber *)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; +} +- (void)echoDouble:(NSNumber *)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; +} +- (void)echoString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(id reply) { + NSString *output = reply; + completion(output, nil); + }]; +} +- (void)echoUint8List:(FlutterStandardTypedData *)arg_aList + completion: + (void (^)(FlutterStandardTypedData *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aList ?: [NSNull null] ] + reply:^(id reply) { + FlutterStandardTypedData *output = reply; + completion(output, nil); + }]; +} +- (void)echoList:(NSArray *)arg_aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aList ?: [NSNull null] ] + reply:^(id reply) { + NSArray *output = reply; + completion(output, nil); + }]; +} +- (void)echoMap:(NSDictionary *)arg_aMap + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoMap" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + reply:^(id reply) { + NSDictionary *output = reply; + completion(output, nil); + }]; +} +- (void)echoNullableBool:(nullable NSNumber *)arg_aBool + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aBool ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; +} +- (void)echoNullableInt:(nullable NSNumber *)arg_anInt + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_anInt ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; +} +- (void)echoNullableDouble:(nullable NSNumber *)arg_aDouble + completion:(void (^)(NSNumber *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aDouble ?: [NSNull null] ] + reply:^(id reply) { + NSNumber *output = reply; + completion(output, nil); + }]; +} +- (void)echoNullableString:(nullable NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(id reply) { + NSString *output = reply; + completion(output, nil); + }]; +} +- (void)echoNullableUint8List:(nullable FlutterStandardTypedData *)arg_aList + completion:(void (^)(FlutterStandardTypedData *_Nullable, + FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aList ?: [NSNull null] ] + reply:^(id reply) { + FlutterStandardTypedData *output = reply; + completion(output, nil); + }]; +} +- (void)echoNullableList:(nullable NSArray *)arg_aList + completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aList ?: [NSNull null] ] + reply:^(id reply) { + NSArray *output = reply; + completion(output, nil); + }]; +} +- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + reply:^(id reply) { + NSDictionary *output = reply; + completion(output, nil); + }]; +} +- (void)noopAsyncWithCompletion:(void (^)(FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.noopAsync" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:nil + reply:^(id reply) { + completion(nil); + }]; +} +- (void)echoAsyncString:(NSString *)arg_aString + completion:(void (^)(NSString *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAsyncString" + binaryMessenger:self.binaryMessenger + codec:FlutterIntegrationCoreApiGetCodec()]; + [channel sendMessage:@[ arg_aString ?: [NSNull null] ] + reply:^(id reply) { + NSString *output = reply; + completion(output, nil); + }]; +} +@end + +NSObject *HostTrivialApiGetCodec(void) { + static FlutterStandardMessageCodec *sSharedObject = nil; + sSharedObject = [FlutterStandardMessageCodec sharedInstance]; + return sSharedObject; +} + +void HostTrivialApiSetup(id binaryMessenger, + NSObject *api) { + { + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.HostTrivialApi.noop" + binaryMessenger:binaryMessenger + codec:HostTrivialApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(noopWithError:)], + @"HostTrivialApi api (%@) doesn't respond to @selector(noopWithError:)", api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + FlutterError *error; + [api noopWithError:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } +} +NSObject *HostSmallApiGetCodec(void) { + static FlutterStandardMessageCodec *sSharedObject = nil; + sSharedObject = [FlutterStandardMessageCodec sharedInstance]; + return sSharedObject; +} + +void HostSmallApiSetup(id binaryMessenger, NSObject *api) { + { + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.HostSmallApi.echo" + binaryMessenger:binaryMessenger + codec:HostSmallApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoString:completion:)], + @"HostSmallApi api (%@) doesn't respond to @selector(echoString:completion:)", api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_aString = GetNullableObjectAtIndex(args, 0); + [api echoString:arg_aString + completion:^(NSString *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] initWithName:@"dev.flutter.pigeon.HostSmallApi.voidVoid" + binaryMessenger:binaryMessenger + codec:HostSmallApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(voidVoidWithCompletion:)], + @"HostSmallApi api (%@) doesn't respond to @selector(voidVoidWithCompletion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + [api voidVoidWithCompletion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } +} +@interface FlutterSmallApiCodecReader : FlutterStandardReader +@end +@implementation FlutterSmallApiCodecReader +- (nullable id)readValueOfType:(UInt8)type { + switch (type) { + case 128: + return [TestMessage fromList:[self readValue]]; + default: + return [super readValueOfType:type]; + } +} +@end + +@interface FlutterSmallApiCodecWriter : FlutterStandardWriter +@end +@implementation FlutterSmallApiCodecWriter +- (void)writeValue:(id)value { + if ([value isKindOfClass:[TestMessage class]]) { + [self writeByte:128]; + [self writeValue:[value toList]]; + } else { + [super writeValue:value]; + } +} +@end + +@interface FlutterSmallApiCodecReaderWriter : FlutterStandardReaderWriter +@end +@implementation FlutterSmallApiCodecReaderWriter +- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { + return [[FlutterSmallApiCodecWriter alloc] initWithData:data]; +} +- (FlutterStandardReader *)readerWithData:(NSData *)data { + return [[FlutterSmallApiCodecReader alloc] initWithData:data]; +} +@end + +NSObject *FlutterSmallApiGetCodec(void) { + static FlutterStandardMessageCodec *sSharedObject = nil; + static dispatch_once_t sPred = 0; + dispatch_once(&sPred, ^{ + FlutterSmallApiCodecReaderWriter *readerWriter = + [[FlutterSmallApiCodecReaderWriter alloc] init]; + sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; + }); + return sSharedObject; +} + +@interface FlutterSmallApi () +@property(nonatomic, strong) NSObject *binaryMessenger; +@end + +@implementation FlutterSmallApi + +- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { + self = [super init]; + if (self) { + _binaryMessenger = binaryMessenger; + } + return self; +} +- (void)echoWrappedList:(TestMessage *)arg_msg + completion:(void (^)(TestMessage *_Nullable, FlutterError *_Nullable))completion { + FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel + messageChannelWithName:@"dev.flutter.pigeon.FlutterSmallApi.echoWrappedList" + binaryMessenger:self.binaryMessenger + codec:FlutterSmallApiGetCodec()]; + [channel sendMessage:@[ arg_msg ?: [NSNull null] ] + reply:^(id reply) { + TestMessage *output = reply; + completion(output, nil); + }]; +} +@end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/alternate_language_test_plugin.podspec b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/alternate_language_test_plugin.podspec new file mode 100644 index 00000000000..d9ce18f4dab --- /dev/null +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/alternate_language_test_plugin.podspec @@ -0,0 +1,23 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint alternate_language_test_plugin.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'alternate_language_test_plugin' + s.version = '0.0.1' + s.summary = 'Alternate-language Pigeon test plugin' + s.description = <<-DESC +A plugin to test Pigeon generation for secondary languages (e.g., Java, Objective-C). + DESC + s.homepage = 'http://example.com' + s.license = { :type => 'BSD', :file => '../../../LICENSE' } + s.author = { 'Your Company' => 'email@example.com' } + + s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/pigeon' } + s.source_files = 'Classes/**/*' + s.dependency 'FlutterMacOS' + + s.platform = :osx, '10.14' + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } + s.swift_version = '5.0' +end diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml b/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml index 13fdbe82479..736a39f4f14 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/pubspec.yaml @@ -15,6 +15,8 @@ flutter: pluginClass: AlternateLanguageTestPlugin ios: pluginClass: AlternateLanguageTestPlugin + macos: + pluginClass: AlternateLanguageTestPlugin dependencies: flutter: diff --git a/packages/pigeon/platform_tests/test_plugin/macos/test_plugin.podspec b/packages/pigeon/platform_tests/test_plugin/macos/test_plugin.podspec index cd01c8ac24c..77a7e3bbfbd 100644 --- a/packages/pigeon/platform_tests/test_plugin/macos/test_plugin.podspec +++ b/packages/pigeon/platform_tests/test_plugin/macos/test_plugin.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.source_files = 'Classes/**/*' s.dependency 'FlutterMacOS' - s.platform = :osx, '10.11' + s.platform = :osx, '10.14' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.swift_version = '5.0' end diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index a4284b0b498..3c4e0776eae 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -2,7 +2,7 @@ name: pigeon description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. repository: https://github.com/flutter/packages/tree/main/packages/pigeon issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apigeon -version: 10.0.1 # This must match the version in lib/generator_tools.dart +version: 10.1.0 # This must match the version in lib/generator_tools.dart environment: sdk: ">=2.19.0 <4.0.0" diff --git a/packages/pigeon/tool/run_tests.dart b/packages/pigeon/tool/run_tests.dart index 6cc96f2b206..b68117fb950 100644 --- a/packages/pigeon/tool/run_tests.dart +++ b/packages/pigeon/tool/run_tests.dart @@ -121,13 +121,14 @@ Future main(List args) async { ]; const List macOSHostTests = [ iOSObjCUnitTests, - iOSObjCIntegrationTests, // Currently these are testing exactly the same thing as - // macOSSwiftIntegrationTests, so we don't need to run both by default. This + // macOS*IntegrationTests, so we don't need to run both by default. This // should be enabled if any iOS-only tests are added (e.g., for a feature // not supported by macOS). + // iOSObjCIntegrationTests, // iOSSwiftIntegrationTests, iOSSwiftUnitTests, + macOSObjCIntegrationTests, macOSSwiftUnitTests, macOSSwiftIntegrationTests, ]; diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index c2f04378061..7d1b5c9d5a8 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -137,6 +137,23 @@ Future generatePigeons({required String baseDir}) async { if (generateCode != 0) { return generateCode; } + + // macOS has to be run as a separate generation, since currently Pigeon + // doesn't have a way to output separate macOS and iOS Swift output in a + // single invocation. + generateCode = await runPigeon( + input: './pigeons/$input.dart', + objcHeaderOut: skipLanguages.contains(GeneratorLanguages.objc) + ? null + : '$alternateOutputBase/macos/Classes/$pascalCaseName.gen.h', + objcSourceOut: skipLanguages.contains(GeneratorLanguages.objc) + ? null + : '$alternateOutputBase/macos/Classes/$pascalCaseName.gen.m', + suppressVersion: true, + ); + if (generateCode != 0) { + return generateCode; + } } return 0; } diff --git a/packages/pigeon/tool/shared/test_suites.dart b/packages/pigeon/tool/shared/test_suites.dart index cfbdae0cda4..338e4a9b691 100644 --- a/packages/pigeon/tool/shared/test_suites.dart +++ b/packages/pigeon/tool/shared/test_suites.dart @@ -43,6 +43,7 @@ const String iOSObjCUnitTests = 'ios_objc_unittests'; const String iOSObjCIntegrationTests = 'ios_objc_integration_tests'; const String iOSSwiftUnitTests = 'ios_swift_unittests'; const String iOSSwiftIntegrationTests = 'ios_swift_integration_tests'; +const String macOSObjCIntegrationTests = 'macos_objc_integration_tests'; const String macOSSwiftUnitTests = 'macos_swift_unittests'; const String macOSSwiftIntegrationTests = 'macos_swift_integration_tests'; const String windowsUnitTests = 'windows_unittests'; @@ -91,6 +92,9 @@ const Map testSuites = { iOSSwiftIntegrationTests: TestInfo( function: _runIOSSwiftIntegrationTests, description: 'Integration tests on generated Swift code.'), + macOSObjCIntegrationTests: TestInfo( + function: _runMacOSObjCIntegrationTests, + description: 'Integration tests on generated Objective-C code on macOS.'), macOSSwiftUnitTests: TestInfo( function: _runMacOSSwiftUnitTests, description: 'Unit tests on generated Swift code on macOS.'), @@ -279,6 +283,16 @@ Future _runIOSObjCIntegrationTests() async { ); } +Future _runMacOSObjCIntegrationTests() async { + const String examplePath = + './$_alternateLanguageTestPluginRelativePath/example'; + return runFlutterCommand( + examplePath, + 'test', + [_integrationTestFileRelativePath, '-d', 'macos'], + ); +} + Future _runMacOSSwiftUnitTests() async { const String examplePath = './$_testPluginRelativePath/example'; final int compileCode = await runFlutterBuild(examplePath, 'macos'); diff --git a/packages/pigeon/tool/test.dart b/packages/pigeon/tool/test.dart index dd1efcca773..9e31363a979 100644 --- a/packages/pigeon/tool/test.dart +++ b/packages/pigeon/tool/test.dart @@ -74,6 +74,7 @@ ${parser.usage}'''); iOSSwiftIntegrationTests, ]; const List macOSTests = [ + macOSObjCIntegrationTests, macOSSwiftUnitTests, macOSSwiftIntegrationTests ];