Skip to content

Commit 9ef5c94

Browse files
authored
Bumping gradle plugin versions in homescreen_codelab (#2305)
Moved from Groovy build.gradle files to Kotlin build.gradle.kts files Java version to 11 Gradle wrapper version 8.12. NDK version 27.0.12077973 as required by several plugins ## Pre-launch Checklist - [X] I read the [Effective Dart: Style] _recently_, and have followed its advice. - [X] I signed the [CLA]. - [X] I updated/added relevant documentation (doc comments with `///`). - [X] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-devrel channel on [Discord]. <!-- Links --> [Effective Dart: Style]: https://dart.dev/guides/language/effective-dart/style [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
1 parent 799a70d commit 9ef5c94

29 files changed

+378
-496
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# */**/ios
66
# */**/.gitignore
77
*/**/.metadata
8+
*/**/android/app/.cxx
89

910
.dart_tool/
1011

homescreen_codelab/step_03/android/app/build.gradle

Lines changed: 0 additions & 69 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
id("dev.flutter.flutter-gradle-plugin")
5+
}
6+
7+
android {
8+
namespace = "com.mydomain.homescreen_widgets"
9+
compileSdk = flutter.compileSdkVersion
10+
// required by path_provider_android and shared_preferences_android
11+
ndkVersion = "27.0.12077973"
12+
13+
compileOptions {
14+
sourceCompatibility = JavaVersion.VERSION_11
15+
targetCompatibility = JavaVersion.VERSION_11
16+
}
17+
18+
kotlinOptions {
19+
jvmTarget = JavaVersion.VERSION_11.toString()
20+
}
21+
22+
defaultConfig {
23+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24+
applicationId = "com.mydomain.homescreen_widgets"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
31+
}
32+
33+
buildTypes {
34+
release {
35+
// TODO: Add your own signing config for the release build.
36+
// Signing with the debug keys for now, so `flutter run --release` works.
37+
signingConfig = signingConfigs.getByName("debug")
38+
}
39+
}
40+
buildFeatures {
41+
viewBinding = true
42+
}
43+
}
44+
45+
flutter {
46+
source = "../.."
47+
}

homescreen_codelab/step_03/android/build.gradle

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
allprojects {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
}
6+
}
7+
8+
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
9+
rootProject.layout.buildDirectory.value(newBuildDir)
10+
11+
subprojects {
12+
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
13+
project.layout.buildDirectory.value(newSubprojectBuildDir)
14+
}
15+
subprojects {
16+
project.evaluationDependsOn(":app")
17+
}
18+
19+
tasks.register<Delete>("clean") {
20+
delete(rootProject.layout.buildDirectory)
21+
}

homescreen_codelab/step_03/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip

homescreen_codelab/step_03/android/settings.gradle

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pluginManagement {
2+
val flutterSdkPath = run {
3+
val properties = java.util.Properties()
4+
file("local.properties").inputStream().use { properties.load(it) }
5+
val flutterSdkPath = properties.getProperty("flutter.sdk")
6+
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
7+
flutterSdkPath
8+
}
9+
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11+
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
18+
19+
plugins {
20+
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
21+
id("com.android.application") version "8.7.3" apply false
22+
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
23+
}
24+
25+
include(":app")

homescreen_codelab/step_04/android/app/build.gradle

Lines changed: 0 additions & 72 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
id("dev.flutter.flutter-gradle-plugin")
5+
}
6+
7+
android {
8+
namespace = "com.mydomain.homescreen_widgets"
9+
compileSdk = flutter.compileSdkVersion
10+
// required by path_provider_android and shared_preferences_android
11+
ndkVersion = "27.0.12077973"
12+
13+
compileOptions {
14+
sourceCompatibility = JavaVersion.VERSION_11
15+
targetCompatibility = JavaVersion.VERSION_11
16+
}
17+
18+
kotlinOptions {
19+
jvmTarget = JavaVersion.VERSION_11.toString()
20+
}
21+
22+
defaultConfig {
23+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24+
applicationId = "com.mydomain.homescreen_widgets"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
31+
}
32+
33+
buildTypes {
34+
release {
35+
// TODO: Add your own signing config for the release build.
36+
// Signing with the debug keys for now, so `flutter run --release` works.
37+
signingConfig = signingConfigs.getByName("debug")
38+
}
39+
}
40+
buildFeatures {
41+
viewBinding = true
42+
}
43+
}
44+
45+
flutter {
46+
source = "../.."
47+
}

homescreen_codelab/step_04/android/build.gradle

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)