-
-
Notifications
You must be signed in to change notification settings - Fork 239
/
build.gradle
106 lines (88 loc) · 2.97 KB
/
build.gradle
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
102
103
104
105
106
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.ydq.android.gradle.native-aar.import'
// uncomment this to upload proguard mapping file and debug symbols to Sentry
// and also set the token (sentry.properties) file
// apply plugin: 'io.sentry.android.gradle'
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
compileSdkVersion 31
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "io.sentry.samples.flutter"
minSdkVersion 16
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
externalNativeBuild {
cmake {
arguments.add(0, "-DANDROID_STL=c++_static")
}
}
ndk {
// Flutter does not currently support building for x86 Android (See Issue 9253).
abiFilters("armeabi-v7a", "x86_64", "arm64-v8a")
}
}
// TODO: we need to fix CI as the version 21.1 (default) is not installed by default on
// GH Actions.
ndkVersion "21.4.7075529" // windows requires 21.4.7075529
externalNativeBuild {
cmake {
setPath("CMakeLists.txt")
}
}
buildTypes {
release {
// looks like Flutter requires minifyEnabled to be enabled or it throws
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.debug
}
}
lintOptions {
// workaround if using AGP 4.0 on release mode
// https://github.com/flutter/flutter/issues/58247
checkReleaseBuilds false
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "androidx.annotation:annotation:1.1.0"
}
// uncomment this to upload debug symbols to Sentry
// sentry {
// uploadNativeSymbols = true
// includeNativeSources = true
// }