forked from AndreyPavlenko/Fermata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
135 lines (115 loc) · 3.68 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
ext {
def abi = project.properties['ABI']
VERSION_CODE = 175
VERSION_NAME = "1.8.8"
SDK_MIN_VERSION = 23
SDK_TARGET_VERSION = 30
SDK_COMPILE_VERSION = 30
BUILD_TOOLS_VERSION = "29.0.2"
ABI_FILTERS = (abi != null) ? abi.split(",") : ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']
localProps = gradle.ext.localProps
ANDROID_MATERIAL_VERSION = '1.4.0'
ANDROID_PLAY_CORE_VERSION = '1.10.2'
ANDROIDX_CORE_VERSION = '1.3.2'
ANDROIDX_MEDIA_VERSION = '1.4.3'
ANDROIDX_APPCOMPAT_VERSION = '1.3.1'
ANDROIDX_CONSTRAINTLAYOUT_VERSION = '2.1.1'
ANDROIDX_SWIPEREFRESHLAYOUT_VERSION = '1.1.0'
}
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.google.gms:google-services:4.3.10'
}
}
allprojects {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
subprojects {
def isDynFeature = false
switch (name) {
case 'fermata':
case 'control':
apply plugin: 'com.android.application'
break
default:
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
defaultConfig {
minSdkVersion SDK_MIN_VERSION
targetSdkVersion SDK_TARGET_VERSION
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs "en", "ru", "it"
ndk {
abiFilters = ABI_FILTERS
}
}
if (isDynFeature) {
flavorDimensions "version"
productFlavors {
mobile {
dimension "version"
}
auto {
dimension "version"
applicationIdSuffix '.auto' + project.getProperties().getOrDefault('APP_ID_SFX', '')
}
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
testOptions {
unitTests.returnDefaultValues = true
}
}
dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
}
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('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']})")
}
}
}
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()
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}