|
1 |
| -### Dart |
| 1 | +# Contributing to Sentry Dart & Flutter |
2 | 2 |
|
3 |
| -All you need is the [sentry-dart](https://github.com/getsentry/sentry-dart/tree/main/dart). The `sentry` package doesn't depend on the Flutter SDK. |
| 3 | +Thank you for your interest in contributing to Sentry's Dart and Flutter SDKs! This guide will help |
| 4 | +you get started. |
4 | 5 |
|
5 |
| -### Flutter |
| 6 | +## Prerequisites |
6 | 7 |
|
7 |
| -All you need is the [sentry-flutter](https://github.com/getsentry/sentry-dart/tree/main/flutter) and `sentry-dart` as stated above. |
| 8 | +### Required Tools |
8 | 9 |
|
9 |
| -The SDK currently supports Android, iOS, and Web. We build the example app for these targets on 3 platforms: Windows, macOS, and Linux. |
10 |
| -This is to make sure you'd be able to contribute to this project if you're using any of these operating systems. |
| 10 | +* **Dart SDK** - Required for all packages |
| 11 | +* **Flutter SDK** - Required for `sentry-flutter` and Flutter integrations |
| 12 | +* **[melos](https://melos.invertase.dev/)** - For managing the monorepo |
11 | 13 |
|
12 |
| -We also run CI against the Flutter `stable` and `beta` channels, so you should be able to build it if you're in one of those. |
| 14 | +## Environment Setup |
13 | 15 |
|
14 |
| -The Flutter SDK has our Native SDKs embedded if you wish to learn more about them, they sit at: |
| 16 | +### 1. Install melos |
15 | 17 |
|
16 |
| -[sentry-java](https://github.com/getsentry/sentry-java) for the Android integration. |
17 |
| -[sentry-cocoa](https://github.com/getsentry/sentry-cocoa) for the Apple integration. |
18 |
| -[sentry-native](https://github.com/getsentry/sentry-native) for the Android NDK integration. |
| 18 | +```bash |
| 19 | +dart pub global activate melos |
| 20 | +``` |
19 | 21 |
|
20 |
| -### Dependencies |
| 22 | +### 2. Bootstrap the project |
21 | 23 |
|
22 |
| -* The Dart SDK (if you want to change `sentry-dart`) |
23 |
| -* The Flutter SDK (if you want to change `sentry-dart` or `sentry-flutter`) |
24 |
| -* Android: Android SDK (`sentry-java`) with NDK (`sentry-native`): The example project includes C++. |
25 |
| -* iOS: Cocoa SDK (`sentry-cocoa`), you'll need a Mac with Xcode installed. |
26 |
| -* Web: No additional dependencies. |
| 24 | +At the repository root, run: |
27 | 25 |
|
28 |
| -### Static Code Analysis, Tests, Formatting, Pub Score and Dry publish |
| 26 | +```bash |
| 27 | +melos bootstrap |
| 28 | +``` |
29 | 29 |
|
30 |
| -* Dart/Flutter |
31 |
| - * Execute `./tool/presubmit.sh` within the `dart` and `flutter` folders |
32 |
| -* Swift/CocoaPods |
33 |
| - * Use `swiftlint` and `pod lib lint` |
34 |
| -* Kotlin |
35 |
| - * Use `ktlint` and `detekt` |
| 30 | +If you're using [fvm](https://fvm.app/), specify the SDK path: |
| 31 | + |
| 32 | +```bash |
| 33 | +melos bootstrap --sdk-path=/Users/user/fvm/default/ |
| 34 | +``` |
| 35 | + |
| 36 | +## Project Structure |
| 37 | + |
| 38 | +### Core SDKs |
| 39 | + |
| 40 | +* **[packages/dart](https://github.com/getsentry/sentry-dart/tree/main/packages/dart)** - Core Dart |
| 41 | + SDK (`sentry` package) |
| 42 | +* **[packages/flutter](https://github.com/getsentry/sentry-dart/tree/main/packages/flutter)** - |
| 43 | + Flutter SDK (`sentry_flutter` package) |
| 44 | + |
| 45 | +### Integration Packages |
| 46 | + |
| 47 | +Located under `packages/`, we maintain integrations for popular Dart/Flutter libraries: |
| 48 | + |
| 49 | +* **sentry_dio** - HTTP client integration for [dio](https://pub.dev/packages/dio) |
| 50 | +* **sentry_logging** - Integration for the [logging](https://pub.dev/packages/logging) package |
| 51 | +* **sentry_sqflite** - Integration for [sqflite](https://pub.dev/packages/sqflite) database |
| 52 | +* **sentry_drift** - Integration for [drift](https://pub.dev/packages/drift) database |
| 53 | +* **sentry_hive** - Integration for [hive](https://pub.dev/packages/hive) database |
| 54 | +* **sentry_isar** - Integration for [isar](https://pub.dev/packages/isar) database |
| 55 | +* **sentry_file** - File I/O operations integration |
| 56 | +* **sentry_link** - GraphQL integration via [gql_link](https://pub.dev/packages/gql_link) |
| 57 | +* **sentry_firebase_remote_config** - Integration |
| 58 | + for [firebase_remote_config](https://pub.dev/packages/firebase_remote_config) |
| 59 | + |
| 60 | +## Platform Support |
| 61 | + |
| 62 | +The Flutter SDK supports the following platforms: |
| 63 | + |
| 64 | +* Android |
| 65 | +* iOS |
| 66 | +* macOS |
| 67 | +* Linux |
| 68 | +* Windows |
| 69 | +* Web |
| 70 | + |
| 71 | +We test the example app on Windows, macOS, and Linux to ensure cross-platform compatibility. CI runs |
| 72 | +against Flutter `stable` and `beta` channels. |
| 73 | + |
| 74 | +## Native SDK Dependencies |
| 75 | + |
| 76 | +The Flutter SDK embeds platform-specific native SDKs: |
| 77 | + |
| 78 | +* **Android**: [sentry-java](https://github.com/getsentry/sentry-java) (via |
| 79 | + Gradle) + [sentry-native](https://github.com/getsentry/sentry-native) for NDK |
| 80 | +* **iOS/macOS**: [sentry-cocoa](https://github.com/getsentry/sentry-cocoa) (via CocoaPods/SPM) |
| 81 | +* **Linux/Windows**: [sentry-native](https://github.com/getsentry/sentry-native) (bundled in |
| 82 | + `packages/flutter/sentry-native/`) |
| 83 | +* **Web**: [sentry-javascript](https://github.com/getsentry/sentry-javascript) (loaded via CDN) |
| 84 | + |
| 85 | +[//]: # (TODO: buenaflor - properly set up precommit hooks) |
| 86 | +[//]: # (### Static Code Analysis, Tests, Formatting, Pub Score and Dry publish) |
| 87 | + |
| 88 | +[//]: # () |
| 89 | +[//]: # (* Dart/Flutter) |
| 90 | + |
| 91 | +[//]: # ( * Execute `./tool/presubmit.sh` within the `dart` and `flutter` folders) |
| 92 | + |
| 93 | +[//]: # (* Swift/CocoaPods) |
| 94 | + |
| 95 | +[//]: # ( * Use `swiftlint` and `pod lib lint`) |
| 96 | + |
| 97 | +[//]: # (* Kotlin) |
| 98 | + |
| 99 | +[//]: # ( * Use `ktlint` and `detekt`) |
0 commit comments