-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
97 lines (86 loc) · 2.88 KB
/
build.gradle.kts
File metadata and controls
97 lines (86 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import java.util.Properties
import java.io.FileInputStream
plugins {
id("com.android.application")
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}
val keystorePropertiesFile = rootProject.file("key.properties")
val keystoreProperties = Properties().apply {
if (keystorePropertiesFile.exists()) {
load(FileInputStream(keystorePropertiesFile))
}
}
android {
namespace = "dev.shtanko.flutter_bloc_app_template"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "dev.shtanko.flutter_bloc_app_template"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}
// buildTypes {
// release {
// signingConfig = signingConfigs.debug
// applicationVariants.all { variant ->
// variant.outputs.all {
// outputFileName = "${variant.buildType.name}-${variant.versionName}.apk"
// }
// }
// }
// }
flavorDimensions += "version"
productFlavors {
create("dev") {
dimension = "version"
applicationIdSuffix = ".dev"
versionNameSuffix = "-dev"
}
create("qa") {
dimension = "version"
applicationIdSuffix = ".qa"
versionNameSuffix = "-qa"
}
create("prod") {
dimension = "version"
}
}
signingConfigs {
register("release") {
enableV1Signing = true
enableV2Signing = true
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
storePassword = keystoreProperties["storePassword"] as String?
keyAlias = keystoreProperties["keyAlias"] as String?
keyPassword = keystoreProperties["keyPassword"] as String?
}
}
buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
signingConfig = signingConfigs.getByName("release")
}
}
}
flutter {
source = "../.."
}