From 5db80f566bed544b97a021cb9b69f033bf1a6719 Mon Sep 17 00:00:00 2001 From: Vu Tran Kien Date: Wed, 16 Oct 2019 11:03:03 +0900 Subject: [PATCH] Bump versions, upgrade code - Get rid of apt plugin, gradle now has built-in annotationProcessor. - Try not to leak too much library code into the app. --- app/build.gradle | 47 ++++++++++++------------ build.gradle | 6 +-- data/build.gradle | 15 ++++---- gradle/jacoco.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 +- presentation/build.gradle | 18 ++++----- 6 files changed, 46 insertions(+), 46 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1fc4876..b37e013 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.application' -apply plugin: 'com.neenbedankt.android-apt' apply from: rootProject.file('gradle/checkstyle.gradle') def STRING = "String" @@ -8,7 +7,6 @@ def INT = "int" android { compileSdkVersion parent.ext.androidCompileSdkVersion - buildToolsVersion parent.ext.androidBuildToolsVersion defaultConfig { applicationId parent.ext.androidApplicationId @@ -35,8 +33,10 @@ android { } } + flavorDimensions "type" productFlavors { mock { + dimension "type" applicationId parent.ext.androidApplicationId + '.mock' } } @@ -53,33 +53,34 @@ android { } dependencies { - compile rootProject.ext.dependencies.androidSupportv7 - compile rootProject.ext.dependencies.dagger - apt rootProject.ext.dependencies.daggerCompiler - compile rootProject.ext.dependencies.butterknife - compile rootProject.ext.dependencies.snackBars - compile rootProject.ext.dependencies.recyclerView - compile rootProject.ext.dependencies.picasso - compile rootProject.ext.dependencies.recyclerAdapters - compile rootProject.ext.dependencies.fAB - compile rootProject.ext.dependencies.coordinator - apt rootProject.ext.dependencies.coordinatorCompiler + implementation rootProject.ext.dependencies.androidSupportv7 + implementation rootProject.ext.dependencies.dagger + annotationProcessor rootProject.ext.dependencies.daggerCompiler + implementation rootProject.ext.dependencies.butterknife + annotationProcessor rootProject.ext.dependencies.butterknife + implementation rootProject.ext.dependencies.snackBars + implementation rootProject.ext.dependencies.recyclerView + implementation rootProject.ext.dependencies.picasso + implementation rootProject.ext.dependencies.recyclerAdapters + implementation rootProject.ext.dependencies.fAB + implementation rootProject.ext.dependencies.coordinator + annotationProcessor rootProject.ext.dependencies.coordinatorCompiler - compile project(':domain') - compile project(':presentation') - compile project(':data') + implementation project(':domain') + implementation project(':presentation') + implementation project(':data') - androidTestApt rootProject.ext.dependencies.daggerCompiler - androidTestCompile rootProject.ext.testDependencies.mockito - androidTestCompile rootProject.ext.androidTestDependencies.runner - androidTestCompile rootProject.ext.androidTestDependencies.rules - androidTestCompile rootProject.ext.androidTestDependencies.espresso_core - androidTestCompile (rootProject.ext.androidTestDependencies.espresso_contrib) { + androidTestAnnotationProcessor rootProject.ext.dependencies.daggerCompiler + androidTestImplementation rootProject.ext.testDependencies.mockito + androidTestImplementation rootProject.ext.androidTestDependencies.runner + androidTestImplementation rootProject.ext.androidTestDependencies.rules + androidTestImplementation rootProject.ext.androidTestDependencies.espresso_core + androidTestImplementation (rootProject.ext.androidTestDependencies.espresso_contrib) { exclude module: 'support-annotations' exclude module: 'recyclerview-v7' exclude module: 'support-v4' } - androidTestCompile rootProject.ext.androidTestDependencies.espresso_intents + androidTestImplementation rootProject.ext.androidTestDependencies.espresso_intents } diff --git a/build.gradle b/build.gradle index c850e57..67fb062 100644 --- a/build.gradle +++ b/build.gradle @@ -5,10 +5,10 @@ buildscript { repositories { jcenter() mavenCentral() + google() } dependencies { - classpath 'com.android.tools.build:gradle:1.5.0' - classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' + classpath 'com.android.tools.build:gradle:3.4.2' } } @@ -16,7 +16,6 @@ allprojects { ext { // Android config - androidBuildToolsVersion = '23.0.2' androidMinSdkVersion = 16 androidTargetSdkVersion = 23 androidCompileSdkVersion = 23 @@ -28,5 +27,6 @@ allprojects { repositories { jcenter() mavenCentral() + google() } } diff --git a/data/build.gradle b/data/build.gradle index 621c5bf..65e8d46 100644 --- a/data/build.gradle +++ b/data/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'com.android.library' apply from: rootProject.file('gradle/checkstyle.gradle') android { compileSdkVersion parent.ext.androidCompileSdkVersion - buildToolsVersion parent.ext.androidBuildToolsVersion defaultConfig { minSdkVersion parent.ext.androidMinSdkVersion } @@ -14,12 +13,12 @@ android { } dependencies { - compile project(':domain') - compile rootProject.ext.dependencies.retrofit - compile rootProject.ext.dependencies.loggingInterceptor - compile rootProject.ext.dependencies.gsonConverter - compile rootProject.ext.dependencies.ormlite + implementation project(':domain') + api rootProject.ext.dependencies.retrofit + api rootProject.ext.dependencies.loggingInterceptor + api rootProject.ext.dependencies.gsonConverter + api rootProject.ext.dependencies.ormlite - testCompile rootProject.ext.testDependencies.junit - testCompile rootProject.ext.testDependencies.mockito + testImplementation rootProject.ext.testDependencies.junit + testImplementation rootProject.ext.testDependencies.mockito } diff --git a/gradle/jacoco.gradle b/gradle/jacoco.gradle index 815426b..af62c6c 100644 --- a/gradle/jacoco.gradle +++ b/gradle/jacoco.gradle @@ -63,7 +63,7 @@ task jacocoFullReport(type: JacocoReport, group: 'Coverage reports') { reports { html.enabled true - html.destination 'build/reports/fullJacoco/' + html.destination file("${buildDir}/reports/fullJacoco/") xml.enabled false csv.enabled false } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 12c8c4d..7577191 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Jan 22 16:57:13 CET 2015 +#Wed Oct 16 10:12:20 JST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/presentation/build.gradle b/presentation/build.gradle index c5984cb..bb7adc0 100644 --- a/presentation/build.gradle +++ b/presentation/build.gradle @@ -1,17 +1,17 @@ -plugins { - id "net.ltgt.apt" version "0.5" -} -apply plugin: 'java' +//plugins { +// id "net.ltgt.apt" version "0.5" +//} +apply plugin: 'java-library' apply from: rootProject.file('gradle/checkstyle.gradle') sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 dependencies { - compile project(':domain') - compile rootProject.ext.dependencies.threaddecoratedview - apt rootProject.ext.dependencies.threaddecoratedviewcompiler + implementation project(':domain') + api rootProject.ext.dependencies.threaddecoratedview + annotationProcessor rootProject.ext.dependencies.threaddecoratedviewcompiler - testCompile rootProject.ext.testDependencies.junit - testCompile rootProject.ext.testDependencies.mockito + testImplementation rootProject.ext.testDependencies.junit + testImplementation rootProject.ext.testDependencies.mockito }