Skip to content

Commit 0680465

Browse files
committed
buildSrc for data
1 parent 4075351 commit 0680465

File tree

2 files changed

+69
-49
lines changed

2 files changed

+69
-49
lines changed

buildSrc/src/main/java/Dependencies.kt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
import Versions.koin_version
12
import Versions.kotlin_version
23
import Versions.lifecycle_version
4+
import Versions.retrofit_version
5+
import Versions.room_version
36
import Versions.work_version
47

58
object Versions {
69
const val work_version = "2.3.4"
710
const val lifecycle_version = "2.2.0"
811
const val kotlin_version = "1.3.70"
12+
const val retrofit_version = "2.7.2"
13+
const val arch_version = "2.1.0"
14+
const val room_version = "2.2.5"
15+
const val koin_version= "2.1.4"
916
}
1017

1118
object Dependencies {
@@ -18,6 +25,7 @@ object Dependencies {
1825
const val androidTestJunit = "androidx.test.ext:junit:1.1.1"
1926
const val androidTestEspresso = "androidx.test.espresso:espresso-core:3.4.0"
2027
const val workRuntime = "androidx.work:work-runtime-ktx:$work_version"
28+
const val workRx = "android.arch.work:work-rxjava2:$work_version"
2129
const val viewModel = "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
2230
const val liveData = "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
2331
const val lifecycle = "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
@@ -26,4 +34,22 @@ object Dependencies {
2634
const val anrWatchDog = "com.github.anrwatchdog:anrwatchdog:1.4.0"
2735
const val shimmer = "com.facebook.shimmer:shimmer:0.5.0"
2836
const val mpAndroidCharts = "com.github.PhilJay:MPAndroidChart:3.1.0"
37+
const val room = "androidx.room:room-runtime:$room_version"
38+
const val roomRx = "androidx.room:room-rxjava2:$room_version"
39+
const val roomKtx = "androidx.room:room-ktx:$room_version"
40+
const val roomCompiler = "androidx.room:room-compiler:$room_version"
41+
const val rxAndroid = "io.reactivex.rxjava2:rxandroid:2.1.0"
42+
const val rx2 = "io.reactivex.rxjava2:rxjava:2.2.21"
43+
const val rxKotlin = "io.reactivex.rxjava2:rxkotlin:2.2.0"
44+
const val koinViewModel = "org.koin:koin-androidx-viewmodel:$koin_version"
45+
const val koinAndroid = "org.koin:koin-android:$koin_version"
46+
const val koinCore = "org.koin:koin-core:$koin_version"
47+
const val jodaTime = "joda-time:joda-time:2.10.14"
48+
const val moshi = "com.squareup.moshi:moshi-kotlin:1.9.2"
49+
const val moshiCodeGen = "com.squareup.moshi:moshi-kotlin-codegen:1.9.2"
50+
const val retrofitMoshi = "com.squareup.retrofit2:converter-moshi:$retrofit_version"
51+
const val retrofitGson = "com.squareup.retrofit2:converter-gson:$retrofit_version"
52+
const val retrofitRx = "com.squareup.retrofit2:adapter-rxjava2:$retrofit_version"
53+
const val coroutineCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.4"
54+
const val rxRelay = "com.jakewharton.rxrelay2:rxrelay:2.1.1"
2955
}

data/build.gradle

Lines changed: 43 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,65 +4,59 @@ apply plugin: 'kotlin-kapt'
44

55
android {
66

7-
defaultConfig {
8-
compileSdkVersion 29
9-
buildToolsVersion "29.0.2"
10-
compileOptions {
11-
targetCompatibility = "8"
12-
sourceCompatibility = "8"
13-
}
14-
kotlinOptions {
15-
jvmTarget = JavaVersion.VERSION_1_8.toString()
16-
}
17-
javaCompileOptions {
18-
annotationProcessorOptions {
19-
arguments = [
20-
"room.schemaLocation": "$projectDir/schemas".toString()
21-
]
22-
}
23-
}
7+
defaultConfig {
8+
compileSdkVersion 29
9+
buildToolsVersion "29.0.2"
10+
compileOptions {
11+
targetCompatibility = "8"
12+
sourceCompatibility = "8"
2413
}
14+
kotlinOptions {
15+
jvmTarget = JavaVersion.VERSION_1_8.toString()
16+
}
17+
javaCompileOptions {
18+
annotationProcessorOptions {
19+
arguments = [
20+
"room.schemaLocation": "$projectDir/schemas".toString()
21+
]
22+
}
23+
}
24+
}
2525
}
2626

2727
dependencies {
28-
implementation fileTree(dir: 'libs', include: ['*.jar'])
29-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
30-
def work_version = "2.3.4"
31-
def lifecycle_version = "2.2.0"
32-
def retrofit_version = "2.7.2"
33-
def arch_version = "2.1.0"
34-
def room_version = "2.2.5"
35-
def koin_version= "2.1.4"
28+
implementation fileTree(dir: 'libs', include: ['*.jar'])
29+
3630

37-
api "androidx.work:work-runtime-ktx:$work_version"
38-
api "android.arch.work:work-rxjava2:$work_version"
39-
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
40-
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
41-
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
31+
api Dependencies.workRuntime
32+
api Dependencies.workRx
33+
implementation Dependencies.viewModel
34+
implementation Dependencies.liveData
35+
implementation Dependencies.lifecycle
4236

43-
implementation "androidx.room:room-runtime:$room_version"
44-
implementation "androidx.room:room-rxjava2:$room_version"
45-
implementation "androidx.room:room-ktx:$room_version"
46-
kapt "androidx.room:room-compiler:$room_version"
37+
implementation Dependencies.room
38+
implementation Dependencies.roomRx
39+
implementation Dependencies.roomKtx
40+
kapt Dependencies.roomCompiler
4741

48-
api 'io.reactivex.rxjava2:rxandroid:2.1.0'
49-
api 'io.reactivex.rxjava2:rxjava:2.2.21'
50-
api 'io.reactivex.rxjava2:rxkotlin:2.2.0'
51-
api 'com.google.android.material:material:1.1.0'
52-
api "org.koin:koin-androidx-viewmodel:$koin_version"
53-
api "org.koin:koin-android:$koin_version"
54-
api "org.koin:koin-core:$koin_version"
55-
api 'joda-time:joda-time:2.10.14'
42+
api Dependencies.rxAndroid
43+
api Dependencies.rx2
44+
api Dependencies.rxKotlin
45+
api Dependencies.material
46+
api Dependencies.koinViewModel
47+
api Dependencies.koinAndroid
48+
api Dependencies.koinCore
49+
api Dependencies.jodaTime
5650

57-
implementation "com.squareup.moshi:moshi-kotlin:1.9.2"
58-
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.9.2"
51+
implementation Dependencies.moshi
52+
kapt Dependencies.moshiCodeGen
5953

60-
implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"
61-
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
62-
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit_version"
63-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.4'
54+
implementation Dependencies.retrofitMoshi
55+
implementation Dependencies.retrofitGson
56+
implementation Dependencies.retrofitRx
57+
implementation Dependencies.coroutineCore
6458

65-
api 'com.jakewharton.rxrelay2:rxrelay:2.1.1'
59+
api Dependencies.rxRelay
6660

6761
}
6862

0 commit comments

Comments
 (0)