Skip to content

Add support for Gradle Kotlin DSL - #118067

Closed
bartekpacia wants to merge 9 commits into
flutter:masterfrom
bartekpacia:feature/add_support_for_gradle_kotlin_dsl
Closed

bartekpacia wants to merge 9 commits into
flutter:masterfrom
bartekpacia:feature/add_support_for_gradle_kotlin_dsl

Conversation

@bartekpacia

Copy link
Copy Markdown
Member

Fixes #93238.

Gradle Kotlin DSL, at least for me, makes the experience of editing build scripts 10x better. Flutter developers should be able to harness this power :)

With this PR I'm aiming to make it possible to use build.gradle.kts instead of build.gradle, but there's more work to be done:

  • update all documentation on the website to mention build.gradle/build.gradle.kts instead of only build.gradle
  • update flutter tool's error messages to mention build.gradle/build.gradle.kts instead of only build.gradle
  • add more tests for KTS buildscripts

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@flutter-dashboard flutter-dashboard Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 5, 2023
@christopherfujino

Copy link
Copy Markdown
Contributor

@GaryQian could you review this one? I believe you landed a change related to Kotlin DSL?

@christopherfujino

Copy link
Copy Markdown
Contributor

@reidbaker

@reidbaker
reidbaker self-requested a review January 26, 2023 20:53
@reidbaker

Copy link
Copy Markdown
Contributor

I will try to give this a look next week. You are correct there is some additional work that needs to happen for use to bring this feature out at a production ready level and I am not sure when my team will be able to do the rest of the work. Also our testing in this area is not such that I can rely on automated tests alone to trust that this will work.

All that said I agree that many would rather work in kotlin gradle rather than learn groovy and I dont want to discourage this sort of contribution.

In the mean time can you look at https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/features.dart
Right now I am wavering between waiting to let this feature land when we can commit to have the support it deserves and guarding this behind a flag so that it can get incremental progress and some bake time.

@bartekpacia

Copy link
Copy Markdown
Member Author

The feature flag sounds reasonable, though I think that if somebody has build.gradle.kts instead of build.gradle, then they've already willingly opted-in :)

@reidbaker

reidbaker commented Jan 30, 2023 •

Copy link
Copy Markdown
Contributor

Yes that is one way of looking at it. Another, and the one I am using, is an android dev happens to use build.gradle.kts either because of a suggestion they find on the broader internet or because of previous android experience. An explicit opt in with the understanding that kotlin gradle support is experimental/under-development/baking or whatever phrase we decide to use helps align expectations better.

@reidbaker

Copy link
Copy Markdown
Contributor

I am open to coming back to this discussion but for now I think i need to reject this cl. My team does not have the capacity to support adding a new build system. We know that build systems are not where app engineers want to spend their time and do not have the testing setup to ensure that this will keep working.

Additionally at the current time there is partial support for other IDE's. https://docs.gradle.org/current/userguide/kotlin_dsl.html#sec:ide_support

Thank you for the contribution.

@reidbaker reidbaker closed this Feb 9, 2023
@bartekpacia

Copy link
Copy Markdown
Member Author

@reidbaker Sorry for not responding for a prolonged time.

I agree with your comment and am willing to add a feature flag for this.

@reidbaker

Copy link
Copy Markdown
Contributor

#103230 (comment)

@bartekpacia
bartekpacia deleted the feature/add_support_for_gradle_kotlin_dsl branch February 27, 2023 21:16
@bartekpacia bartekpacia mentioned this pull request Dec 29, 2023
8 tasks done
auto-submit Bot pushed a commit that referenced this pull request Jan 12, 2024
This PR resolves #140548. It's based on my work in #118067.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gradle Kotlin DSL support.

3 participants