-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathbuild.gradle
More file actions
101 lines (87 loc) · 3.09 KB
/
Copy pathbuild.gradle
File metadata and controls
101 lines (87 loc) · 3.09 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
98
99
100
101
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"
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace "com.place.holder"
compileSdk flutter.compileSdkVersion
// ndkVersion flutter.ndkVersion
ndkVersion = "28.2.13676358"
packagingOptions {
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
}
defaultConfig {
applicationId "com.place.holder"
minSdk flutter.minSdkVersion
targetSdk flutter.targetSdkVersion
versionCode flutter.versionCode
versionName flutter.versionName
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
coreLibraryDesugaringEnabled true
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17
}
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
}
// No ndk.abiFilters here: AGP rejects it alongside the abi splits set
// up by `flutter build apk --split-per-abi`. Flutter defaults to
// android-arm,android-arm64,android-x64 which is the same set we want.
// externalNativeBuild {
// cmake {
// arguments "-DANDROID_STL=c++_shared", '-DBUILD_TESTING=OFF', "-DANDROID_TOOLCHAIN=clang -v"
// cppFlags "-frtti -fexceptions -v -DANDROID -std=c++17"
//// cppFlags "-std=c++11"
// version "3.10.2"
// }
// }
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
ndk {
debugSymbolLevel 'FULL'
}
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
// not required. Just info
tasks.whenTaskAdded { task ->
if (task.name == 'assembleDebug') {
task.doFirst {
println "The compileSdkVersion is $flutter.compileSdkVersion"
println "The targetSdkVersion is $flutter.targetSdkVersion"
println "The ndkVersion is $ndkVersion"
}
}
}
}
flutter {
source '../..'
}