Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for Gradle Kotlin DSL (Kotlin DSL comes as standard in newly created Flutter projects) #306

Merged
merged 6 commits into from
Feb 17, 2025

Conversation

devNamanG
Copy link
Contributor

@devNamanG devNamanG commented Jun 1, 2024

fixes #305
fixes #374

Description

Added support for updating android/build.gradle.kts, android/settings.gradle.kts and android/app/build.gradle.kts files.
Added RegExps, functions to handle Kotlin Gradle DSL files if Groovy Gradle DSL files are not found
We assume that the project does not use a mix of Groovy and Kotlin DSL gradle files.
We check whether the android/build.gradle file exists or not. If it exists, the existing code handles updating the files.
If it does not not exist, we proceed to check whether android/build.gradle.kts file exists.
If it does, we use Kotlin DSL configuration.
If both configuration files are not found, an Exception is thrown.

Type of Change

  • feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • ! -- Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 refactor -- Code refactor
  • ci -- Build configuration change
  • 📝 docs -- Documentation
  • 🗑️ chore -- Chore

@CLAassistant
Copy link

CLAassistant commented Jun 1, 2024

CLA assistant check
All committers have signed the CLA.

@devNamanG devNamanG changed the title Fixes [bug]: FlutterFire CLI is not able to handle projects that use… fix: FlutterFire CLI is not able to handle projects that use… Jun 1, 2024
@devNamanG
Copy link
Contributor Author

Okay so I tried running the code on a project with Kotlin DSL files, and for some reason, it is not updating the those files, even though it does write google-services.json. Can someone check this out as well? The existing plugin code seems to not even call the updated gradleContentUpdates function. It would be really helpful if a maintainer checks this out, thank you!

Copy link

Hello 👋, this PR has been opened for more than 2 months with no activity on it.

If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing!

You have 15 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Sep 30, 2024
@github-actions github-actions bot closed this Oct 15, 2024
@Henry5775
Copy link

Has this been implemented? Still having this issue with my app even with latest dev build.

@github-actions github-actions bot added the Needs Attention OP created or responded to issue and it needs attention. label Nov 9, 2024
@devNamanG
Copy link
Contributor Author

Hey @Henry5775 , no i don't think so, last i checked this was still not working. Then I just abandoned using Kotlin DSL and switched to Groovy DSL instead.

@jasecoulls
Copy link

Has this been implemented? Still having this issue with my app even with latest dev build.

Same here. Wasted so much time trying to find a solution to this.

@russellwheatley russellwheatley changed the title fix: FlutterFire CLI is not able to handle projects that use… fix: FlutterFire CLI is not able to handle projects that use Kotlin DSL for Gradle Jan 6, 2025
@alimaherofficial
Copy link

Is there anything new? we need these modifications!!

@Ehesp
Copy link
Member

Ehesp commented Feb 15, 2025

Let me bring this up internally 👍

@the-best-is-best
Copy link

this not support flutter 3.29
now flutter use kotlin DSL

@russellwheatley russellwheatley changed the title fix: FlutterFire CLI is not able to handle projects that use Kotlin DSL for Gradle feat: support for using Gradle Kotlin DSL Feb 17, 2025
@russellwheatley
Copy link
Member

Tests will probably fail as there's a token required which isn't available for forked PRs, I ran locally and they all passed
Screenshot 2025-02-17 at 17 08 54

@russellwheatley russellwheatley changed the title feat: support for using Gradle Kotlin DSL feat: support for Gradle Kotlin DSL (comes as standard in newly created Flutter projects) Feb 17, 2025
@russellwheatley russellwheatley changed the title feat: support for Gradle Kotlin DSL (comes as standard in newly created Flutter projects) feat: support for Gradle Kotlin DSL (Kotlin DSL comes as standard in newly created Flutter projects) Feb 17, 2025
@russellwheatley russellwheatley merged commit c3625d1 into invertase:main Feb 17, 2025
8 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep open Needs Attention OP created or responded to issue and it needs attention.
Projects
None yet
10 participants