-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdependencies.gradle
186 lines (150 loc) · 7.43 KB
/
dependencies.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
// @see https://hackernoon.com/android-how-to-add-gradle-dependencies-using-foreach-c4cbcc070458
ext.app = [
minSdk : 21,
targetSdk : 28,
compileSdk: 28,
buildTools: '28.0.3',
]
ext.repository = [
jitpack: 'https://jitpack.io',
fabric : 'https://maven.fabric.io/public',
]
ext.addRepos = { RepositoryHandler handler ->
handler.google()
handler.jcenter()
handler.maven { url repository.jitpack }
handler.maven { url repository.fabric }
}
ext.java = [
sourceCompatibility: JavaVersion.VERSION_1_8,
targetCompatibility: JavaVersion.VERSION_1_8,
]
def versions = [
googleServicesPlugin: '4.2.0',
gradlePlugin : '3.2.1',
multidex : '2.0.0',
kotlin : '1.3.21',
ktxVersion : '1.0.0',
supportLibrary : '1.0.0',
supportLibraryRC01 : '1.0.0-rc01',
constraintLayout : '1.1.2',
room : '2.0.0-rc01',
lifecycle : '2.0.0-rc01',
dagger : '2.16',
javaxInject : '1',
timber : '4.5.1',
firebase : '16.0.7',
firebaseUI : '4.2.1',
fireStore : '17.1.5',
ahBottomNavigation : '2.3.3',
fabricGradle : '1.27.0',
fabric : '2.9.9',
jetifier : '1.0.0-beta04',
]
ext.gradlePlugins = [
//Google Services Gradle Plugin
"com.google.gms:google-services:$versions.googleServicesPlugin",
// Android Gradle Plugin
"com.android.tools.build:gradle:$versions.gradlePlugin",
// Kotlin Gradle Plugin
"org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlin",
//Fabric Plugin
"io.fabric.tools:gradle:$versions.fabricGradle"
]
def libraries = [
// Multidex Support
multidex : "androidx.multidex:multidex:$versions.multidex",
// Kotlin
kotlin : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$versions.kotlin",
kotlinReflect : "org.jetbrains.kotlin:kotlin-reflect:$versions.kotlin",
// Support Libraries
appCompatV7 : "androidx.appcompat:appcompat:$versions.supportLibrary",
cardView : "androidx.cardview:cardview:$versions.supportLibrary",
recylerView : "androidx.recyclerview:recyclerview:$versions.supportLibrary",
supportV4 : "androidx.legacy:legacy-support-v4:$versions.supportLibrary",
viewPager : "androidx.viewpager:viewpager:$versions.supportLibrary",
androidKtx : "androidx.core:core-ktx:$versions.ktxVersion",
fragmentKtx : "androidx.core:core-ktx:$versions.ktxVersion",
supportDesign : "com.google.android.material:material:$versions.supportLibrary",
constraintLayout : "androidx.constraintlayout:constraintlayout:$versions.constraintLayout",
// Room
roomRuntime : "androidx.room:room-runtime:$versions.room",
roomCompiler : "androidx.room:room-compiler:$versions.room",
// LifeCycle
lifecycleCommon : "androidx.lifecycle:lifecycle-common:$versions.lifecycle",
lifecycleRuntime : "androidx.lifecycle:lifecycle-runtime:$versions.lifecycle",
lifeCycleExtensions: "androidx.lifecycle:lifecycle-extensions:$versions.lifecycle",
lifeCycleCompiler : "androidx.lifecycle:lifecycle-compiler:$versions.lifecycle",
// Dagger
dagger : "com.google.dagger:dagger:$versions.dagger",
daggerAndroid : "com.google.dagger:dagger-android:$versions.dagger",
daggerSupport : "com.google.dagger:dagger-android-support:$versions.dagger",
daggerCompiler : "com.google.dagger:dagger-compiler:$versions.dagger",
daggerProcessor : "com.google.dagger:dagger-android-processor:$versions.dagger",
javaxInject : "javax.inject:javax.inject:$versions.javaxInject",
//Timber
timber : "com.jakewharton.timber:timber:$versions.timber",
//Firebase
firebaseCore : "com.google.firebase:firebase-core:$versions.firebase",
fireStore : "com.google.firebase:firebase-firestore:$versions.fireStore",
//FirebaseUI
firebaseAuth : "com.firebaseui:firebase-ui-auth:$versions.firebaseUI",
//BottomNavigation
ahBottomNavigation : "com.aurelhubert:ahbottomnavigation:$versions.ahBottomNavigation",
//Fabric
fabric : "com.crashlytics.sdk.android:crashlytics:${versions.fabric}@aar",
//jetifier
jetifierKapt : "com.android.tools.build.jetifier:jetifier-core:${versions.jetifier}",
jetifierProcessor : "com.android.tools.build.jetifier:jetifier-core:${versions.jetifier}"
]
ext.appDependencies = [
addDependency('implementation', libraries.multidex),
addDependency('implementation', libraries.kotlin),
addDependency('implementation', libraries.kotlinReflect),
addDependency('implementation', libraries.appCompatV7),
addDependency('implementation', libraries.supportDesign),
addDependency('implementation', libraries.recylerView),
addDependency('implementation', libraries.supportV4),
addDependency('implementation', libraries.cardView),
addDependency('implementation', libraries.constraintLayout),
addDependency('implementation', libraries.viewPager),
addDependency('implementation', libraries.roomRuntime),
addDependency('kapt', libraries.roomCompiler),
addDependency('implementation', libraries.androidKtx),
addDependency('implementation', libraries.fragmentKtx),
addDependency('implementation', libraries.lifecycleRuntime),
addDependency('implementation', libraries.lifeCycleExtensions),
addDependency('kapt', libraries.lifeCycleCompiler),
addDependency('api', libraries.dagger),
addDependency('api', libraries.daggerAndroid),
addDependency('implementation', libraries.daggerSupport),
addDependency('kapt', libraries.daggerCompiler),
addDependency('kapt', libraries.daggerProcessor),
addDependency('implementation', libraries.timber),
addDependency('implementation', libraries.firebaseCore),
addDependency('implementation', libraries.fireStore),
addDependency('implementation', libraries.firebaseAuth),
addDependency('implementation', libraries.ahBottomNavigation),
addDependency('implementation', libraries.fabric, { transitive = true }),
addDependency('kapt', libraries.jetifierKapt),
addDependency('annotationProcessor', libraries.jetifierProcessor),
//TODO: kullanılmazsa silinecek
addDependency('implementation', libraries.javaxInject),
//test debug for room
addDependency('debugImplementation', 'com.amitshekhar.android:debug-db:1.0.4')
]
static def addDependency(config, dependency) {
[configuration: config, dependency: dependency]
}
static def addDependency(config, dependency, options) {
[configuration: config, dependency: dependency, options: options]
}
ext.addDependencies = { DependencyHandler handler, dependencies ->
dependencies.each {
if (it.options != null) {
handler.add(it.configuration, it.dependency, it.options)
} else {
handler.add(it.configuration, it.dependency)
}
}
}