Update Android app project template to apply Kotlin Gradle plugin declaratively (#139006)

This PR updates the app templates generated by `flutter create` to use declarative `plugins {}` syntax for applying the Kotlin Gradle Plugin.

I realized this is missing while writing [#9857.](https://github.com/flutter/website/pull/9857)
This commit is contained in:
Bartek Pacia
2023-11-27 21:50:21 +01:00
committed by GitHub
parent 9147a1c1b8
commit e8282edf4d
4 changed files with 2 additions and 28 deletions

View File

@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '{{kotlinVersion}}'
repositories {
google()
mavenCentral()
}
dependencies {
// AGP version is set in settings.gradle.
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()

View File

@@ -2,5 +2,4 @@ package {{androidIdentifier}}
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
class MainActivity: FlutterActivity()

View File

@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '{{kotlinVersion}}'
repositories {
google()
mavenCentral()
}
dependencies {
// AGP version is set in settings.gradle.
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()

View File

@@ -20,6 +20,7 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "{{agpVersion}}" apply false
id "org.jetbrains.kotlin.android" version "{{kotlinVersion}}" apply false
}
include ":app"