Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 0 additions & 2 deletions .circleci/agp9-smoke/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .circleci/agp9-smoke/.sdkmanrc

This file was deleted.

50 changes: 0 additions & 50 deletions .circleci/agp9-smoke/README.md

This file was deleted.

36 changes: 0 additions & 36 deletions .circleci/agp9-smoke/run.sh

This file was deleted.

30 changes: 0 additions & 30 deletions .circleci/agp9-smoke/settings.gradle

This file was deleted.

36 changes: 27 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -324,26 +324,44 @@ jobs:
./gradlew app:assembleAndroidTest
./gradlew app:assembleDebug -Ptarget=`pwd`/../integration_test/app_test.dart

agp9-smoke-test:
description: "Smoke-test purchases_ui_flutter under AGP 9 (configuration-time only)"
agp9-end-to-end-test:
description: "Build agp9_test_app under Flutter 3.44+ + AGP 9 for both android.builtInKotlin values"
docker:
- image: ghcr.io/cirruslabs/flutter:stable
resource_class: medium
resource_class: large
steps:
- checkout
- revenuecat/install-sdkman
- run:
name: Install JDK 21 and Gradle 9.1 (required by AGP 9)
working_directory: .circleci/agp9-smoke
name: Install JDK 21 (required by AGP 9)
working_directory: e2e-tests/agp9_test_app
command: sdk env install
- run:
name: Print versions
command: |
flutter --version
java -version
gradle --version
- flutter-get-dependencies:
project: e2e-tests/agp9_test_app
- run:
name: Build APK with android.builtInKotlin=false (Flutter migrator default)
working_directory: e2e-tests/agp9_test_app
command: flutter build apk --debug
- run:
name: Run AGP 9 smoke test
command: bash .circleci/agp9-smoke/run.sh
name: Flip fixture to android.builtInKotlin=true
working_directory: e2e-tests/agp9_test_app
when: always
command: |
sed -i 's/^android\.builtInKotlin=false$/android.builtInKotlin=true/' android/gradle.properties
grep '^android\.' android/gradle.properties
- run:
name: Build APK with android.builtInKotlin=true
working_directory: e2e-tests/agp9_test_app
when: always
command: |
flutter clean
rm -rf android/.gradle android/build
flutter build apk --debug

android-integration-test:
description: "Run Android integration tests for flutter"
Expand Down Expand Up @@ -610,7 +628,7 @@ workflows:
- ios-integration-test-spm
- macos-integration-test-spm
- android-integration-test-build
- agp9-smoke-test
- agp9-end-to-end-test
- run-maestro-e2e-tests-ios:
context:
- e2e-tests
Expand Down
45 changes: 45 additions & 0 deletions e2e-tests/agp9_test_app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/
/coverage/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
30 changes: 30 additions & 0 deletions e2e-tests/agp9_test_app/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "559ffa3f75e7402d65a8def9c28389a9b2e6fe42"
channel: "[user-branch]"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
base_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
- platform: android
create_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42
base_revision: 559ffa3f75e7402d65a8def9c28389a9b2e6fe42

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
5 changes: 5 additions & 0 deletions e2e-tests/agp9_test_app/.sdkmanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# JDK 21 is required by AGP 9. Consumed by `sdk env install` in the
# agp9-end-to-end-test CircleCI job. The project root pins JDK 17, used by
# every other job; only this fixture needs JDK 21. Gradle 9.1 is pulled in
# via the Gradle wrapper (see android/gradle/wrapper/gradle-wrapper.properties).
java=21.0.7-librca
44 changes: 44 additions & 0 deletions e2e-tests/agp9_test_app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# agp9_test_app

A minimal Flutter fixture that builds against the local `purchases_flutter` and
`purchases_ui_flutter` packages on **Flutter 3.44+ with AGP 9 and KGP 2.x**.

This is a build-only fixture: it is never run on a device. The point is to
exercise the AGP 9 branch of `purchases_ui_flutter/android/build.gradle`
end-to-end through the Flutter Gradle plugin, which the configuration-only
checks in unit tests cannot do.

## Pins

The Android template generated by `flutter create` on Flutter 3.44 pins:

- AGP `9.0.1`
- KGP `2.3.20`
- Gradle `9.1.0` (via the wrapper)
- `android.builtInKotlin=false`
- `android.newDsl=false`

These are the Flutter 3.44 defaults and are intentionally **not** customized
here — the whole point of this fixture is to verify the plugin works under
the out-of-the-box settings a Flutter 3.44 app would have.

## Running locally

Requires Flutter 3.44+ and JDK 21 on `PATH`:

```bash
cd e2e-tests/agp9_test_app
flutter pub get
flutter build apk --debug
```

To also exercise the AGP 9 default of `android.builtInKotlin=true` (without
duplicating the fixture), flip the flag and rebuild:

```bash
sed -i '' 's/^android.builtInKotlin=false$/android.builtInKotlin=true/' android/gradle.properties
flutter clean && rm -rf android/.gradle android/build
flutter build apk --debug
```

(Drop the `''` after `-i` on Linux.)
28 changes: 28 additions & 0 deletions e2e-tests/agp9_test_app/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
14 changes: 14 additions & 0 deletions e2e-tests/agp9_test_app/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
.cxx/

# Remember to never publicly share your keystore.
# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
Loading