Skip to content

Commit 925b493

Browse files
authored
[MOB-9128] Migrate to Pigeon (#279)
* Init Structure * Migrate Instabug Module * Migrate InstabugLog Module * Migrate BugReporting Module * Migrate BugReporting Callbacks * Migrate Surveys Module * Migrate Surveys Callbacks * Migrate FeatureRequests Module * Migrate CrashReporting Module * Migrate APM Module * Migrate Replies Module * Migrate Replies Callbacks * Migrate `Network Log` Module * Fix iOS Imports * Clean Native Entry Files * Rename Files & Classes * Create ArgsRegistry for iOS * Create Util Directory * Improve iOS Setup * Improve Android Setup * Ignore generated files from analyzer * Add Setters for Host APIs * Add Instabug Unit Tests * Change Android Initialization Logic * Remove Android Unit Tests * Add One Android Unit Test * Run Pigeon on CI * Bump example app iOS version * Remove iOS Unit Tests * Add One iOS Unit Test * Add InstabugLog Unit Tests * Add APM Unit Tests * Add BugReporting Unit Tests * Add CrashReporting Unit Tests * Add FeatureRequests Unit Tests * Add Replies Unit Tests * Add Surveys Unit Tests * Add Trace Unit Tests * Add NetworkData Unit Tests * Add NetworkLogger Unit Tests * Delete `instabug_flutter_test.dart` * Change iOS Initialization Logic * Fix Format Issues * Clean pigeon script * Fix CI Jobs * Format Generated Pigeon Files * Remove TODO comments * Replace Lambdas with Anonymous Classes * Downgrade Pigeon Version to 3.0.4 * Pin Mockito to 5.2.0 * Add .pubignore * Fix `gh_ibg_release` CI Job * Update Changelog * Fix `setValueForStringWithKey` on Android * Fix `setOnDismissCallback` on iOS * Remove Unnecessary try/catch Block * Add `EnumConverter` Extension Method * Format OBJ-C Files w/`clang-format` * Format Java Files w/Android Studio * Edit CI Working Directories * Run Pigeon Script For All API Files
1 parent 01c97eb commit 925b493

File tree

79 files changed

+4109
-5230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+4109
-5230
lines changed

.circleci/config.yml

+29-26
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
- run: bundle exec danger
1616
- run: flutter doctor
1717
- run: flutter packages get
18+
- run: sh ./scripts/pigeon.sh
1819
- run: flutter pub run build_runner build --delete-conflicting-outputs
1920
- run: flutter test --coverage
2021
- run: bash <(curl -s https://codecov.io/bash)
@@ -29,66 +30,66 @@ jobs:
2930
- run: bundle exec danger
3031
- run: flutter doctor
3132
- run: flutter packages get
33+
- run: sh ./scripts/pigeon.sh
3234
- run: flutter pub run build_runner build --delete-conflicting-outputs
3335
- run: flutter test --coverage
3436

3537
test_android:
36-
working_directory: ~/project/example/android
3738
executor:
3839
name: android/android-machine
3940
resource-class: xlarge
4041
tag: 2022.04.1
4142
steps:
42-
- checkout:
43-
path: ~/project
43+
- checkout
4444
- flutter/install_sdk_and_pub:
45-
flutter_version: 2.2.3
46-
app-dir: ..
45+
flutter_version: 3.3.0
46+
- run:
47+
name: Generate Pigeons
48+
command: sh ./scripts/pigeon.sh
4749
- android/start-emulator-and-run-tests:
4850
system-image: system-images;android-30;google_apis;x86
4951
additional-avd-args: -d "Nexus 5"
50-
post-emulator-launch-assemble-command: flutter build apk
52+
post-emulator-launch-assemble-command: cd example && flutter build apk
53+
run-tests-working-directory: example/android
5154
test-command: ./gradlew app:connectedAndroidTest
5255
- android/run-tests:
56+
working-directory: example/android
5357
test-command: ./gradlew test
5458

5559
ios_tests:
5660
macos:
57-
xcode: "13.4.1"
58-
working_directory: ~/project/example
59-
environment:
60-
FL_OUTPUT_DIR: output
61+
xcode: 13.4.1
6162
steps:
62-
- checkout:
63-
path: ~/project
63+
- checkout
64+
- flutter/install_sdk_and_pub:
65+
flutter_version: 3.3.0
66+
- run:
67+
name: Generate Pigeons
68+
command: sh ./scripts/pigeon.sh
6469
- run:
6570
name: Install CocoaPods
6671
command: sudo gem install cocoapods
67-
- run:
68-
name: download flutter SDK
69-
command: if ! test -f "~/flutter_sdk.zip"; then curl -o ~/flutter_sdk.zip https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_2.2.3-stable.zip; fi
70-
- run:
71-
name: unzip flutter SDK
72-
command: unzip ~/flutter_sdk.zip -d ~
73-
- run:
74-
name: export flutter path
75-
command: echo 'export PATH="$PATH:~/flutter/bin"' >> $BASH_ENV
76-
- run: flutter doctor
77-
- run: flutter pub get
7872
- run:
7973
name: Install Pods
80-
command: cd ios && pod install --repo-update
74+
working_directory: example/ios
75+
command: pod install --repo-update
8176
- run:
8277
name: Build and run tests
83-
command: cd ios && xcodebuild -allowProvisioningUpdates -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 13 Pro Max,OS=15.5' test | xcpretty
78+
working_directory: example/ios
79+
command: |
80+
xcodebuild -allowProvisioningUpdates \
81+
-workspace Runner.xcworkspace \
82+
-scheme Runner \
83+
-sdk iphonesimulator \
84+
-destination 'name=iPhone 12 Pro Max' \
85+
test | xcpretty
8486
8587
format_flutter:
8688
docker:
8789
- image: cirrusci/flutter
8890
steps:
8991
- checkout
9092
- run: flutter pub get
91-
- run: flutter pub run build_runner build --delete-conflicting-outputs
9293
- run:
9394
name: Check Format
9495
command: flutter format . --set-exit-if-changed
@@ -99,6 +100,7 @@ jobs:
99100
steps:
100101
- checkout
101102
- run: flutter pub get
103+
- run: sh ./scripts/pigeon.sh
102104
- run: flutter pub run build_runner build --delete-conflicting-outputs
103105
- run:
104106
name: Perform Static Analysis
@@ -110,6 +112,7 @@ jobs:
110112
steps:
111113
- checkout
112114
- run: flutter pub get
115+
- run: sh ./scripts/pigeon.sh
113116
- run:
114117
name: Check Package Score
115118
command: flutter pub run pana --no-warning --exit-code-threshold 0

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Generated files
22
*.mocks.dart
3+
*.g.dart
4+
android/**/generated/
5+
ios/**/Generated/
36

47
# Miscellaneous
58
*.class

.pubignore

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Generated files
2+
*.mocks.dart
3+
4+
# Miscellaneous
5+
*.class
6+
*.log
7+
*.pyc
8+
*.swp
9+
.DS_Store
10+
.atom/
11+
.buildlog/
12+
.history
13+
.svn/
14+
15+
# IntelliJ related
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.idea/
20+
21+
# The .vscode folder contains launch configuration and tasks you configure in
22+
# VS Code which you may wish to be included in version control, so this line
23+
# is commented out by default.
24+
#.vscode/
25+
26+
# Flutter/Dart/Pub related
27+
**/doc/api/
28+
.dart_tool/
29+
.flutter-plugins
30+
.flutter-plugins-dependencies
31+
.packages
32+
.pub-cache/
33+
.pub/
34+
pubspec.lock
35+
build/
36+
coverage/
37+
38+
# Android related
39+
**/android/**/gradle-wrapper.jar
40+
**/android/.gradle
41+
**/android/captures/
42+
android/gradlew
43+
android/gradlew.bat
44+
**/android/local.properties
45+
**/android/**/GeneratedPluginRegistrant.java
46+
47+
# iOS/XCode related
48+
**/ios/**/*.mode1v3
49+
**/ios/**/*.mode2v3
50+
**/ios/**/*.moved-aside
51+
**/ios/**/*.pbxuser
52+
**/ios/**/*.perspectivev3
53+
**/ios/**/*sync/
54+
**/ios/**/.sconsign.dblite
55+
**/ios/**/.tags*
56+
**/ios/**/.vagrant/
57+
**/ios/**/DerivedData/
58+
**/ios/**/Icon?
59+
**/ios/**/Pods/
60+
**/ios/**/.symlinks/
61+
**/ios/**/profile
62+
**/ios/**/xcuserdata
63+
**/ios/.generated/
64+
**/ios/Flutter/App.framework
65+
**/ios/Flutter/Flutter.framework
66+
**/ios/Flutter/Flutter.podspec
67+
**/ios/Flutter/Generated.xcconfig
68+
**/ios/Flutter/app.flx
69+
**/ios/Flutter/app.zip
70+
**/ios/Flutter/flutter_assets/
71+
**/ios/Flutter/flutter_export_environment.sh
72+
**/ios/ServiceDefinitions.json
73+
**/ios/Runner/GeneratedPluginRegistrant.*
74+
75+
# Exceptions to above rules.
76+
!**/ios/**/default.mode1v3
77+
!**/ios/**/default.mode2v3
78+
!**/ios/**/default.pbxuser
79+
!**/ios/**/default.perspectivev3
80+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Unreleased
2+
3+
* Uses pigeon for internal communication between Flutter and the host platform.
4+
15
## 11.3.0 (2022-09-30)
26

37
* Bumps Instabug Android SDK to v11.5.1

analysis_options.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include: package:lint/analysis_options_package.yaml
33
analyzer:
44
exclude:
55
- "example/**"
6+
- "**/*.g.dart"
67

78
linter:
89
rules:

android/build.gradle

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ android {
4242

4343
dependencies {
4444
implementation 'com.instabug.library:instabug:11.5.1'
45-
testImplementation 'junit:junit:4.12'
45+
testImplementation 'junit:junit:4.13.2'
46+
testImplementation "org.mockito:mockito-inline:3.12.1"
4647
}
4748

4849
// add upload_symbols task

0 commit comments

Comments
 (0)