Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded to AGP 3.0 #79

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 56 additions & 44 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,23 @@ apply plugin: 'com.github.triplet.play'
//apply plugin: 'io.fabric'

android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion 26
buildToolsVersion '26.0.2'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that as of Gradle plugin 3.0.0, we no longer need to specify the build tools version, so we can remove this.

"With this update, you no longer need to specify a version for the build tools—the plugin uses the minimum required version by default. So, you can now remove the android.buildToolsVersion property."
https://developer.android.com/studio/releases/gradle-plugin.html#3-0-0


defaultConfig {
applicationId 'uk.co.ribot.androidboilerplate'
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 26
testInstrumentationRunner "${applicationId}.runner.RxAndroidJUnitRunner"
versionCode 1000
// Major -> Millions, Minor -> Thousands, Bugfix -> Hundreds. E.g 1.3.72 == 1,003,072
versionName '0.1.0'

javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath false
}
}
}

signingConfigs {
Expand Down Expand Up @@ -68,6 +74,12 @@ android {
lintOptions {
warning 'InvalidPackage'
}

testOptions {
unitTests {
includeAndroidResources = true
}
}
}

play {
Expand All @@ -78,84 +90,84 @@ play {
}

dependencies {
final PLAY_SERVICES_VERSION = '9.6.1'
final SUPPORT_LIBRARY_VERSION = '25.3.1'
final PLAY_SERVICES_VERSION = '11.4.2'
final SUPPORT_LIBRARY_VERSION = '26.0.2'
final RETROFIT_VERSION = '2.3.0'
final DAGGER_VERSION = '2.5'
final MOCKITO_VERSION = '2.6.2'
final HAMCREST_VERSION = '1.3'
final ESPRESSO_VERSION = '2.2.1'
final RUNNER_VERSION = '0.4'
final BUTTERKNIFE_VERSION = '8.4.0'
final AUTO_VALUE_VERSION = '1.3'
final AUTO_VALUE_GSON_VERSION = '0.4.2'
final BUTTERKNIFE_VERSION = '8.8.1'
final AUTO_VALUE_VERSION = '1.5'
final AUTO_VALUE_GSON_VERSION = '0.5.0'

def daggerCompiler = "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
def jUnit = "junit:junit:4.12"
def mockito = "org.mockito:mockito-core:$MOCKITO_VERSION"

// App Dependencies
compile "com.google.android.gms:play-services-gcm:$PLAY_SERVICES_VERSION"
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
implementation "com.google.android.gms:play-services-gcm:$PLAY_SERVICES_VERSION"
implementation "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"

compile ("com.squareup.sqlbrite2:sqlbrite:2.0.0") {
implementation("com.squareup.sqlbrite2:sqlbrite:2.0.0") {
exclude group: 'com.android.support', module: 'support-annotations'
}
compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
compile "com.squareup.retrofit2:adapter-rxjava2:$RETROFIT_VERSION"

compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') {
implementation "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
implementation "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
implementation "com.squareup.retrofit2:adapter-rxjava2:$RETROFIT_VERSION"

implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation 'io.reactivex.rxjava2:rxjava:2.1.3'
implementation('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') {
transitive = true;
}

compile 'com.jakewharton.timber:timber:4.1.2'
compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
implementation 'com.jakewharton.timber:timber:4.5.1'
implementation "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
annotationProcessor "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"

// Replace provided dependency below with official AutoValue once this issue is fixed
// https://github.com/google/auto/issues/268
provided "com.jakewharton.auto.value:auto-value-annotations:$AUTO_VALUE_VERSION"
provided "com.ryanharter.auto.value:auto-value-gson:$AUTO_VALUE_GSON_VERSION"
compileOnly "com.jakewharton.auto.value:auto-value-annotations:$AUTO_VALUE_VERSION"
compileOnly "com.ryanharter.auto.value:auto-value-gson:$AUTO_VALUE_GSON_VERSION"
annotationProcessor "com.google.auto.value:auto-value:$AUTO_VALUE_VERSION"
annotationProcessor 'com.ryanharter.auto.value:auto-value-parcel:0.2.4-rc2'
annotationProcessor 'com.ryanharter.auto.value:auto-value-parcel:0.2.5'
annotationProcessor "com.ryanharter.auto.value:auto-value-gson:$AUTO_VALUE_GSON_VERSION"
annotationProcessor 'com.squareup:javapoet:1.7.0'
annotationProcessor 'com.squareup:javapoet:1.9.0'
// https://github.com/rharter/auto-value-parcel/issues/64

compile "com.google.dagger:dagger:$DAGGER_VERSION"
provided 'org.glassfish:javax.annotation:10.0-b28' //Required by Dagger2
implementation "com.google.dagger:dagger:$DAGGER_VERSION"
compileOnly 'org.glassfish:javax.annotation:10.0-b28' //Required by Dagger2
annotationProcessor daggerCompiler
testAnnotationProcessor daggerCompiler
androidTestAnnotationProcessor daggerCompiler

// Instrumentation test dependencies
androidTestCompile jUnit
androidTestCompile mockito
androidTestCompile "org.mockito:mockito-android:$MOCKITO_VERSION"
androidTestCompile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
androidTestCompile("com.android.support.test.espresso:espresso-contrib:$ESPRESSO_VERSION") {
androidTestImplementation jUnit
androidTestImplementation mockito
androidTestImplementation "org.mockito:mockito-android:$MOCKITO_VERSION"
androidTestImplementation "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"
androidTestImplementation("com.android.support.test.espresso:espresso-contrib:$ESPRESSO_VERSION") {
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'recyclerview-v7'
}
androidTestCompile "com.android.support.test.espresso:espresso-core:$ESPRESSO_VERSION"
androidTestCompile "com.android.support.test:runner:$RUNNER_VERSION"
androidTestCompile "com.android.support.test:rules:$RUNNER_VERSION"
androidTestImplementation "com.android.support.test.espresso:espresso-core:$ESPRESSO_VERSION"
androidTestImplementation "com.android.support.test:runner:$RUNNER_VERSION"
androidTestImplementation "com.android.support.test:rules:$RUNNER_VERSION"

// Unit tests dependencies
testCompile jUnit
testCompile mockito
testCompile "org.hamcrest:hamcrest-core:$HAMCREST_VERSION"
testCompile "org.hamcrest:hamcrest-library:$HAMCREST_VERSION"
testCompile "org.hamcrest:hamcrest-integration:$HAMCREST_VERSION"
testCompile 'org.robolectric:robolectric:3.3'
testImplementation jUnit
testImplementation mockito
testImplementation "org.hamcrest:hamcrest-core:$HAMCREST_VERSION"
testImplementation "org.hamcrest:hamcrest-library:$HAMCREST_VERSION"
testImplementation "org.hamcrest:hamcrest-integration:$HAMCREST_VERSION"
testImplementation 'org.robolectric:robolectric:3.4.2'
}

// Log out test results to console
Expand Down
2 changes: 2 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Since 2.3.0
-dontwarn javax.annotation.**
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
Expand Down
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
buildscript {
repositories {
jcenter()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.github.triplet.gradle:play-publisher:1.1.4'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.github.triplet.gradle:play-publisher:1.2.0'
//noinspection GradleDynamicVersion
classpath 'io.fabric.tools:gradle:1.+'
}
Expand All @@ -14,11 +15,12 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
maven { url 'https://maven.fabric.io/public' }
}
}

task wrapper(type: Wrapper) {
gradleVersion = '3.3'
gradleVersion = '4.1'
distributionUrl = distributionUrl.replace("bin", "all")
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Sep 21 16:15:04 CST 2016
#Sun Sep 10 09:57:32 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip