-
Notifications
You must be signed in to change notification settings - Fork 78
/
build.gradle
141 lines (120 loc) · 3.99 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
ext {
VERSION_CODE = 247
VERSION_NAME = "1.9.9"
SDK_MIN_VERSION = 23
SDK_TARGET_VERSION = 34
SDK_COMPILE_VERSION = 34
BUILD_TOOLS_VERSION = "34.0.0"
localProps = gradle.ext.localProps
ANDROID_MATERIAL_VERSION = '1.12.0'
ANDROID_PLAY_CORE_VERSION = '1.10.3'
ANDROIDX_CORE_VERSION = '1.12.0'
ANDROIDX_MEDIA_VERSION = '1.7.0'
ANDROIDX_APPCOMPAT_VERSION = '1.6.1'
ANDROIDX_CONSTRAINTLAYOUT_VERSION = '2.1.4'
ANDROIDX_SWIPEREFRESHLAYOUT_VERSION = '1.1.0'
GUAVA_VERSION = '31.0.1-android'
}
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.4.0'
classpath 'com.google.gms:google-services:4.4.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
subprojects {
def isDynFeature = false
if ('fermata' == name) {
apply plugin: 'com.android.application'
} else if (gradle.ext.modules.contains(':' + name)) {
isDynFeature = true
apply plugin: 'com.android.dynamic-feature'
} else {
apply plugin: 'com.android.library'
}
android {
compileSdkVersion SDK_COMPILE_VERSION
buildToolsVersion BUILD_TOOLS_VERSION
ndkVersion = "25.2.9519653"
defaultConfig {
minSdkVersion SDK_MIN_VERSION
targetSdkVersion SDK_TARGET_VERSION
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs 'en', 'ru', 'it', 'tr', 'de', 'pt', 'vi', 'pl', 'hr', 'ja', 'zh_TW', 'ko',
'fr', 'ro', 'ar'
}
if (isDynFeature) {
flavorDimensions "version"
productFlavors {
mobile {
dimension "version"
}
auto {
dimension "version"
applicationIdSuffix '.auto' + project.getProperties().getOrDefault('APP_ID_SFX', '')
}
}
}
buildFeatures {
buildConfig = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
testOptions {
unitTests.returnDefaultValues = true
}
}
dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
configurations.configureEach {
resolutionStrategy {
preferProjectModules()
eachDependency { details ->
if (details.requested.group == 'com.google.guava' && details.requested.name == 'guava') {
details.useVersion GUAVA_VERSION
}
}
}
}
}
gradle.projectsEvaluated {
gradle.ext.modules.forEach {
def p = project(it)
if (p.ext.has('addons')) {
p.ext.addons.forEach {
if (gradle.ext.addonInfo.length() == 0) {
gradle.ext.addonInfo.append('me.aap.utils.collection.CollectionUtils.sort(new me.aap.fermata.addon.AddonInfo[] {\n')
} else {
gradle.ext.addonInfo.append(',\n')
}
gradle.ext.addonInfo.append("new me.aap.fermata.addon.AddonInfo(\"${p.name}\", \"${it['class']}\", R.string.addon_name_${it['name']}, R.drawable.${it['icon']}, ${it['order']}, ${it['enabled']})")
}
}
}
if (gradle.ext.addonInfo.length() != 0) {
gradle.ext.addonInfo.append('\n})')
project(':fermata').android.productFlavors.forEach {
it.buildConfigField 'me.aap.fermata.addon.AddonInfo[]', 'ADDONS', gradle.ext.addonInfo.toString()
}
}
}
tasks.register('clean', Delete) {
delete rootProject.layout.buildDirectory
}