From 72c2447307b9461b80183f92e582e5b624e52707 Mon Sep 17 00:00:00 2001 From: Reid Baker Date: Thu, 27 Feb 2025 15:31:08 -0500 Subject: [PATCH] android_host_app_v2_embedding update dependencies and documentation (#164195) Related to #149836 Last of the non api 35 references in flutter/flutter for targetSdk and compileSdk. `find . -type f -name "build.gradle" | xargs grep -e "targetSdk" | tr -d '=' | tr -s ' ' | grep -v flutter\.targetSdkVersion | grep -v engine/src/flutter/third_party/ | grep -v "targetSdk 35"` `find . -type f -name "build.gradle" | xargs grep -e "compileSdk" | tr -d '=' | tr -s ' ' | grep -v flutter\.compileSdkVersion | grep -v engine/src/flutter/third_party/ | grep -v "compileSdk 35"` rewrite of https://github.com/flutter/flutter/pull/163622 after this test was updated to run against a newer version of gradle and agp in https://github.com/flutter/flutter/pull/163849/files#diff-83b6ad7c016bffbb682664eb65c576a7ebf9c312fc60727c0e0e20f5641cbc2aR462 Android-API-And-Related-Versions.md was updated to reflect that after further investigation that android is using "=" in their documentation and that the space syntax is discouraged. Equals is setting a property and space is the equivalent to a function call like `compileSdk(35)` and assignment is prefered. The use of equals for proprty assignment also aligns with https://docs.gradle.org/current/userguide/migrating_from_groovy_to_kotlin_dsl.html#prepare_your_groovy_scripts ## 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 `///`). - [x] 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. --- .../android_host_app_v2_embedding/README.md | 2 +- .../android_host_app_v2_embedding/app/build.gradle | 10 +++++----- docs/contributing/Android-API-And-Related-Versions.md | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/README.md b/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/README.md index 8c8ad260dc..6f3df6b413 100644 --- a/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/README.md +++ b/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/README.md @@ -5,4 +5,4 @@ Android host app for a Flutter module created using $ flutter create -t module hello ``` and placed in a sibling folder to (a clone of) the host app. -Used by the `module_test.dart` device lab test. +Used by the `build_android_host_app_with_module_aar.dart` device lab test. diff --git a/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/app/build.gradle b/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/app/build.gradle index fee774a0c7..518a685691 100644 --- a/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/app/build.gradle +++ b/dev/integration_tests/pure_android_host_apps/android_host_app_v2_embedding/app/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'com.android.application' android { namespace = "io.flutter.add2app" - compileSdk 34 + compileSdk = 35 // Flutter's CI installs the NDK at a non-standard path. // This non-standard structure is initially created by @@ -18,14 +18,14 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } defaultConfig { applicationId "io.flutter.add2app" - minSdkVersion 21 - targetSdkVersion 34 + minSdk = 21 + targetSdk = 35 versionCode 1 versionName "1.0" } diff --git a/docs/contributing/Android-API-And-Related-Versions.md b/docs/contributing/Android-API-And-Related-Versions.md index a1df1d46fd..a8cd1b01e4 100644 --- a/docs/contributing/Android-API-And-Related-Versions.md +++ b/docs/contributing/Android-API-And-Related-Versions.md @@ -24,14 +24,14 @@ If the versions chosen are not known by [gradle_utils.dart](https://github.com/f ``` // OK android { - compileSdk flutter.compileSdkVersion + compileSdk = flutter.compileSdkVersion } ``` ``` // OK if flutter.compileSdkVersion is not available like in an add to app example. android { - compileSdk 35 + compileSdk = 35 } ``` @@ -53,14 +53,14 @@ android { ``` // OK defaultConfig { - targetSdk flutter.targetSdkVersion + targetSdk = flutter.targetSdkVersion } ``` ``` // OK if flutter.compileSdkVersion is not available like in an add to app example. defaultConfig { - targetSdk 35 + targetSdk = 35 } ```