Skip to content

Commit 41e214e

Browse files
committed
chore(flavors): update android to use kotlin config
1 parent e7a3be3 commit 41e214e

8 files changed

Lines changed: 112 additions & 132 deletions

File tree

flavors/.metadata

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: "17025dd88227cd9532c33fa78f5250d548d87e9a"
7+
revision: "9f455d2486bcb28cad87b062475f42edc959f636"
88
channel: "stable"
99

1010
project_type: app
@@ -13,11 +13,11 @@ project_type: app
1313
migration:
1414
platforms:
1515
- platform: root
16-
create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
17-
base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
18-
- platform: macos
19-
create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
20-
base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a
16+
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
17+
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
18+
- platform: android
19+
create_revision: 9f455d2486bcb28cad87b062475f42edc959f636
20+
base_revision: 9f455d2486bcb28cad87b062475f42edc959f636
2121

2222
# User provided section
2323

flavors/android/app/build.gradle

Lines changed: 0 additions & 82 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id("dev.flutter.flutter-gradle-plugin")
6+
}
7+
8+
android {
9+
namespace = "com.example.flavors"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
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.example.flavors"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
31+
}
32+
33+
flavorDimensions += "track"
34+
productFlavors {
35+
create("internal") {
36+
dimension = "track"
37+
applicationIdSuffix = ".internal"
38+
}
39+
create("stable") {
40+
dimension = "track"
41+
}
42+
}
43+
44+
buildTypes {
45+
release {
46+
// TODO: Add your own signing config for the release build.
47+
// Signing with the debug keys for now, so `flutter run --release` works.
48+
signingConfig = signingConfigs.getByName("debug")
49+
}
50+
}
51+
}
52+
53+
flutter {
54+
source = "../.."
55+
}

flavors/android/build.gradle

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

flavors/android/build.gradle.kts

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

flavors/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

flavors/android/settings.gradle

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

0 commit comments

Comments
 (0)