-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathbuild.gradle
175 lines (153 loc) · 5.89 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
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"
android {
namespace "com.bluebubbles.messaging"
compileSdk 34
lintOptions {
checkReleaseBuilds false
disable 'InvalidPackage'
}
aaptOptions {
noCompress "tflite"
}
defaultConfig {
applicationId "com.bluebubbles.messaging"
minSdkVersion 23
targetSdkVersion 33
versionCode 20002000 + flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
debug {
}
}
flavorDimensions = ["app"]
productFlavors {
joel {
dimension "app"
resValue "string", "app_name_en", "BlueBubbles Dev (Joel)"
resValue "color", "ic_launcher_background", "#4c49de"
resValue "string", "file_provider", "com.bluebubbles.messaging.joel.fileprovider"
applicationId "com.bluebubbles.messaging.joel"
}
tanay {
dimension "app"
resValue "string", "app_name_en", "BlueBubbles (Tanay Special Sauce)"
resValue "color", "ic_launcher_background", "#4c49de"
resValue "string", "file_provider", "com.bluebubbles.messaging.tanay.fileprovider"
applicationId "com.bluebubbles.messaging.tanay"
}
alpha {
dimension "app"
resValue "string", "app_name_en", "BlueBubbles (Alpha)"
resValue "color", "ic_launcher_background", "#49dbde"
resValue "string", "file_provider", "com.bluebubbles.messaging.alpha.fileprovider"
applicationId "com.bluebubbles.messaging.alpha"
}
beta {
dimension "app"
resValue "string", "app_name_en", "BlueBubbles (Beta)"
resValue "color", "ic_launcher_background", "#4990de"
resValue "string", "file_provider", "com.bluebubbles.messaging.beta.fileprovider"
applicationId "com.bluebubbles.messaging.beta"
}
prod {
getIsDefault().set(true)
dimension "app"
resValue "string", "app_name_en", "BlueBubbles"
resValue "color", "ic_launcher_background", "#4990de"
resValue "string", "file_provider", "com.bluebubbles.messaging.fileprovider"
applicationId "com.bluebubbles.messaging"
}
}
buildTypes {
release {
productFlavors.joel.signingConfig signingConfigs.debug
productFlavors.tanay.signingConfig signingConfigs.debug
productFlavors.alpha.signingConfig signingConfigs.release
productFlavors.beta.signingConfig signingConfigs.release
productFlavors.prod.signingConfig signingConfigs.release
minifyEnabled false
shrinkResources false
}
}
sourceSets {
main {
java {
srcDirs 'src/main/java', 'src/main/java/workers'
}
}
}
}
flutter {
source '../..'
}
// For Cloud Firestore okio error
configurations.all {
resolutionStrategy {
force 'com.squareup.okhttp:okhttp:2.7.5'
force 'com.squareup.okio:okio:1.17.5'
}
}
dependencies {
// Android native functions
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "androidx.core:core-ktx:1.12.0"
implementation "androidx.sharetarget:sharetarget:1.2.0"
implementation 'androidx.browser:browser:1.7.0'
implementation 'androidx.activity:activity-ktx:1.8.2'
implementation "androidx.work:work-runtime:2.9.0"
implementation "androidx.work:work-runtime-ktx:2.9.0"
// Firebase items
implementation 'com.google.firebase:firebase-messaging:23.4.0'
implementation 'com.google.firebase:firebase-database:20.3.0'
implementation 'com.google.firebase:firebase-messaging-directboot:23.4.0'
implementation 'com.google.firebase:firebase-iid:21.1.0'
implementation 'com.google.firebase:firebase-firestore:24.10.1'
// Kotlin Coroutines (async)
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3"
// Socket IO
implementation ('io.socket:socket.io-client:2.0.0') {
exclude group: 'org.json', module: 'json'
}
// JSON parsing
implementation 'com.google.code.gson:gson:2.10.1'
}