Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
eea85bc
Add new APIs, unimplemented and unused
stuartmorgan-g Dec 20, 2022
3fec844
Add Dart implementation
stuartmorgan-g Dec 20, 2022
a0b15bb
Add multiple arity FlutterApi
stuartmorgan-g Dec 20, 2022
e64f12a
Add Dart unit tests for desired output format
stuartmorgan-g Dec 20, 2022
644f5c8
Enable the existing integration test
stuartmorgan-g Dec 20, 2022
7288047
Add units tests for callback format
stuartmorgan-g Dec 21, 2022
e5cf1e5
Adjust unit test expectations for error callback
stuartmorgan-g Dec 21, 2022
cdad496
First-pass implementation; mostly untested
stuartmorgan-g Jan 5, 2023
de9af5e
Comment fix
stuartmorgan-g Jan 10, 2023
3c3a5bb
Add todo
stuartmorgan-g Jan 10, 2023
c60cabd
Minor fixes
stuartmorgan-g Jan 10, 2023
fbbb667
Fix compilation error in Swift from new pigeons
stuartmorgan-g Jan 10, 2023
04d6191
Make new Maps string-keyed to avoid Swift error
stuartmorgan-g Jan 10, 2023
abfba12
Update generation
stuartmorgan-g Jan 10, 2023
b056dd0
Update unit test for change
stuartmorgan-g Jan 10, 2023
8f8ea3d
Update C++ test plugin for API changes
stuartmorgan-g Jan 10, 2023
b4b804c
Fix type regression
stuartmorgan-g Jan 10, 2023
f4eb9f8
missing ;
stuartmorgan-g Jan 10, 2023
5d7ea15
Drop string_view in Flutter API
stuartmorgan-g Jan 10, 2023
a9beb66
Unwind incorrect 'simplification' of custom classes
stuartmorgan-g Jan 11, 2023
3550260
Fix merge mistake
stuartmorgan-g Jan 11, 2023
7b0a960
Merge mistake
stuartmorgan-g Jan 12, 2023
47c2d0f
Version bump
stuartmorgan-g Jan 12, 2023
f742c20
Address review comments
stuartmorgan-g Jan 13, 2023
ff01534
Merge branch 'main' into pigeon-cpp-flutter-api
stuartmorgan-g Jan 13, 2023
8893641
Fix Dart unit test compilation
stuartmorgan-g Jan 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/pigeon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 6.0.1

* [c++] Fixes most non-class arguments and return values in Flutter APIs. The
types of arguments and return values have changed, so this may require updates
to existing code.

## 6.0.0

* Creates StructuredGenerator class and implements it on all platforms.
Expand Down
460 changes: 220 additions & 240 deletions packages/pigeon/lib/cpp_generator.dart

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/pigeon/lib/generator_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'dart:mirrors';
import 'ast.dart';

/// The current version of pigeon. This must match the version in pubspec.yaml.
const String pigeonVersion = '6.0.0';
const String pigeonVersion = '6.0.1';

/// Read all the content from [stdin] to a String.
String readStdin() {
Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/lib/swift_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ import FlutterMacOS
indexMap(func.arguments, _getArgumentName);
final Iterable<String> argNames =
indexMap(func.arguments, _getSafeArgumentName);
sendArgument = '[${argNames.join(', ')}]';
sendArgument = '[${argNames.join(', ')}] as [Any?]';
final String argsSignature = map3(
argTypes,
argLabels,
Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/mock_handler_tester/test/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Autogenerated from Pigeon (v6.0.0), do not edit directly.
// Autogenerated from Pigeon (v6.0.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import

Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/mock_handler_tester/test/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Autogenerated from Pigeon (v6.0.0), do not edit directly.
// Autogenerated from Pigeon (v6.0.1), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, unnecessary_import
// ignore_for_file: avoid_relative_lib_imports
Expand Down
71 changes: 68 additions & 3 deletions packages/pigeon/pigeons/core_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,12 @@ abstract class HostIntegrationCoreApi {
@ObjCSelector('callFlutterEchoString:')
String callFlutterEchoString(String aString);

// TODO(stuartmorgan): Add callFlutterEchoString and the associated test once
// either https://github.com/flutter/flutter/issues/116117 is fixed, or the
// problematic type is moved out of AllTypes and into its own test, since
// TODO(stuartmorgan): Add callFlutterEchoAllTypes and the associated test
// once either https://github.com/flutter/flutter/issues/116117 is fixed, or
// the problematic type is moved out of AllTypes and into its own test, since
// the type mismatch breaks the second `encode` round.

// TODO(stuartmorgan): Fill in the rest of the callFlutterEcho* tests.
}

/// The core interface that the Dart platform_test code implements for host
Expand All @@ -213,9 +215,72 @@ abstract class FlutterIntegrationCoreApi {
@ObjCSelector('echoAllNullableTypes:')
AllNullableTypes echoAllNullableTypes(AllNullableTypes everything);

/// Returns passed in arguments of multiple types.
///
/// Tests multiple-arity FlutterApi handling.
@ObjCSelector('sendMultipleNullableTypesABool:anInt:aString:')
AllNullableTypes sendMultipleNullableTypes(
bool? aNullableBool, int? aNullableInt, String? aNullableString);

// ========== Non-nullable argument/return type tests ==========

/// Returns the passed boolean, to test serialization and deserialization.
@ObjCSelector('echoBool:')
bool echoBool(bool aBool);

/// Returns the passed int, to test serialization and deserialization.
@ObjCSelector('echoInt:')
int echoInt(int anInt);

/// Returns the passed double, to test serialization and deserialization.
@ObjCSelector('echoDouble:')
double echoDouble(double aDouble);

/// Returns the passed string, to test serialization and deserialization.
@ObjCSelector('echoString:')
String echoString(String aString);

/// Returns the passed byte list, to test serialization and deserialization.
@ObjCSelector('echoUint8List:')
Uint8List echoUint8List(Uint8List aList);

/// Returns the passed list, to test serialization and deserialization.
@ObjCSelector('echoList:')
List<Object?> echoList(List<Object?> aList);

/// Returns the passed map, to test serialization and deserialization.
@ObjCSelector('echoMap:')
Map<String?, Object?> echoMap(Map<String?, Object?> aMap);

// ========== Nullable argument/return type tests ==========

/// Returns the passed boolean, to test serialization and deserialization.
@ObjCSelector('echoNullableBool:')
bool? echoNullableBool(bool? aBool);

/// Returns the passed int, to test serialization and deserialization.
@ObjCSelector('echoNullableInt:')
int? echoNullableInt(int? anInt);

/// Returns the passed double, to test serialization and deserialization.
@ObjCSelector('echoNullableDouble:')
double? echoNullableDouble(double? aDouble);

/// Returns the passed string, to test serialization and deserialization.
@ObjCSelector('echoNullableString:')
String? echoNullableString(String? aString);

/// Returns the passed byte list, to test serialization and deserialization.
@ObjCSelector('echoNullableUint8List:')
Uint8List? echoNullableUint8List(Uint8List? aList);

/// Returns the passed list, to test serialization and deserialization.
@ObjCSelector('echoNullableList:')
List<Object?>? echoNullableList(List<Object?>? aList);

/// Returns the passed map, to test serialization and deserialization.
@ObjCSelector('echoNullableMap:')
Map<String?, Object?> echoNullableMap(Map<String?, Object?> aMap);
}

/// An API that can be implemented for minimal, compile-only tests.
Expand Down
Loading