-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
168 lines (144 loc) · 6.01 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
/*
*
* Copyright 2023 Aditya Bavadekar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
plugins {
id 'com.android.application' version '7.4.1'
id 'org.jetbrains.kotlin.android' version '1.7.0'
id 'kotlin-kapt'
id 'com.google.gms.google-services'
id 'com.google.firebase.crashlytics'
id 'com.google.android.gms.oss-licenses-plugin'
id 'androidx.navigation.safeargs.kotlin'
}
android {
compileSdk Versions.COMPILE_SDK
namespace "com.adityaamolbavadekar.messenger"
def timestamp = System.currentTimeMillis()
Properties properties = new Properties()
properties.load(project.rootProject.file("local.properties").newDataInputStream())
defaultConfig {
applicationId "com.adityaamolbavadekar.messenger"
minSdkVersion Versions.MIN_SDK
targetSdkVersion Versions.TARGET_SDK
versionCode Versions.VERSION_CODE
versionName Versions.VERSION_NAME
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildConfigField "String", "DATE", "\"${new Date()}\""
buildConfigField "Long", "TIMESTAMP", "Long.parseLong(\"${timestamp}\")"
buildConfigField "String", "FCM_MESSAGING_SERVER_KEY", "\"${properties.getProperty("FCM_MESSAGING_SERVER_KEY")}\""
buildConfigField "String", "MESSENGER_URL", "\"https://github.com/AdityaBavadekar/Messenger\""
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
signingConfigs {
releaseConfig {
keyAlias = properties.getProperty("KEY_ALIAS")
keyPassword = properties.getProperty("KEY_PASSWORD")
storePassword = properties.getProperty("STORE_PASSWORD")
if (properties.getProperty("STORE_FILE") != null) {
storeFile = file(properties.getProperty("STORE_FILE"))
}
}
}
buildTypes {
release {
//disable minify because it crashes the app on release build, with
// a NullPointerException pointing to AuthViewModel#getCountryCodeInfo() -> line 2
minifyEnabled false
// Removing unused resources requires unused code shrinking to be turned on.
//And so even disable shrinkResources
shrinkResources false
signingConfig signingConfigs.releaseConfig
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "String", "BUILD_TYPE_NAME", "\"Release\""
}
debug {
buildConfigField "String", "BUILD_TYPE_NAME", "\"Debug\""
}
}
lintOptions {
// Running lint over the debug variant is enough
checkReleaseBuilds false
baseline file("lint-baseline.xml")
}
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFileName = output.outputFileName.replace(".apk", "-${variant.versionName}.apk")
print("${output.outputFileName} [Versions code : ${variant.versionCode}, Version name : ${variant.versionName}, BuildTimestamp : ${timestamp}] " + "\n")
}
}
buildFeatures {
viewBinding = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation project(":model")
implementation Dependencies.ANDROIDX_CORE
implementation Dependencies.ANDROIDX_APPCOMPAT
implementation Dependencies.ACTIVITY_KTX
implementation Dependencies.CONSTRAINT_LAYOUT
implementation Dependencies.EMOJI2
implementation platform(Dependencies.FIREBASE_BOM)
implementation Dependencies.FIREBASE_APPCHECK
implementation Dependencies.FIREBASE_APPCHECK_PLAY
implementation Dependencies.FIREBASE_AUTH
implementation Dependencies.FIREBASE_ANALYTICS
implementation Dependencies.FIREBASE_CRASHLYTICS
implementation Dependencies.FIREBASE_DATABASE
implementation Dependencies.FIREBASE_MESSAGING
implementation Dependencies.FIREBASE_STORAGE
implementation Dependencies.FRAGMENT_KTX
implementation Dependencies.GLIDE
kapt Dependencies.GLIDE_COMPILER
implementation Dependencies.JSOUP
implementation Dependencies.KOTLIN
implementation Dependencies.LIBPHONENUMBER
implementation Dependencies.LIFECYCLE_EXT
implementation Dependencies.LIFECYCLE_VIEWMODEL
implementation Dependencies.LOTTIE
implementation Dependencies.MATERIAL
implementation Dependencies.NAVIGATION_FRAGMENT
implementation Dependencies.NAVIGATION_UI
implementation Dependencies.OSS_LICENSES
implementation Dependencies.PAGING
implementation Dependencies.PHOTOVIEW
implementation Dependencies.PINLOG
debugImplementation Dependencies.PINLOG_ACTIVITY
implementation Dependencies.PLAY_SERVICES_AUTH
implementation Dependencies.PLAY_SERVICES_SAFETY_NET
implementation Dependencies.PREFERENCE
implementation Dependencies.RECYCLER_VIEW
implementation Dependencies.RECYCLER_VIEW_SELECTION
implementation Dependencies.RETROFIT
implementation Dependencies.RETROFIT_CONVERTER_GSON
kapt Dependencies.ROOM_COMPILER
implementation Dependencies.ROOM_RUNTIME
implementation Dependencies.ROOM_KTX
}