Android Gradle file templates: make it easier to convert them to Kotlin DSL in the future (#142146)

This PR will make it easier for future Flutter-Android apps/plugins/modules etc. to migrate to Gradle Kotlin DSL.

This PR is similar to #140452 but concerns public Gradle templates instead of Flutter's internal Gradle code. It should be a no-op change.

**before**

![before](https://github.com/flutter/flutter/assets/40357511/5d0cb2bb-a693-43bc-aa10-b8f431e0c68c)

**after**

![after](https://github.com/flutter/flutter/assets/40357511/e4a945a5-866f-42f7-813b-b08b26bb89dc)
This commit is contained in:
Bartek Pacia
2024-02-16 00:42:13 +01:00
committed by GitHub
parent 77c6a86ebf
commit c4b0322d57
16 changed files with 162 additions and 172 deletions

View File

@@ -1,5 +1,5 @@
group '{{androidIdentifier}}'
version '1.0'
group = "{{androidIdentifier}}"
version = "1.0"
buildscript {
repositories {
@@ -8,7 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:{{agpVersion}}'
classpath("com.android.tools.build:gradle:{{agpVersion}}")
}
}
@@ -19,27 +19,27 @@ rootProject.allprojects {
}
}
apply plugin: 'com.android.library'
apply plugin: "com.android.library"
android {
if (project.android.hasProperty("namespace")) {
namespace '{{androidIdentifier}}'
namespace = "{{androidIdentifier}}"
}
compileSdk {{compileSdkVersion}}
compileSdk = {{compileSdkVersion}}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
defaultConfig {
minSdk {{minSdkVersion}}
minSdk = {{minSdkVersion}}
}
dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.0.0'
testImplementation("junit:junit:4.13.2")
testImplementation("org.mockito:mockito-core:5.0.0")
}
testOptions {