Skip to content

Conversation

@bartekpacia
Copy link
Member

We already have a simple app in this repo that fully uses Gradle Kotlin DSL (see #141541). The next small step is to have at least one plugin that also uses Gradle Kotlin DSL. Let's use integration_test for that, since it's versioned with Flutter SDK.

@github-actions github-actions bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. f: integration_test The flutter/packages/integration_test plugin labels Jan 22, 2024
@bartekpacia
Copy link
Member Author

Currently it only supports AGP v8+ and Gradle v8+. I'll try to get down to v7+ for both. Related #142000

@bartekpacia bartekpacia changed the title Migrate integration_test plugin to Gradl Kotlin DSL Migrate integration_test plugin to Gradle Kotlin DSL Jan 22, 2024
@bartekpacia bartekpacia requested a review from reidbaker January 22, 2024 23:41
Comment on lines -33 to -36
Copy link
Member Author

Choose a reason for hiding this comment

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

PR #142000 will start enforcing Gradle 7, so this checks won't make sense anymore

Copy link
Member

Choose a reason for hiding this comment

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

Heads up that the linked PR actually won't start enforcing anything until a full release later. I'm starting with only "warning" versions, so when it lands we will start warning that anything <7 will soon be unsupported

Copy link
Member Author

@bartekpacia bartekpacia Jan 23, 2024

Choose a reason for hiding this comment

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

ah okay, thanks! So I'll make sure we support older Gradle/AGP as well in this PR

@bartekpacia bartekpacia marked this pull request as ready for review January 22, 2024 23:42
@reidbaker
Copy link
Contributor

reidbaker commented Jan 23, 2024

The last migration was just reverted. Please dont land this pr until we know why the previous one broke the tree.
#142018 (comment)

@goderbauer goderbauer added the platform-android Android applications specifically label Jan 26, 2024
@bartekpacia bartekpacia added the t: gradle "flutter build" and "flutter run" on Android label Jan 26, 2024
@gmackall
Copy link
Member

gmackall commented Feb 8, 2024

The last migration was just reverted. Please dont land this pr until we know why the previous one broke the tree. #142018 (comment)

I see the migration which was reverted was relanded in #142752, but I can't see why it was reverted or what the fix was - can you add any more context @bartekpacia ? Just in case it is relevant here as well

Copy link
Member

@gmackall gmackall left a comment

Choose a reason for hiding this comment

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

LGTM but just holding off on approving till I know why the previous migration was reverted

@bartekpacia
Copy link
Member Author

bartekpacia commented Feb 9, 2024

@gmackall The reason for reverting the original "Add support Gradle Kotlin DSL" PR (#140744) is because a a different PR (#137115) had to be reverted, and it was easiest to do it by also reverting my original "Add support Gradle Kotlin DSL" PR (#140744).

Now the situation is sorted out, and the new "Add support Gradle Kotlin DSL" PR (#142752)has been merged for a few days and tree is still green.

@bartekpacia bartekpacia requested a review from gmackall February 9, 2024 17:22
@gmackall
Copy link
Member

gmackall commented Feb 9, 2024

Got it, thanks!

@bartekpacia bartekpacia added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 9, 2024
@bartekpacia
Copy link
Member Author

I've got a bad feeling that something will break post-submit, haha.

@camsim99 camsim99 added the revert Autorevert PR (with "Reason for revert:" comment) label Feb 12, 2024
@auto-submit
Copy link
Contributor

auto-submit bot commented Feb 12, 2024

Time to revert pull request flutter/flutter/142008 has elapsed.
You need to open the revert manually and process as a regular pull request.

@auto-submit auto-submit bot removed the revert Autorevert PR (with "Reason for revert:" comment) label Feb 12, 2024
camsim99 added a commit to camsim99/flutter that referenced this pull request Feb 12, 2024
auto-submit bot pushed a commit that referenced this pull request Feb 12, 2024
…" (#143329)

This reverts #142008 because it broke the Flutter --> packages roller.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2024
auto-submit bot pushed a commit that referenced this pull request Feb 13, 2024
… versions (#143341)

This is a direct revert of (the revert of (the reland of (the policy pr))): #143132. 

The only change is:
1. to put a conditional all on one line, because the packages repository has a test that uses an old flutter project to make sure nothing regresses. The old project uses an old gradle version, and the old gradle version bundles an old groovy version, and the old groovy version has a bug where lines that start with `&&` don't always work: https://issues.apache.org/jira/browse/GROOVY-7218 (I enjoy that the revert reason ends up providing another strong justification to go forward with the policy). Also thanks to @reidbaker for pointing out this bug.
2. I also made a slight formatting change to the messages that print when out of the support bounds, which I think looks slightly better.

I tested this with on a branch that included a revert of #142008, and was able to recreate the failure and verify that it was resolved by 1).
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 13, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 14, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 14, 2024
Roll Flutter from eb5d0a4 to a628814 (72 revisions)

flutter/flutter@eb5d0a4...a628814

2024-02-13 [email protected] Allow deprecated members from the Dart SDK and Flutter Engine to roll in (flutter/flutter#143347)
2024-02-13 [email protected] [Re-re-land] Enforce a policy on supported Gradle, Java, AGP, and KGP versions (flutter/flutter#143341)
2024-02-13 [email protected] Roll Packages from 0a69259 to 9385bbb (7 revisions) (flutter/flutter#143366)
2024-02-13 [email protected] Fix `InputDecorator`s `suffix` and `prefix` widgets are tappable when hidden (flutter/flutter#143308)
2024-02-13 [email protected] Pass-Through `inputFormatters` in `DropdownMenu` (flutter/flutter#143250)
2024-02-13 [email protected] Fix `insetPadding` parameter nullability for dialogs (flutter/flutter#143305)
2024-02-12 [email protected] Revert "Migrate integration_test plugin to Gradle Kotlin DSL (#142008)" (flutter/flutter#143329)
2024-02-12 [email protected] Badge class doc typo - missing [ (flutter/flutter#143318)
2024-02-12 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Flutter Engine from 1c3ecee77350 to a19077503a0c (8 revisions) (#143322)" (flutter/flutter#143338)
2024-02-12 [email protected] Roll Flutter Engine from 1c3ecee77350 to a19077503a0c (8 revisions) (flutter/flutter#143322)
2024-02-12 [email protected] [web] Move JS interop to extension types (flutter/flutter#143274)
2024-02-12 [email protected] Add documentation for best practices for `StreamBuilder` like `FutureBuilder`  (flutter/flutter#143295)
2024-02-12 [email protected] Roll Flutter Engine from 8806987182a3 to 1c3ecee77350 (1 revision) (flutter/flutter#143315)
2024-02-12 [email protected] Fix dual focus issue in CheckboxListTile, RadioListTile and SwitchListTile (flutter/flutter#143213)
2024-02-12 [email protected] Revert "[Re-land] Enforce a policy on supported Gradle, Java, AGP, and KGP versions" (flutter/flutter#143314)
2024-02-12 [email protected] Update integration_test iOS FTL README script to remove targeted version (flutter/flutter#143248)
2024-02-12 [email protected] Remove unnecessary 'debugLabel: null'. (flutter/flutter#143253)
2024-02-12 [email protected] Introduce `iconAlignment` for the buttons with icon (flutter/flutter#137348)
2024-02-12 [email protected] Roll Packages from 11152d2 to 0a69259 (4 revisions) (flutter/flutter#143306)
2024-02-12 [email protected] Roll Flutter Engine from 4f119619dfa8 to 8806987182a3 (1 revision) (flutter/flutter#143304)
2024-02-12 [email protected] Roll Flutter Engine from b0753c0e25f8 to 4f119619dfa8 (1 revision) (flutter/flutter#143291)
2024-02-11 [email protected] Roll Flutter Engine from 936495d94cc6 to b0753c0e25f8 (1 revision) (flutter/flutter#143282)
2024-02-11 [email protected] Roll Flutter Engine from b06b3e0d75ad to 936495d94cc6 (1 revision) (flutter/flutter#143280)
2024-02-11 [email protected] Roll Flutter Engine from 1478f4e75dd9 to b06b3e0d75ad (1 revision) (flutter/flutter#143275)
2024-02-10 [email protected] Fix text painter longest line resizing logic for `TextWidthBasis.longestLine` (flutter/flutter#143024)
2024-02-10 [email protected] Roll Flutter Engine from e6ceb3504f50 to 1478f4e75dd9 (1 revision) (flutter/flutter#143273)
2024-02-10 [email protected] Move Windows arm64 tests to bringup true (flutter/flutter#143272)
2024-02-10 [email protected] Roll Flutter Engine from 3c5149ccde38 to e6ceb3504f50 (1 revision) (flutter/flutter#143267)
2024-02-10 [email protected] Roll Flutter Engine from c587bd69985f to 3c5149ccde38 (2 revisions) (flutter/flutter#143266)
2024-02-10 [email protected] Roll Flutter Engine from e08b6c899c42 to c587bd69985f (1 revision) (flutter/flutter#143265)
2024-02-10 [email protected] Roll Flutter Engine from 1b8f23bbd099 to e08b6c899c42 (2 revisions) (flutter/flutter#143264)
2024-02-10 [email protected] Roll Flutter Engine from 41daa5b913b9 to 1b8f23bbd099 (2 revisions) (flutter/flutter#143261)
2024-02-10 [email protected] Roll Flutter Engine from f969c52f133a to 41daa5b913b9 (1 revision) (flutter/flutter#143258)
2024-02-10 [email protected] Roll Flutter Engine from 6a3b0216ff5b to f969c52f133a (3 revisions) (flutter/flutter#143256)
2024-02-09 [email protected] Roll Flutter Engine from 8c521eb24171 to 6a3b0216ff5b (4 revisions) (flutter/flutter#143251)
2024-02-09 [email protected] Upgrade leak_tracker. (flutter/flutter#143236)
2024-02-09 [email protected] Fix: performance improvement on golden test comparison (flutter/flutter#142913)
2024-02-09 [email protected] Implementing `switch` expressions in `lib/src/material/` (flutter/flutter#142793)
2024-02-09 [email protected] Add position data to `OnDragEnd` callback (flutter/flutter#140378)
2024-02-09 [email protected] Roll Flutter Engine from 1232d598f7c4 to 8c521eb24171 (2 revisions) (flutter/flutter#143237)
2024-02-09 [email protected] Roll Flutter Engine from 7a5390c6b3bd to 1232d598f7c4 (1 revision) (flutter/flutter#143235)
2024-02-09 [email protected] Set plugin template minimum iOS version to 12.0 (flutter/flutter#143167)
2024-02-09 [email protected] Roll Flutter Engine from 7a241130fcf8 to 7a5390c6b3bd (1 revision) (flutter/flutter#143231)
2024-02-09 [email protected] Migrate integration_test plugin to Gradle Kotlin DSL (flutter/flutter#142008)
2024-02-09 [email protected] Roll Flutter Engine from dcac9863a1fc to 7a241130fcf8 (1 revision) (flutter/flutter#143222)
2024-02-09 [email protected] Roll Flutter Engine from 1508b11bf791 to dcac9863a1fc (1 revision) (flutter/flutter#143220)
...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2024
auto-submit bot pushed a commit that referenced this pull request Oct 2, 2024
Attempt to reland #142008 half a year later.

Benefit: this will be the first plugin in Flutter repo that uses Gradle KTS for Android buildscripts. Once it works fine, we can follow up with migration of more plugins later.

[The previous error message](#142008 (comment)) was:

```
e: /b/s/w/ir/cache/gradle/caches/jars-8/42139b5be0c79e133a7b5c5c5d5bf731/gradle-7.3.1.jar!/com/android/build/gradle/LibraryExtension.class: Class 'com/android/build/gradle/LibraryExtension' was compiled with an incompatible version of Kotlin. The binary version of its bytecode is unknown, expected version is 1.0.3
e: /b/s/w/ir/cache/gradle/caches/jars-8/043c0d54e2c1bb39208ec4477607cdf5/gradle-api-7.3.1.jar!/com/android/build/api/dsl/LibraryVariantDimension.class: Class 'com/android/build/api/dsl/LibraryVariantDimension' was compiled with an incompatible version of Kotlin. The binary version of its bytecode is unknown, expected version is 1.0.3

FAILURE: Build failed with an exception.

* Where:
Build file '/b/s/w/ir/x/w/flutter/packages/integration_test/android/build.gradle.kts' line: 36

* What went wrong:
com.android.build.gradle.LibraryExtension.setNamespace(Ljava/lang/String;)V
```

The `integration_test` plugin now puts `com.android.tools.build:gradle:8.1.0` on its classpath since #153795.

This makes me take an optimistic bet that it won't kill the autoroller now �
auto-submit bot added a commit that referenced this pull request Oct 2, 2024
…56087)

Reverts: #154125
Initiated by: bartekpacia
Reason for reverting: broke postsubmit
Original PR Author: bartekpacia

Reviewed By: {reidbaker, gmackall}

This change reverts the following previous change:
Attempt to reland #142008 half a year later.

Benefit: this will be the first plugin in Flutter repo that uses Gradle KTS for Android buildscripts. Once it works fine, we can follow up with migration of more plugins later.

[The previous error message](#142008 (comment)) was:

```
e: /b/s/w/ir/cache/gradle/caches/jars-8/42139b5be0c79e133a7b5c5c5d5bf731/gradle-7.3.1.jar!/com/android/build/gradle/LibraryExtension.class: Class 'com/android/build/gradle/LibraryExtension' was compiled with an incompatible version of Kotlin. The binary version of its bytecode is unknown, expected version is 1.0.3
e: /b/s/w/ir/cache/gradle/caches/jars-8/043c0d54e2c1bb39208ec4477607cdf5/gradle-api-7.3.1.jar!/com/android/build/api/dsl/LibraryVariantDimension.class: Class 'com/android/build/api/dsl/LibraryVariantDimension' was compiled with an incompatible version of Kotlin. The binary version of its bytecode is unknown, expected version is 1.0.3

FAILURE: Build failed with an exception.

* Where:
Build file '/b/s/w/ir/x/w/flutter/packages/integration_test/android/build.gradle.kts' line: 36

* What went wrong:
com.android.build.gradle.LibraryExtension.setNamespace(Ljava/lang/String;)V
```

The `integration_test` plugin now puts `com.android.tools.build:gradle:8.1.0` on its classpath since #153795.

This makes me take an optimistic bet that it won't kill the autoroller now 🤞
auto-submit bot pushed a commit that referenced this pull request Oct 17, 2024
This PR is yet another attempt (after #154125) to reland #142008.

Benefit: this will be the first plugin in Flutter repo that uses Gradle KTS for Android buildscripts. Once it works fine, we can follow up with migration of more plugins later.

[The previous error message](#142008 (comment)) was:

```
e: /b/s/w/ir/cache/gradle/caches/jars-8/42139b5be0c79e133a7b5c5c5d5bf731/gradle-7.3.1.jar!/com/android/build/gradle/LibraryExtension.class: Class 'com/android/build/gradle/LibraryExtension' was compiled with an incompatible version of Kotlin. The binary version of its bytecode is unknown, expected version is 1.0.3
e: /b/s/w/ir/cache/gradle/caches/jars-8/043c0d54e2c1bb39208ec4477607cdf5/gradle-api-7.3.1.jar!/com/android/build/api/dsl/LibraryVariantDimension.class: Class 'com/android/build/api/dsl/LibraryVariantDimension' was compiled with an incompatible version of Kotlin. The binary version of its bytecode is unknown, expected version is 1.0.3

FAILURE: Build failed with an exception.

* Where:
Build file '/b/s/w/ir/x/w/flutter/packages/integration_test/android/build.gradle.kts' line: 36

* What went wrong:
com.android.build.gradle.LibraryExtension.setNamespace(Ljava/lang/String;)V
```

The `integration_test` plugin now puts `com.android.tools.build:gradle:8.1.0` on its classpath since #153795.

This makes me take an optimistic bet that it won't kill the autoroller now �
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests autosubmit Merge PR when tree becomes green via auto submit App f: integration_test The flutter/packages/integration_test plugin framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically t: gradle "flutter build" and "flutter run" on Android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants