@@ -2,17 +2,33 @@ apply plugin: 'com.android.application'
22apply plugin : ' kotlin-android'
33apply plugin : ' kotlin-kapt'
44
5+ def packageName = " ysuzuki.githubclient"
6+
7+ def localProperties () {
8+ Properties properties = new Properties ()
9+ properties. load(project. rootProject. file(' local.properties' ). newDataInputStream())
10+ return properties
11+ }
12+
13+ def localHost = localProperties(). getProperty(" local_host" )
14+
15+ def lifecycle_version = " 2.0.0"
16+
517android {
6- compileSdkVersion 25
7- buildToolsVersion " 25.0.2"
18+
19+ compileSdkVersion 28
20+ buildToolsVersion ' 28.0.3'
21+ flavorDimensions " default"
22+
823 defaultConfig {
9- applicationId " ysuzuki.githubclient "
24+ applicationId packageName
1025 minSdkVersion 19
11- targetSdkVersion 25
26+ targetSdkVersion 28
1227 versionCode 1
1328 versionName " 1.0"
14- testInstrumentationRunner " android.support .test.runner.AndroidJUnitRunner"
29+ testInstrumentationRunner " androidx .test.runner.AndroidJUnitRunner"
1530 }
31+
1632 buildTypes {
1733 release {
1834 minifyEnabled true
@@ -25,53 +41,76 @@ android {
2541 buildConfigField " String" , " HOST" , " \" https://api.github.com/\" "
2642 }
2743 }
44+
45+ productFlavors {
46+ product {
47+ dimension " default"
48+ applicationId packageName
49+ buildConfigField " String" , " HOST" , " \" ${ product_host} \" "
50+ }
51+ develop {
52+ dimension " default"
53+ applicationId packageName + " .dev"
54+ buildConfigField " String" , " HOST" , " \" " + localHost + " \" "
55+ }
56+ }
57+
2858 dataBinding {
2959 enabled = true
3060 }
61+
62+ kapt {
63+ mapDiagnosticLocations = true
64+ }
3165}
3266
3367dependencies {
34- compile fileTree(dir : ' libs' , include : [' *.jar' ])
35- compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
68+ implementation fileTree(dir : ' libs' , include : [' *.jar' ])
69+ implementation " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
3670
3771 // Android support libraries.
38- compile " com.android.support:appcompat-v7:${ android_support_lib_version} "
39- compile " com.android.support:design:${ android_support_lib_version} "
40- compile " com.android.support:customtabs:${ android_support_lib_version} "
41- compile ' com.android.support.constraint:constraint-layout:1.0.1'
72+ implementation ' androidx.core:core-ktx:1.0.1'
73+ implementation ' androidx.appcompat:appcompat:1.0.2'
74+ implementation ' androidx.browser:browser:1.0.0'
75+ implementation ' androidx.constraintlayout:constraintlayout:1.1.3'
76+ // ViewModel and LiveData
77+ implementation " androidx.lifecycle:lifecycle-extensions:$lifecycle_version "
78+
79+ implementation ' com.google.android.material:material:1.0.0'
4280
4381 // Data binding
44- kapt ' com.android. databinding:compiler:2.3 .0'
82+ kapt ' androidx. databinding:databinding- compiler:3.4 .0'
4583
4684 // RxJava
47- compile ' io.reactivex.rxjava2:rxjava:2.0.7 '
48- compile ' io.reactivex.rxjava2:rxandroid:2.0.1'
85+ implementation ' io.reactivex.rxjava2:rxjava:2.1.5 '
86+ implementation ' io.reactivex.rxjava2:rxandroid:2.0.1'
4987
5088 // Square
51- compile ' com.squareup.picasso:picasso:2.5.2'
52- compile ' com.squareup.moshi:moshi:1.4.0'
89+ implementation ' com.squareup.picasso:picasso:2.5.2'
90+ implementation ' com.squareup.moshi:moshi:1.4.0'
5391
5492 // Retrofit2
55- compile ' com.squareup.retrofit2:retrofit:2.2.0'
56- compile " com.squareup.retrofit2:converter-moshi:2.2.0"
57- compile ' com.squareup.retrofit2:adapter-rxjava2:2.2.0'
93+ implementation ' com.squareup.retrofit2:retrofit:2.2.0'
94+ implementation " com.squareup.retrofit2:converter-moshi:2.2.0"
95+ implementation ' com.squareup.retrofit2:adapter-rxjava2:2.2.0'
5896
5997 // Dagger2
60- compile " com.google.dagger:dagger:2.9"
98+ implementation " com.google.dagger:dagger:2.9"
6199 kapt " com.google.dagger:dagger-compiler:2.9"
62- provided ' javax.annotation:jsr250-api:1.0'
100+ compileOnly ' javax.annotation:jsr250-api:1.0'
63101
64102 // Test libraries
65- testCompile ' junit:junit:4.12'
66- testCompile ' org.mockito:mockito-core:1.10.19 '
67- testCompile " org.robolectric:robolectric:3.3.2"
68-
69- androidTestCompile ' org.hamcrest:hamcrest-library:1.3'
70- androidTestCompile " com.android.support:support-annotations: ${ android_support_lib_version } "
71- androidTestCompile ' com.android.support. test:runner:0.5 '
72- androidTestCompile ' com.android.support. test:rules:0.5 '
73- androidTestCompile ' com.android.support. test.espresso:espresso-core:2.2.2 '
103+ testImplementation ' junit:junit:4.12'
104+ testImplementation ' org.mockito:mockito-core:2.23.4 '
105+ testImplementation " org.robolectric:robolectric:3.3.2"
106+
107+ androidTestImplementation ' org.hamcrest:hamcrest-library:1.3'
108+ androidTestImplementation ' androidx.annotation:annotation:1.0.2 '
109+ androidTestImplementation ' androidx. test:runner:1.1.1 '
110+ androidTestImplementation ' androidx. test:rules:1.1.1 '
111+ androidTestImplementation ' androidx. test.espresso:espresso-core:3.1.1 '
74112}
75113repositories {
76114 mavenCentral()
115+ google()
77116}
0 commit comments