From 9d2adcb41c2dbdf8314fda87b6bcd41f6a0a0fe5 Mon Sep 17 00:00:00 2001 From: Matias Pequeno Date: Mon, 5 Jan 2026 12:42:20 -0300 Subject: [PATCH 1/3] Migrate example Gradle config to Flutter plugin DSL --- .github/workflows/ci.yml | 4 +- AGENTS.md | 39 +++++++++++++++++++ .../example/android/app/build.gradle | 13 +++---- rollbar_flutter/example/android/build.gradle | 11 ------ .../example/android/settings.gradle | 29 ++++++++++---- 5 files changed, 67 insertions(+), 29 deletions(-) create mode 100644 AGENTS.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca575026..5e57197d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: name: Flutter version ${{ matrix.flutter_version }} (Android) strategy: matrix: - flutter_version: ["3.29.2"] + flutter_version: ["3.38.5"] steps: - uses: actions/checkout@v4 @@ -87,7 +87,7 @@ jobs: name: Flutter version ${{ matrix.flutter_version }} (iOS) strategy: matrix: - flutter_version: ["3.29.2"] + flutter_version: ["3.38.5"] steps: - uses: actions/checkout@v4 diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..c99c5d46 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,39 @@ +# Repository Guidelines + +This monorepo hosts Rollbar SDKs for Dart and Flutter. Use the package-level READMEs for usage examples, and follow the guidelines below when contributing. + +## Project Structure & Module Organization + +- `rollbar_common/`: shared Dart core (models, serialization, extensions) used by both SDKs; tests live in `rollbar_common/test`. +- `rollbar_dart/`: pure Dart notifier package with examples in `rollbar_dart/example` and tests in `rollbar_dart/test`. +- `rollbar_flutter/`: Flutter plugin and platform integration; Dart sources in `rollbar_flutter/lib`, native code in `rollbar_flutter/android` and `rollbar_flutter/ios`, tests in `rollbar_flutter/test`, and a sample app in `rollbar_flutter/example`. +- `build_tools/`: scripts for linting, tests, builds, and publishing. + +## Build, Test, and Development Commands + +- `./build_tools/check.sh`: runs the standard CI-style pipeline across packages (pub get, `flutter test`, `flutter analyze`, `pana`, Gradle checks, and example builds). +- `./build_tools/build.sh -d rollbar_dart test`: run a single task in one package (tasks include `pub-get`, `test`, `analyze`, `pana`, `gradle-check`, `example-android`, `example-ios`). +- `./build_tools/clean.sh`: `flutter clean` for all packages. +- `cd rollbar_flutter/example && flutter run`: run the Flutter example app locally. + +## Coding Style & Naming Conventions + +- Dart code follows standard formatting (2-space indent) and analyzer rules from `analysis_options.yaml` in each package. +- Lints include `prefer_single_quotes`, `always_declare_return_types`, and `unawaited_futures` (plus `sort_child_properties_last` in `rollbar_dart`). +- Use Dart naming conventions: `UpperCamelCase` for types, `lowerCamelCase` for members, `snake_case` for files. + +## Testing Guidelines + +- Tests are organized under each package’s `test/` directory and run via `flutter test` from that package root. +- Android unit tests live under `rollbar_flutter/android/src/test`. +- Add or update tests for new behavior; there is no explicit coverage gate, but regression tests are expected. + +## Commit & Pull Request Guidelines + +- Commit messages are short and imperative; optional type/scope prefixes are common (e.g., `feat: ...`, `fix(android): ...`, `doc: ...`). +- Before opening a PR, run `./build_tools/check.sh` and note results in the PR description. +- Link relevant issues and describe platform-specific changes (Dart vs. Flutter, Android vs. iOS) clearly. + +## Security & Configuration Tips + +- Never commit real Rollbar access tokens; use placeholders like `YOUR-ROLLBAR-ACCESSTOKEN` in examples and tests. diff --git a/rollbar_flutter/example/android/app/build.gradle b/rollbar_flutter/example/android/app/build.gradle index a1baf606..3b02d5dd 100644 --- a/rollbar_flutter/example/android/app/build.gradle +++ b/rollbar_flutter/example/android/app/build.gradle @@ -1,3 +1,8 @@ +plugins { + id "com.android.application" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +11,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,9 +21,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - android { compileSdkVersion flutter.compileSdkVersion diff --git a/rollbar_flutter/example/android/build.gradle b/rollbar_flutter/example/android/build.gradle index 2eb4306a..bc157bd1 100644 --- a/rollbar_flutter/example/android/build.gradle +++ b/rollbar_flutter/example/android/build.gradle @@ -1,14 +1,3 @@ -buildscript { - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' - } -} - allprojects { repositories { google() diff --git a/rollbar_flutter/example/android/settings.gradle b/rollbar_flutter/example/android/settings.gradle index 44e62bcf..cd3231ed 100644 --- a/rollbar_flutter/example/android/settings.gradle +++ b/rollbar_flutter/example/android/settings.gradle @@ -1,11 +1,24 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.1.2" apply false +} + +include ":app" From fd68585466bf2fd5c11b3da199eb73762c8cbd8f Mon Sep 17 00:00:00 2001 From: Matias Pequeno Date: Mon, 5 Jan 2026 13:07:04 -0300 Subject: [PATCH 2/3] try an older flutter --- .github/workflows/ci.yml | 4 ++-- build_tools/SDK_VERSION | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e57197d..6f38d8a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: name: Flutter version ${{ matrix.flutter_version }} (Android) strategy: matrix: - flutter_version: ["3.38.5"] + flutter_version: ["3.38.4"] steps: - uses: actions/checkout@v4 @@ -87,7 +87,7 @@ jobs: name: Flutter version ${{ matrix.flutter_version }} (iOS) strategy: matrix: - flutter_version: ["3.38.5"] + flutter_version: ["3.38.4"] steps: - uses: actions/checkout@v4 diff --git a/build_tools/SDK_VERSION b/build_tools/SDK_VERSION index f94ed442..bef80db4 100644 --- a/build_tools/SDK_VERSION +++ b/build_tools/SDK_VERSION @@ -1 +1 @@ -3.38.5 +3.38.4 From 28c2bd7454949609415b6ddfa675edb5c7637ab9 Mon Sep 17 00:00:00 2001 From: Matias Pequeno Date: Mon, 5 Jan 2026 13:12:05 -0300 Subject: [PATCH 3/3] backtrack --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f38d8a8..ca575026 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: name: Flutter version ${{ matrix.flutter_version }} (Android) strategy: matrix: - flutter_version: ["3.38.4"] + flutter_version: ["3.29.2"] steps: - uses: actions/checkout@v4 @@ -87,7 +87,7 @@ jobs: name: Flutter version ${{ matrix.flutter_version }} (iOS) strategy: matrix: - flutter_version: ["3.38.4"] + flutter_version: ["3.29.2"] steps: - uses: actions/checkout@v4