-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathbuild.gradle
More file actions
240 lines (201 loc) · 7.03 KB
/
Copy pathbuild.gradle
File metadata and controls
240 lines (201 loc) · 7.03 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
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.ksp)
alias(libs.plugins.google.services)
alias(libs.plugins.firebase.crashlytics)
}
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists() && keystorePropertiesFile.canRead()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace 'io.github.gmathi.novellibrary'
compileSdk 36
buildToolsVersion '36.0.0'
defaultConfig {
applicationId "io.github.gmathi.novellibrary"
minSdk 23
targetSdk 36
multiDexEnabled true
versionCode 122
versionName "1.1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
signingConfigs {
if (keystorePropertiesFile.exists() && keystorePropertiesFile.canRead()) {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
}
buildTypes {
debug {
pseudoLocalesEnabled true
getIsDefault().set(true)
}
release {
if (keystorePropertiesFile.exists() && keystorePropertiesFile.canRead()) {
signingConfig signingConfigs.release
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
flavorDimensions = ["mode"]
productFlavors {
mirror {
dimension "mode"
applicationIdSuffix ".mirror"
}
canary {
dimension "mode"
}
normal {
dimension "mode"
getIsDefault().set(true)
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
buildFeatures {
dataBinding true
viewBinding true
buildConfig true
compose true
}
sourceSets {
mirror {
res {
srcDirs 'src\\mirror\\res'
}
}
}
packaging {
jniLibs {
useLegacyPackaging = false
}
resources {
excludes += ['META-INF/DEPENDENCIES', 'META-INF/LICENSE', 'META-INF/LICENSE.txt', 'META-INF/NOTICE', 'META-INF/NOTICE.txt']
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
// Foundation modules
implementation project(':core')
implementation project(':common')
implementation project(':util')
implementation project(':stubs')
// Settings module
implementation project(':settings')
// AndroidX
implementation libs.androidx.appcompat
implementation libs.androidx.constraintlayout
implementation libs.androidx.browser
implementation libs.bundles.androidx.lifecycle
implementation libs.androidx.legacy.support
implementation libs.androidx.cardview
implementation libs.androidx.vectordrawable
implementation libs.androidx.preference
// Compose
implementation platform(libs.compose.bom)
implementation libs.bundles.compose
debugImplementation libs.compose.ui.tooling
// Material Design
implementation libs.material
// WorkManager
implementation libs.bundles.work
androidTestImplementation libs.androidx.work.testing
// Network
implementation libs.bundles.network
// Reactive
implementation libs.bundles.reactive
// Kotlin
implementation libs.bundles.kotlinx
// Parsing & Data
implementation libs.jsoup
implementation libs.gson
implementation libs.kotson
implementation libs.markdown
// Image Loading
implementation libs.bundles.image.loading
implementation libs.coil.compose
implementation libs.landscapist.core
ksp libs.glide.ksp
// UI Components
implementation libs.lottie
implementation libs.photoview
implementation libs.fancybuttons
implementation libs.smarttablayout
implementation libs.recyclerview.animators
implementation libs.konfetti
implementation libs.snackprogressbar
// Material Dialogs
implementation libs.bundles.material.dialogs
// Firebase
implementation platform(libs.firebase.bom)
implementation libs.firebase.analytics
implementation libs.firebase.core
implementation libs.firebase.config
implementation libs.firebase.crashlytics
implementation libs.firebase.messaging
implementation libs.firebase.auth
implementation(libs.firebase.ui.auth) {
exclude group: 'com.google.firebase'
exclude group: 'com.google.android.gms'
exclude group: 'com.android.support'
exclude group: 'com.google.api-client'
exclude group: 'com.google.apis'
}
// Google Play Services
implementation libs.play.services.gcm
implementation libs.play.services.drive
implementation libs.play.services.auth
implementation libs.google.api.client.android
implementation(libs.google.api.services.drive) {
exclude group: 'org.apache.httpcomponents'
exclude group: 'com.google.guava'
}
// Utilities
implementation libs.eventbus
implementation libs.crux
implementation libs.injekt
// Debug
canaryImplementation libs.leakcanary
// Testing
testImplementation libs.junit
androidTestImplementation libs.androidx.junit
androidTestImplementation libs.androidx.espresso
}
tasks.register('countTranslations') {
File json = file('src\\main\\assets\\translations.json')
Set<File> resources = fileTree('src\\main\\res')
.files.findAll { (it.name == 'strings.xml') }
File englishResources = resources.find { it.parentFile.name == 'values' }
resources.remove(englishResources)
List<String> englishStrings = englishResources.text.readLines()
.findAll { it.trim().startsWith('<string name="') && !it.contains('translatable="false"') && it.endsWith('</string>') }
.collect { it.trim().split('">')[1].split('</')[0] }
json.text = '{\r\n "en": "' + englishStrings.size() + '"'
resources.each { resource ->
List<String> strings = resource.text.readLines()
.findAll { it.trim().startsWith('<string name="') && !it.contains('translatable="false"') && it.endsWith('</string>') }
.collect { it.trim().split('">')[1].split('</')[0] }
.findAll { !englishStrings.contains(it) }
json.text += ',\r\n "' + resource.parentFile.name.split('-')[1] + '": "' + strings.size() + '"'
}
json.text += '\r\n}'
}