From 584fc706e3075c8b47e2d0eacd93b1e081858dae Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Mon, 23 Dec 2024 16:27:22 -0800 Subject: [PATCH 1/2] [tool] Build all_packages command against Flutter Android SDK version to match example apps --- script/tool/lib/src/create_all_packages_app_command.dart | 4 ++-- script/tool/test/create_all_packages_app_command_test.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/script/tool/lib/src/create_all_packages_app_command.dart b/script/tool/lib/src/create_all_packages_app_command.dart index 812c32133b2..7608c132480 100644 --- a/script/tool/lib/src/create_all_packages_app_command.dart +++ b/script/tool/lib/src/create_all_packages_app_command.dart @@ -243,9 +243,9 @@ dependencies {} gradleFile, replacements: >{ if (gradleFileIsKotlin) - 'compileSdk': ['compileSdk = 34'] + 'compileSdk': ['compileSdk = flutter.compileSdkVersion'] else ...>{ - 'compileSdkVersion': ['compileSdk 34'], + 'compileSdkVersion': ['compileSdk flutter.compileSdkVersion'], } }, regexReplacements: >{ diff --git a/script/tool/test/create_all_packages_app_command_test.dart b/script/tool/test/create_all_packages_app_command_test.dart index b65371a1971..2e4edeab3b6 100644 --- a/script/tool/test/create_all_packages_app_command_test.dart +++ b/script/tool/test/create_all_packages_app_command_test.dart @@ -342,7 +342,7 @@ android { buildGradle, containsAll([ contains('This is the legacy file'), - contains('compileSdk 34'), + contains('compileSdk flutter.compileSdkVersion'), ])); }); @@ -375,7 +375,7 @@ android { expect( buildGradle, containsAll([ - contains('compileSdk 34'), + contains('compileSdk flutter.compileSdkVersion'), contains('androidx.lifecycle:lifecycle-runtime'), ])); }); From cd50629c69ff4a7874b53b25dc5e7a7cac13835e Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Tue, 18 Feb 2025 16:44:41 -0800 Subject: [PATCH 2/2] Hardcode 35 --- script/tool/lib/src/create_all_packages_app_command.dart | 9 ++++----- .../tool/test/create_all_packages_app_command_test.dart | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/script/tool/lib/src/create_all_packages_app_command.dart b/script/tool/lib/src/create_all_packages_app_command.dart index 7608c132480..5d60724799a 100644 --- a/script/tool/lib/src/create_all_packages_app_command.dart +++ b/script/tool/lib/src/create_all_packages_app_command.dart @@ -242,11 +242,8 @@ dependencies {} _adjustFile( gradleFile, replacements: >{ - if (gradleFileIsKotlin) - 'compileSdk': ['compileSdk = flutter.compileSdkVersion'] - else ...>{ - 'compileSdkVersion': ['compileSdk flutter.compileSdkVersion'], - } + 'compileSdk': ['compileSdk = 35'], + 'compileSdkVersion': ['compileSdk = 35'], }, regexReplacements: >{ // Tests for https://github.com/flutter/flutter/issues/43383 @@ -267,6 +264,8 @@ dependencies {} // section. }, ); + print('build.gradle contents:'); + print(content); } Future _genPubspecWithAllPlugins() async { diff --git a/script/tool/test/create_all_packages_app_command_test.dart b/script/tool/test/create_all_packages_app_command_test.dart index 2e4edeab3b6..ebf865a2452 100644 --- a/script/tool/test/create_all_packages_app_command_test.dart +++ b/script/tool/test/create_all_packages_app_command_test.dart @@ -342,7 +342,7 @@ android { buildGradle, containsAll([ contains('This is the legacy file'), - contains('compileSdk flutter.compileSdkVersion'), + contains('compileSdk = 35'), ])); }); @@ -375,7 +375,7 @@ android { expect( buildGradle, containsAll([ - contains('compileSdk flutter.compileSdkVersion'), + contains('compileSdk = 35'), contains('androidx.lifecycle:lifecycle-runtime'), ])); });