firebase / firebase/quickstart-flutter

Suggest Migration to Declarative Plugin DSL in Android Gradle Build

Abierto
#76 0 comentarios 2 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Dart
Estrellas
199
Forks
75
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## Feature Suggestion

### Feature Description

I would like to suggest an update for the Android Gradle build configuration within the Firebase Quickstart Flutter project to utilize Gradle's declarative Plugin DSL, moving away from the legacy imperative apply script method. This suggestion aligns with the best practices recommended by Flutter from version 3.16 onwards and aims to enhance build configuration maintainability and facilitate easier future enhancements.

### Why Is This Change Important?

1. **Adherence to Best Practices**: According to Flutter's [official documentation](https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply), the recommended approach for applying Gradle plugins in Flutter projects is now through the declarative Plugin DSL. Adopting this method would ensure the project remains up-to-date with Flutter's best practices.
2. **Improved Maintainability**: By utilizing the Plugin DSL, the project's Gradle plugin management becomes cleaner and more straightforward, improving the overall maintainability of the build configuration.
3. **Future-Proofing**: Preparing the project for potential future updates that could leverage new Gradle features, possibly including the adoption of Kotlin for Gradle scripts.

### Proposed Changes

The update would involve modifications to the `android/settings.gradle` and `android/app/build.gradle` files to define and apply plugins using the declarative syntax. The key adjustments include:

- Implementing the `pluginManagement` and `plugins {}` blocks in `settings.gradle` for managing plugin versions and applications.
- Eliminating the legacy `buildscript` blocks and replacing imperative `apply plugin:` commands with the declarative `plugins {}` block in `app/build.gradle`.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Lee la documentación de migración de Flutter enlazada y, a continuación, inspecciona android/settings.gradle y android/app/build.gradle para comparar la aplicación actual de plugins heredados con la estructura declarativa propuesta. El trabajo estará terminado cuando los bloques plugin management y plugins sustituyan el uso heredado de buildscript y apply plugin en esos archivos.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
android, flutter
Área
build-system, mobile
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.