From 845c7779b802c5994e96279f023663f4295a87ca Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Fri, 28 Feb 2025 12:48:21 -0500 Subject: [PATCH] Align jvmTarget usages across codebase, while editing build.gradle files align them with android version documentation (#164200) Related to #149836 Find all jvmTarget definitions that do not use JavaVersion.* then update them. While editing those files align the usages with docs/contributing/Android-API-And-Related-Versions.md. Documentation source that this pr follows https://github.com/flutter/flutter/pull/164198/files#diff-ee6ec18be8d752e2696c8ccc8bec2f202dfc29a43b3b4f9d8041aa6bc3e852a1 This pr is expected to cause no behavioral changes. This pr makes logical sense after https://github.com/flutter/flutter/pull/164198 but can be landed in any order. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. --- dev/a11y_assessments/android/app/build.gradle | 16 ++++++++-------- .../multiple_flutters/android/app/build.gradle | 16 ++++++++-------- .../spell_check/android/app/build.gradle | 16 ++++++++-------- dev/manual_tests/android/app/build.gradle | 12 ++++++------ dev/tracing_tests/android/app/build.gradle | 16 ++++++++-------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/dev/a11y_assessments/android/app/build.gradle b/dev/a11y_assessments/android/app/build.gradle index d040546cc3..6c20637fdc 100644 --- a/dev/a11y_assessments/android/app/build.gradle +++ b/dev/a11y_assessments/android/app/build.gradle @@ -34,7 +34,7 @@ if (keystorePropertiesFile.exists()) { android { namespace "com.example.a11y_assessments" - compileSdk flutter.compileSdkVersion + compileSdk = flutter.compileSdkVersion // Flutter's CI installs the NDK at a non-standard path. // This non-standard structure is initially created by @@ -46,12 +46,12 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_1_8.toString() } sourceSets { @@ -63,10 +63,10 @@ android { applicationId "dev.flutter.a11yassessments" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutterVersionCode.toInteger() + versionName = flutterVersionName } signingConfigs { release { diff --git a/dev/benchmarks/multiple_flutters/android/app/build.gradle b/dev/benchmarks/multiple_flutters/android/app/build.gradle index b8d2c9b5cd..357dd23196 100644 --- a/dev/benchmarks/multiple_flutters/android/app/build.gradle +++ b/dev/benchmarks/multiple_flutters/android/app/build.gradle @@ -14,7 +14,7 @@ android { } namespace "dev.flutter.multipleflutters" - compileSdk 35 + compileSdk = 35 // Flutter's CI installs the NDK at a non-standard path. // This non-standard structure is initially created by @@ -26,20 +26,20 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = '17' + jvmTarget = JavaVersion.VERSION_17.toString() } defaultConfig { applicationId "dev.flutter.multipleflutters" - minSdkVersion 24 - targetSdkVersion 35 - versionCode 1 - versionName "1.0" + minSdk = 24 + targetSdk = 35 + versionCode = 1 + versionName = "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/dev/integration_tests/spell_check/android/app/build.gradle b/dev/integration_tests/spell_check/android/app/build.gradle index 242e3d7360..ac0ec21913 100644 --- a/dev/integration_tests/spell_check/android/app/build.gradle +++ b/dev/integration_tests/spell_check/android/app/build.gradle @@ -28,7 +28,7 @@ if (flutterVersionName == null) { android { namespace "com.example.spell_check" - compileSdk flutter.compileSdkVersion + compileSdk = flutter.compileSdkVersion // Flutter's CI installs the NDK at a non-standard path. // This non-standard structure is initially created by @@ -40,12 +40,12 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_1_8.toString() } sourceSets { @@ -57,10 +57,10 @@ android { applicationId "com.example.spell_check" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutterVersionCode.toInteger() + versionName = flutterVersionName } buildTypes { diff --git a/dev/manual_tests/android/app/build.gradle b/dev/manual_tests/android/app/build.gradle index 7ae76f585d..126de033bd 100644 --- a/dev/manual_tests/android/app/build.gradle +++ b/dev/manual_tests/android/app/build.gradle @@ -28,7 +28,7 @@ if (flutterVersionName == null) { android { namespace = "dev.flutter.manual_tests" - compileSdk flutter.compileSdkVersion + compileSdk = flutter.compileSdkVersion // Flutter's CI installs the NDK at a non-standard path. // This non-standard structure is initially created by @@ -45,7 +45,7 @@ android { } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_1_8.toString() } sourceSets { @@ -55,10 +55,10 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "dev.flutter.manual_tests" - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutterVersionCode.toInteger() + versionName = flutterVersionName } buildTypes { diff --git a/dev/tracing_tests/android/app/build.gradle b/dev/tracing_tests/android/app/build.gradle index 438f04ee24..b425305aa5 100644 --- a/dev/tracing_tests/android/app/build.gradle +++ b/dev/tracing_tests/android/app/build.gradle @@ -28,7 +28,7 @@ if (flutterVersionName == null) { android { namespace = "com.example.tracing_tests" - compileSdk flutter.compileSdkVersion + compileSdk = flutter.compileSdkVersion // Flutter's CI installs the NDK at a non-standard path. // This non-standard structure is initially created by @@ -40,12 +40,12 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 } kotlinOptions { - jvmTarget = '1.8' + jvmTarget = JavaVersion.VERSION_1_8.toString() } sourceSets { @@ -55,10 +55,10 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.tracing_tests" - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutterVersionCode.toInteger() + versionName = flutterVersionName } buildTypes {