forked from AndreyPavlenko/Fermata
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
164 lines (142 loc) · 4.68 KB
/
build.gradle
File metadata and controls
164 lines (142 loc) · 4.68 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
ext {
VERSION_CODE = 256
VERSION_NAME = "2.0.0"
SDK_MIN_VERSION = 29
SDK_TARGET_VERSION = 36
SDK_COMPILE_VERSION = 36
localProps = gradle.ext.localProps
ANDROID_MATERIAL_VERSION = '1.13.0'
ANDROID_PLAY_CORE_FD_VERSION = '2.1.0'
ANDROIDX_CORE_VERSION = '1.12.0'
ANDROIDX_MEDIA_VERSION = '1.7.1'
ANDROIDX_APPCOMPAT_VERSION = '1.7.1'
ANDROIDX_CONSTRAINTLAYOUT_VERSION = '2.2.1'
ANDROIDX_SWIPEREFRESHLAYOUT_VERSION = '1.2.0'
GUAVA_VERSION = '33.5.0-android'
addons = [
[
name : 'translate',
icon : 'translate',
class : 'me.aap.fermata.addon.TranslateAddon',
hasSettings: false
],
[
name : 'subgen',
icon : 'subgen',
class : 'me.aap.fermata.addon.SubGenAddon',
depends: 'exoplayer,translate'
],
]
}
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:9.0.0'
classpath 'com.google.gms:google-services:4.4.4'
}
}
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 {
compileSdk SDK_COMPILE_VERSION
ndkVersion = '29.0.14206865'
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', 'es', 'km'
}
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
coreLibraryDesugaringEnabled = true
}
testOptions {
unitTests.returnDefaultValues = true
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
}
}
dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
}
configurations.configureEach {
resolutionStrategy {
preferProjectModules()
eachDependency { details ->
if (details.requested.group == 'com.google.guava' && details.requested.name == 'guava') {
details.useVersion GUAVA_VERSION
}
}
}
}
}
gradle.projectsEvaluated {
def addons = new ArrayList<HashMap>(ext.addons)
gradle.ext.modules.forEach {
def p = project(it)
if (p.ext.has('addons')) {
p.ext.addons.forEach {
def info = new HashMap(it)
info['module'] = p.name
addons.add(info)
}
}
}
def addonInfo = new StringBuilder(1024)
addonInfo.append('me.aap.utils.collection.CollectionUtils.sort(new me.aap.fermata.addon.AddonInfo[] {\n')
addons.forEach {
def name = it['name']
addonInfo.append(" new me.aap.fermata.addon.AddonInfo(" +
"\"${it.get('module', name)}\", \"${it['class']}\", " +
"R.string.addon_name_${name}, R.drawable.${it['icon']}, " +
"${it['order']}, ${it['hasSettings']}, ${it['enabled']}, " +
"\"${it.get('depends', "")}\"),\n")
}
def infoStr = addonInfo.append('})').toString()
project(':fermata').android.productFlavors.forEach {
it.buildConfigField 'me.aap.fermata.addon.AddonInfo[]', 'ADDONS', infoStr
}
}
tasks.register('clean', Delete) {
delete rootProject.layout.buildDirectory
}