Skip to content

Commit 431fc17

Browse files
committed
Update android gradle scripts
1 parent 5c9869a commit 431fc17

File tree

12 files changed

+116
-175
lines changed

12 files changed

+116
-175
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,5 @@ coverage/
136136
!**/ios/**/default.perspectivev3
137137
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
138138
!/dev/ci/**/Gemfile.lock
139-
.fvm
139+
.fvm
140+
**/android/app/.cxx/

android/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ GeneratedPluginRegistrant.java
1111
key.properties
1212
**/*.keystore
1313
**/*.jks
14+
.cxx/

android/app/build.gradle

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

android/app/build.gradle.kts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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 = "dev.shtanko.flutter_bloc_app_template"
10+
compileSdk = flutter.compileSdkVersion
11+
//ndkVersion = flutter.ndkVersion
12+
ndkVersion = "27.0.12077973"
13+
14+
compileOptions {
15+
sourceCompatibility = JavaVersion.VERSION_11
16+
targetCompatibility = JavaVersion.VERSION_11
17+
}
18+
19+
kotlinOptions {
20+
jvmTarget = JavaVersion.VERSION_11.toString()
21+
}
22+
23+
defaultConfig {
24+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
25+
applicationId = "dev.shtanko.flutter_bloc_app_template"
26+
// You can update the following values to match your application needs.
27+
// For more information, see: https://flutter.dev/to/review-gradle-config.
28+
minSdk = flutter.minSdkVersion
29+
targetSdk = flutter.targetSdkVersion
30+
versionCode = flutter.versionCode
31+
versionName = flutter.versionName
32+
}
33+
34+
flavorDimensions += "version"
35+
productFlavors {
36+
create("dev") {
37+
dimension = "version"
38+
applicationIdSuffix = ".dev"
39+
versionNameSuffix = "-dev"
40+
}
41+
create("qa") {
42+
dimension = "version"
43+
applicationIdSuffix = ".qa"
44+
versionNameSuffix = "-qa"
45+
}
46+
create("prod") {
47+
dimension = "version"
48+
}
49+
}
50+
51+
buildTypes {
52+
release {
53+
// TODO: Add your own signing config for the release build.
54+
// Signing with the debug keys for now, so `flutter run --release` works.
55+
signingConfig = signingConfigs.getByName("debug")
56+
}
57+
}
58+
}
59+
60+
flutter {
61+
source = "../.."
62+
}

android/build.gradle

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

android/build.gradle.kts

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+
}

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
org.gradle.jvmargs=-Xmx1536M
1+
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
22
android.useAndroidX=true
33
android.enableJetifier=true
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
21
distributionBase=GRADLE_USER_HOME
32
distributionPath=wrapper/dists
43
zipStoreBase=GRADLE_USER_HOME
54
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip

android/settings.gradle

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

android/settings.gradle.kts

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.0" apply false
22+
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
23+
}
24+
25+
include(":app")

0 commit comments

Comments
 (0)