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.
This commit is contained in:
Reid Baker 2025-02-28 12:48:21 -05:00 committed by GitHub
parent 787adc75ed
commit 845c7779b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 38 additions and 38 deletions

View File

@ -34,7 +34,7 @@ if (keystorePropertiesFile.exists()) {
android { android {
namespace "com.example.a11y_assessments" namespace "com.example.a11y_assessments"
compileSdk flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
// Flutter's CI installs the NDK at a non-standard path. // Flutter's CI installs the NDK at a non-standard path.
// This non-standard structure is initially created by // This non-standard structure is initially created by
@ -46,12 +46,12 @@ android {
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
} }
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = JavaVersion.VERSION_1_8.toString()
} }
sourceSets { sourceSets {
@ -63,10 +63,10 @@ android {
applicationId "dev.flutter.a11yassessments" applicationId "dev.flutter.a11yassessments"
// You can update the following values to match your application needs. // 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. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion flutter.minSdkVersion minSdk = flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion targetSdk = flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode = flutterVersionCode.toInteger()
versionName flutterVersionName versionName = flutterVersionName
} }
signingConfigs { signingConfigs {
release { release {

View File

@ -14,7 +14,7 @@ android {
} }
namespace "dev.flutter.multipleflutters" namespace "dev.flutter.multipleflutters"
compileSdk 35 compileSdk = 35
// Flutter's CI installs the NDK at a non-standard path. // Flutter's CI installs the NDK at a non-standard path.
// This non-standard structure is initially created by // This non-standard structure is initially created by
@ -26,20 +26,20 @@ android {
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17
} }
kotlinOptions { kotlinOptions {
jvmTarget = '17' jvmTarget = JavaVersion.VERSION_17.toString()
} }
defaultConfig { defaultConfig {
applicationId "dev.flutter.multipleflutters" applicationId "dev.flutter.multipleflutters"
minSdkVersion 24 minSdk = 24
targetSdkVersion 35 targetSdk = 35
versionCode 1 versionCode = 1
versionName "1.0" versionName = "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

View File

@ -28,7 +28,7 @@ if (flutterVersionName == null) {
android { android {
namespace "com.example.spell_check" namespace "com.example.spell_check"
compileSdk flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
// Flutter's CI installs the NDK at a non-standard path. // Flutter's CI installs the NDK at a non-standard path.
// This non-standard structure is initially created by // This non-standard structure is initially created by
@ -40,12 +40,12 @@ android {
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
} }
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = JavaVersion.VERSION_1_8.toString()
} }
sourceSets { sourceSets {
@ -57,10 +57,10 @@ android {
applicationId "com.example.spell_check" applicationId "com.example.spell_check"
// You can update the following values to match your application needs. // 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. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion minSdk = flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion targetSdk = flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode = flutterVersionCode.toInteger()
versionName flutterVersionName versionName = flutterVersionName
} }
buildTypes { buildTypes {

View File

@ -28,7 +28,7 @@ if (flutterVersionName == null) {
android { android {
namespace = "dev.flutter.manual_tests" namespace = "dev.flutter.manual_tests"
compileSdk flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
// Flutter's CI installs the NDK at a non-standard path. // Flutter's CI installs the NDK at a non-standard path.
// This non-standard structure is initially created by // This non-standard structure is initially created by
@ -45,7 +45,7 @@ android {
} }
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = JavaVersion.VERSION_1_8.toString()
} }
sourceSets { sourceSets {
@ -55,10 +55,10 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "dev.flutter.manual_tests" applicationId "dev.flutter.manual_tests"
minSdkVersion flutter.minSdkVersion minSdk = flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion targetSdk = flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode = flutterVersionCode.toInteger()
versionName flutterVersionName versionName = flutterVersionName
} }
buildTypes { buildTypes {

View File

@ -28,7 +28,7 @@ if (flutterVersionName == null) {
android { android {
namespace = "com.example.tracing_tests" namespace = "com.example.tracing_tests"
compileSdk flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
// Flutter's CI installs the NDK at a non-standard path. // Flutter's CI installs the NDK at a non-standard path.
// This non-standard structure is initially created by // This non-standard structure is initially created by
@ -40,12 +40,12 @@ android {
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
} }
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = JavaVersion.VERSION_1_8.toString()
} }
sourceSets { sourceSets {
@ -55,10 +55,10 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.tracing_tests" applicationId "com.example.tracing_tests"
minSdkVersion flutter.minSdkVersion minSdk = flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion targetSdk = flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger() versionCode = flutterVersionCode.toInteger()
versionName flutterVersionName versionName = flutterVersionName
} }
buildTypes { buildTypes {