Skip to content

Commit 79b53f3

Browse files
[various] Plugin Gradle pre-Kotlin standardization (#11173)
As a precursor to converting plugins to use Kotlin Gradle build files in #11172, this does some final standardization of the Groovy versions: - Uses `"` instead of `'` on more lines. - Uses `(...)` and `=` in places where it's optional, instead of just a space. - Uses `minSdk` instead of `minSdkVersion`. - Standardizes vertical whitespace (not necessary for the conversion, but it's something I cleaned up in that PR). This is being done as a precursor PR because I noticed that the files are mostly right on the cusp of being similar enough for git to think they are renames with changes rather than deletion and addition; some are ending up one way, and some the other. Since renames with changes make blame much more useful, I'd like to make the files more similar so that hopefully almost all of them will end up as renames with changes in that PR. ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent 1e0338b commit 79b53f3

18 files changed

Lines changed: 124 additions & 114 deletions

File tree

packages/camera/camera_android/android/build.gradle

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group = 'io.flutter.plugins.camera'
2-
version = '1.0-SNAPSHOT'
1+
group = "io.flutter.plugins.camera"
2+
version = "1.0-SNAPSHOT"
33
def args = ["-Xlint:deprecation","-Xlint:unchecked"]
44

55
buildscript {
@@ -9,7 +9,7 @@ buildscript {
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:8.13.1'
12+
classpath("com.android.tools.build:gradle:8.13.1")
1313
}
1414
}
1515

@@ -27,21 +27,23 @@ project.getTasks().withType(JavaCompile){
2727
apply plugin: 'com.android.library'
2828

2929
android {
30-
buildFeatures {
30+
buildFeatures {
3131
buildConfig = true
3232
}
3333
namespace = "io.flutter.plugins.camera"
3434
compileSdk = flutter.compileSdkVersion
3535

3636
defaultConfig {
37-
minSdkVersion 24
38-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
37+
minSdk = 24
38+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3939
}
40-
lintOptions {
40+
41+
lint {
4142
checkAllWarnings = true
4243
warningsAsErrors = true
4344
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable'
4445
}
46+
4547
compileOptions {
4648
sourceCompatibility = JavaVersion.VERSION_17
4749
targetCompatibility = JavaVersion.VERSION_17

packages/camera/camera_android_camerax/android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group = 'io.flutter.plugins.camerax'
2-
version = '1.0'
1+
group = "io.flutter.plugins.camerax"
2+
version = "1.0"
33

44
buildscript {
55
ext.kotlin_version = '2.3.0'
@@ -9,8 +9,8 @@ buildscript {
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:8.13.1'
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12+
classpath("com.android.tools.build:gradle:8.13.1")
13+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
1414
}
1515
}
1616

@@ -42,7 +42,7 @@ android {
4242
defaultConfig {
4343
// CameraX APIs require API 23 or later.
4444
minSdk = 23
45-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
45+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
4646
}
4747

4848
testOptions {

packages/espresso/android/build.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group = 'com.example.espresso'
2-
version = '1.0'
1+
group = "com.example.espresso"
2+
version = "1.0"
33

44
buildscript {
55
repositories {
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:8.13.1'
11+
classpath("com.android.tools.build:gradle:8.13.1")
1212
}
1313
}
1414

@@ -26,20 +26,20 @@ android {
2626
compileSdk = flutter.compileSdkVersion
2727

2828
defaultConfig {
29-
minSdkVersion 24
30-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
29+
minSdk = 24
30+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3131
}
3232

3333
compileOptions {
3434
sourceCompatibility = JavaVersion.VERSION_17
3535
targetCompatibility = JavaVersion.VERSION_17
3636
}
3737

38-
lintOptions {
38+
lint {
3939
checkAllWarnings = true
4040
warningsAsErrors = true
4141
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable'
42-
baseline file("lint-baseline.xml")
42+
baseline = file("lint-baseline.xml")
4343
}
4444

4545

@@ -57,10 +57,10 @@ android {
5757
}
5858

5959
dependencies {
60-
implementation 'com.google.guava:guava:33.5.0-android'
61-
implementation 'com.squareup.okhttp3:okhttp:5.3.2'
62-
implementation 'com.google.code.gson:gson:2.13.2'
63-
androidTestImplementation 'org.hamcrest:hamcrest:3.0'
60+
implementation("com.google.guava:guava:33.5.0-android")
61+
implementation("com.squareup.okhttp3:okhttp:5.3.2")
62+
implementation("com.google.code.gson:gson:2.13.2")
63+
androidTestImplementation("org.hamcrest:hamcrest:3.0")
6464

6565
testImplementation("junit:junit:4.13.2")
6666
testImplementation("com.google.truth:truth:1.4.5")

packages/file_selector/file_selector_android/android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group = 'dev.flutter.packages.file_selector_android'
2-
version = '1.0'
1+
group = "dev.flutter.packages.file_selector_android"
2+
version = "1.0"
33

44
buildscript {
55
repositories {
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:8.13.1'
11+
classpath("com.android.tools.build:gradle:8.13.1")
1212
}
1313
}
1414

@@ -31,7 +31,7 @@ android {
3131
}
3232

3333
defaultConfig {
34-
minSdkVersion 24
34+
minSdk = 24
3535
}
3636

3737
dependencies {
@@ -42,7 +42,7 @@ android {
4242
testImplementation("org.robolectric:robolectric:4.16")
4343
}
4444

45-
lintOptions {
45+
lint {
4646
checkAllWarnings = true
4747
warningsAsErrors = true
4848
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable'

packages/flutter_plugin_android_lifecycle/android/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group = 'io.flutter.plugins.flutter_plugin_android_lifecycle'
2-
version = '1.0'
1+
group = "io.flutter.plugins.flutter_plugin_android_lifecycle"
2+
version = "1.0"
33

44
buildscript {
55
repositories {
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:8.13.1'
11+
classpath("com.android.tools.build:gradle:8.13.1")
1212
}
1313
}
1414

@@ -26,17 +26,17 @@ android {
2626
compileSdk = flutter.compileSdkVersion
2727

2828
defaultConfig {
29-
minSdkVersion 24
30-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
31-
consumerProguardFiles 'proguard.txt'
29+
minSdk = 24
30+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
31+
consumerProguardFiles("proguard.txt")
3232
}
3333

3434
compileOptions {
3535
sourceCompatibility = JavaVersion.VERSION_17
3636
targetCompatibility = JavaVersion.VERSION_17
3737
}
3838

39-
lintOptions {
39+
lint {
4040
checkAllWarnings = true
4141
warningsAsErrors = true
4242
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable'

packages/google_maps_flutter/google_maps_flutter_android/android/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group = 'io.flutter.plugins.googlemaps'
2-
version = '1.0-SNAPSHOT'
1+
group = "io.flutter.plugins.googlemaps"
2+
version = "1.0-SNAPSHOT"
33

44
buildscript {
55
repositories {
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:8.13.1'
11+
classpath("com.android.tools.build:gradle:8.13.1")
1212
}
1313
}
1414

@@ -26,10 +26,11 @@ android {
2626
compileSdk = flutter.compileSdkVersion
2727

2828
defaultConfig {
29-
minSdkVersion 24
30-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
29+
minSdk = 24
30+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3131
}
32-
lintOptions {
32+
33+
lint {
3334
checkAllWarnings = true
3435
warningsAsErrors = true
3536
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable'

packages/google_sign_in/google_sign_in_android/android/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group = 'io.flutter.plugins.googlesignin'
2-
version = '1.0-SNAPSHOT'
1+
group = "io.flutter.plugins.googlesignin"
2+
version = "1.0-SNAPSHOT"
33

44
buildscript {
55
ext.kotlin_version = '2.3.0'
@@ -9,8 +9,8 @@ buildscript {
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:8.13.1'
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12+
classpath("com.android.tools.build:gradle:8.13.1")
13+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
1414
}
1515
}
1616

@@ -29,8 +29,8 @@ android {
2929
compileSdk = flutter.compileSdkVersion
3030

3131
defaultConfig {
32-
minSdkVersion 24
33-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
32+
minSdk = 24
33+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3434
}
3535

3636
compileOptions {
@@ -53,7 +53,6 @@ android {
5353
baseline = file("lint-baseline.xml")
5454
}
5555

56-
5756
testOptions {
5857
unitTests.includeAndroidResources = true
5958
unitTests.returnDefaultValues = true

packages/image_picker/image_picker_android/android/build.gradle

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group = 'io.flutter.plugins.imagepicker'
2-
version = '1.0-SNAPSHOT'
1+
group = "io.flutter.plugins.imagepicker"
2+
version = "1.0-SNAPSHOT"
33

44
buildscript {
55
repositories {
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:8.13.1'
11+
classpath("com.android.tools.build:gradle:8.13.1")
1212
}
1313
}
1414

@@ -26,14 +26,16 @@ android {
2626
compileSdk = flutter.compileSdkVersion
2727

2828
defaultConfig {
29-
minSdkVersion 24
30-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
29+
minSdk = 24
30+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3131
}
32-
lintOptions {
32+
33+
lint {
3334
checkAllWarnings = true
3435
warningsAsErrors = true
3536
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable'
3637
}
38+
3739
dependencies {
3840
implementation("androidx.core:core:1.17.0")
3941
implementation("androidx.annotation:annotation:1.9.1")

packages/in_app_purchase/in_app_purchase_android/android/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group = 'io.flutter.plugins.inapppurchase'
2-
version = '1.0-SNAPSHOT'
1+
group = "io.flutter.plugins.inapppurchase"
2+
version = "1.0-SNAPSHOT"
33

44
buildscript {
55
repositories {
@@ -8,7 +8,7 @@ buildscript {
88
}
99

1010
dependencies {
11-
classpath 'com.android.tools.build:gradle:8.13.1'
11+
classpath("com.android.tools.build:gradle:8.13.1")
1212
}
1313
}
1414

@@ -32,19 +32,20 @@ android {
3232

3333
defaultConfig {
3434
minSdk = 21
35-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
35+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3636
}
37-
lintOptions {
37+
38+
lint {
3839
checkAllWarnings = true
3940
warningsAsErrors = true
4041
disable 'AndroidGradlePluginVersion', 'InvalidPackage', 'GradleDependency', 'NewerVersionAvailable'
4142
}
43+
4244
compileOptions {
4345
sourceCompatibility = JavaVersion.VERSION_17
4446
targetCompatibility = JavaVersion.VERSION_17
4547
}
4648

47-
4849
testOptions {
4950
unitTests.includeAndroidResources = true
5051
unitTests.returnDefaultValues = true

packages/interactive_media_ads/android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
group = 'dev.flutter.packages.interactive_media_ads'
2-
version = '1.0-SNAPSHOT'
1+
group = "dev.flutter.packages.interactive_media_ads"
2+
version = "1.0-SNAPSHOT"
33

44
buildscript {
55
ext.kotlin_version = '2.3.0'
@@ -9,8 +9,8 @@ buildscript {
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:8.13.1'
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12+
classpath("com.android.tools.build:gradle:8.13.1")
13+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
1414
}
1515
}
1616

@@ -44,7 +44,7 @@ android {
4444
}
4545

4646
defaultConfig {
47-
minSdkVersion 24
47+
minSdk = 24
4848
}
4949

5050
dependencies {

0 commit comments

Comments
 (0)