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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,20 @@ task:
use_compute_credits: $CIRRUS_USER_COLLABORATOR == 'true'
name: local_tests
osx_instance:
image: catalina-flutter
image: high-sierra-xcode-9.4.1
Copy link
Member

Choose a reason for hiding this comment

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

are changes to this file intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. This was for debugging purposes.

env:
PATH: $PATH:/usr/local/bin
setup_script:
- pod repo update
- git clone https://github.com/flutter/flutter.git
- git fetch origin master
- flutter doctor
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
- pub global activate flutter_plugin_tools
- brew install clang-format
upgrade_script:
- pod repo update
- git fetch origin master
- flutter channel master
- flutter upgrade
build_script:
- flutter doctor
- ./script/local_tests.sh
4 changes: 4 additions & 0 deletions packages/pigeon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.1.18

* Null safe requires Dart 2.12.

## 0.1.17

* Split out test code generation for Dart into a separate file via the
Expand Down
6 changes: 3 additions & 3 deletions packages/pigeon/lib/dart_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'generator_tools.dart';

/// Options that control how Dart code will be generated.
class DartOptions {
/// Determines if the generated code has null safety annotations (Dart >2.10 required).
/// Determines if the generated code has null safety annotations (Dart >=2.12 required).
bool isNullSafe = false;
}

Expand Down Expand Up @@ -194,7 +194,7 @@ void generateDart(DartOptions opt, Root root, StringSink sink) {
indent.writeln(
'// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import',
);
indent.writeln('// @dart = ${opt.isNullSafe ? '2.10' : '2.8'}');
indent.writeln('// @dart = ${opt.isNullSafe ? '2.12' : '2.8'}');
indent.writeln('import \'dart:async\';');
indent.writeln(
'import \'dart:typed_data\' show Uint8List, Int32List, Int64List, Float64List;',
Expand Down Expand Up @@ -284,7 +284,7 @@ void generateTestDart(
indent.writeln(
'// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import',
);
indent.writeln('// @dart = ${opt.isNullSafe ? '2.10' : '2.8'}');
indent.writeln('// @dart = ${opt.isNullSafe ? '2.12' : '2.8'}');
indent.writeln('import \'dart:async\';');
indent.writeln(
'import \'dart:typed_data\' show Uint8List, Int32List, Int64List, Float64List;',
Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/lib/generator_tools.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'dart:mirrors';
import 'ast.dart';

/// The current version of pigeon.
const String pigeonVersion = '0.1.17';
const String pigeonVersion = '0.1.18';

/// Read all the content from [stdin] to a String.
String readStdin() {
Expand Down
2 changes: 1 addition & 1 deletion packages/pigeon/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pigeon
version: 0.1.17
version: 0.1.18
description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
homepage: https://github.com/flutter/packages/tree/master/packages/pigeon
dependencies:
Expand Down
10 changes: 9 additions & 1 deletion packages/pigeon/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###############################################################################
# run_tests.sh
#
# This runs all the different types of tests for pigeon. It should be run from
# This runs all the different types of tests for pigeon. It should be run from
# the directory that contains the script.
###############################################################################

Expand Down Expand Up @@ -39,10 +39,14 @@ test_pigeon_ios() {
--objc_header_out $temp_dir/pigeon.h \
--objc_source_out $temp_dir/pigeon.m

ls -la $framework_path
find $framework_path -name 'Flutter.h'

xcrun clang \
-arch arm64 \
-isysroot $(xcrun --sdk iphoneos --show-sdk-path) \
-F $framework_path \
-F $framework_path/Flutter.xcframework/ios-armv7_arm64 \
-Werror \
-fobjc-arc \
-c $temp_dir/pigeon.m \
Expand Down Expand Up @@ -87,6 +91,10 @@ test_null_safe_dart() {
--dart_null_safety \
--dart_out $temp_dir/pigeon.dart

which dartanalyzer

dartanalyzer --version

dartanalyzer $temp_dir/pigeon.dart --fatal-infos --fatal-warnings --packages ./e2e_tests/test_objc/.packages --enable-experiment=non-nullable
rm -rf $temp_dir
}
Expand Down