Skip to content
This repository has been archived by the owner on Jan 9, 2020. It is now read-only.

Commit

Permalink
Update gradle files according new Android Gradle plugin 3.0
Browse files Browse the repository at this point in the history
Please, review this tutorial for a better understanding of this commit:
  https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration

Apply this new rules to the gradle files, changing compile by implementation
and adding annotationProcessor. Also, edit the order of the repositories
jcenter() and google() to avoid download dependencies errors.
  • Loading branch information
Aracem committed Jul 25, 2018
1 parent f80ac04 commit db01788
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 34 deletions.
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
language: android

before_install:
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"

android:
components:
- platform-tools
- tools
- build-tools-23.0.3
- android-23
- build-tools-27.0.3
- android-27
- extra-android-support
- extra-google-m2repository
- extra-android-m2repository
licenses:
- android-sdk-license-.+
- '.+'

script:
- ./gradlew checkstyle build -Dpre-dex=false -Pcom.android.build.threadPoolSize=1 -Dorg.gradle.parallel=false -Dorg.gradle.jvmargs="-Xms512m -Xmx512m" -Dorg.gradle.daemon=false
- ./gradlew checkstyle build -Dpre-dex=false -Pcom.android.build.threadPoolSize=1 -Dorg.gradle.parallel=false -Dorg.gradle.jvmargs="-Xms512m -Xmx512m" -Dorg.gradle.daemon=false
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

buildscript {
repositories {
jcenter()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
Expand All @@ -34,8 +34,8 @@ ext {
allprojects {
repositories {
mavenCentral()
jcenter()
google()
jcenter()
}

apply plugin: 'checkstyle'
Expand Down
17 changes: 9 additions & 8 deletions rosie/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
implementation 'com.android.support:appcompat-v7:23.4.0'
implementation 'com.android.support:recyclerview-v7:23.4.0'

provided 'com.squareup.dagger:dagger-compiler:1.2.2'
annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.2'
compileOnly 'com.squareup.dagger:dagger-compiler:1.2.2'
implementation 'com.squareup.dagger:dagger:1.2.2'

compile 'com.squareup.dagger:dagger:1.2.2'
compile 'com.birbit:android-priority-jobqueue:1.3.5'
implementation 'com.birbit:android-priority-jobqueue:1.3.5'

testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-all:1.10.19'
testCompile 'org.robolectric:robolectric:2.4'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-all:1.10.19'
testImplementation 'org.robolectric:robolectric:2.4'
}

44 changes: 23 additions & 21 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,36 +75,38 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v13:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.karumi:dividers:1.0.3'
compile 'com.victor:lib:1.0.1' // https://github.com/yankai-victor/Loading
compile 'com.karumi:marvelapiclient:0.0.4'
compile 'com.github.pedrovgs:renderers:3.0.0'
compile 'com.jakewharton:butterknife:7.0.1'
provided 'com.squareup.dagger:dagger-compiler:1.2.2'
compile project(':rosie')

androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
androidTestCompile('com.google.dexmaker:dexmaker-mockito:1.2') {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:23.4.0'
implementation 'com.android.support:support-v13:23.4.0'
implementation 'com.android.support:design:23.4.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.karumi:dividers:1.0.3'
implementation 'com.victor:lib:1.0.1' // https://github.com/yankai-victor/Loading
implementation 'com.karumi:marvelapiclient:0.0.4'
implementation 'com.github.pedrovgs:renderers:3.0.0'
annotationProcessor 'com.jakewharton:butterknife:7.0.1'
implementation 'com.jakewharton:butterknife:7.0.1'
compileOnly 'com.squareup.dagger:dagger-compiler:1.2.2'
annotationProcessor 'com.squareup.dagger:dagger-compiler:1.2.2'
implementation project(':rosie')

androidTestImplementation 'com.google.dexmaker:dexmaker:1.2'
androidTestImplementation('com.google.dexmaker:dexmaker-mockito:1.2') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
androidTestCompile 'com.android.support.test:runner:0.4.1'
androidTestCompile 'com.android.support.test:rules:0.4.1'
androidTestCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.1') {
androidTestImplementation 'com.android.support.test:runner:0.4.1'
androidTestImplementation 'com.android.support.test:rules:0.4.1'
androidTestImplementation 'org.mockito:mockito-core:1.10.19'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.1') {
exclude group: 'javax.inject', module: 'javax.inject'
exclude group: 'com.squareup', module: 'javawriter'
}
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.1') {
androidTestImplementation('com.android.support.test.espresso:espresso-contrib:2.2.1') {
exclude module: 'support-annotations'
exclude module: 'recyclerview-v7'
exclude module: 'support-v4'
}
androidTestCompile('com.android.support.test.espresso:espresso-intents:2.2.1')
androidTestImplementation('com.android.support.test.espresso:espresso-intents:2.2.1')
}

configurations.all {
Expand Down

0 comments on commit db01788

Please sign in to comment.