Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Update project to use Android Gradle plugin v3.x #55

Merged
merged 7 commits into from
Nov 3, 2017
Merged
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
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ jdk: oraclejdk8
android:
components:
- tools
- build-tools-25.0.2
- android-25
- build-tools-26.0.2
- android-26
- extra-android-m2repository
- extra
- addon
- sys-img-x86-android-19
# - sys-img-armabi-v7a-android-26
script:
- ./gradlew clean assemble test
deploy:
Expand All @@ -17,12 +17,12 @@ deploy:
github_token: $GITHUB_TOKEN
on:
branch: master
before_script:
- echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
./gradlew connectedAndroidTest;
fi
#before_script:
# - echo no | android create avd --force -n test -t android-26 --abi armeabi-v7a
# - emulator -avd test -no-skin -no-audio -no-window &
# - android-wait-for-emulator
# - adb shell input keyevent 82 &
#script:
# - if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
# ./gradlew connectedAndroidTest;
# fi
42 changes: 19 additions & 23 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,16 @@ buildscript {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}

apply plugin: 'android-apt'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
applicationId "com.mutualmobile.barricade.sample"
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -46,33 +41,34 @@ android {


dependencies {
compile "com.android.support:appcompat-v7:${SUPPORT_LIB_VERSION}"
compile "com.android.support:cardview-v7:${SUPPORT_LIB_VERSION}"
implementation "com.android.support:appcompat-v7:${SUPPORT_LIB_VERSION}"
implementation "com.android.support:cardview-v7:${SUPPORT_LIB_VERSION}"

compile project(':barricade')
apt project(':barricade-compiler')
implementation project(':barricade')
annotationProcessor project(':barricade-compiler')

compile "com.squareup.okhttp3:logging-interceptor:${OKHTTP_VERSION}"
implementation "com.squareup.okhttp3:logging-interceptor:${OKHTTP_VERSION}"

compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'

testCompile 'junit:junit:4.12'
testCompile 'com.google.truth:truth:0.31'
testImplementation 'junit:junit:4.12'
testImplementation 'com.google.truth:truth:0.35'

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIB_VERSION}"
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation "com.android.support:support-annotations:${SUPPORT_LIB_VERSION}"

androidTestCompile 'com.jakewharton.espresso:okhttp3-idling-resource:1.0.0'
androidTestCompile "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"
androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2') {
androidTestImplementation 'com.jakewharton.espresso:okhttp3-idling-resource:1.0.0'
androidTestImplementation "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"
androidTestImplementation('com.android.support.test.espresso:espresso-contrib:2.2') {
// Necessary to avoid version conflicts
exclude group: 'com.android.support', module: 'appcompat'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'support-annotations'
exclude module: 'recyclerview-v7'
}
compile project(path: ':barricade-annotations')
}


Expand Down
6 changes: 5 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
-keepattributes Exceptions

-dontwarn okhttp3.**
-dontwarn okio.**
-dontwarn retrofit2.**
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.mutualmobile.barricade.annotation.Barricade;
import com.mutualmobile.barricade.annotation.Response;
import com.mutualmobile.barricade.sample.api.model.Joke;

import retrofit2.Call;
import retrofit2.http.GET;

Expand Down
6 changes: 3 additions & 3 deletions barricade-compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ ext {
}

dependencies {
compile 'com.google.auto.service:auto-service:1.0-rc2'
compile 'com.squareup:javapoet:1.8.0'
implementation 'com.google.auto.service:auto-service:1.0-rc2'
implementation 'com.squareup:javapoet:1.9.0'

compile project(':barricade-annotations')
implementation project(':barricade-annotations')
}

apply from: '../bintray.gradle'
22 changes: 11 additions & 11 deletions barricade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ sourceCompatibility = 1.7
targetCompatibility = 1.7

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 26
buildToolsVersion '26.0.2'

defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName VERSION_NAME
vectorDrawables.useSupportLibrary = true
Expand All @@ -35,17 +35,17 @@ ext {
}

dependencies {
compile project(':barricade-annotations')
implementation project(':barricade-annotations')

compile "com.android.support:appcompat-v7:${SUPPORT_LIB_VERSION}"
compile "com.android.support:support-v4:${SUPPORT_LIB_VERSION}"
compile "com.android.support:recyclerview-v7:${SUPPORT_LIB_VERSION}"
implementation "com.android.support:appcompat-v7:${SUPPORT_LIB_VERSION}"
implementation "com.android.support:support-v4:${SUPPORT_LIB_VERSION}"
implementation "com.android.support:recyclerview-v7:${SUPPORT_LIB_VERSION}"

compile "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"
implementation "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"

androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIB_VERSION}"
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation "com.android.support:support-annotations:${SUPPORT_LIB_VERSION}"
}

apply from: '../bintray.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ okhttp3.Response getResponse(Interceptor.Chain chain, String endpoint) {
return null;
}
String fileResponse = getResponseFromFile(endpoint, barricadeResponse.responseFileName);
return new okhttp3.Response.Builder().code(barricadeResponse.statusCode)
return new okhttp3.Response.Builder().code(barricadeResponse.statusCode).message("Barricade OK")
.request(chain.request())
.protocol(Protocol.HTTP_1_0)
.body(ResponseBody.create(MediaType.parse(barricadeResponse.contentType), fileResponse.getBytes()))
Expand Down
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

Expand All @@ -16,6 +17,7 @@ buildscript {

allprojects {
repositories {
google()
jcenter()
}
}
Expand All @@ -25,6 +27,6 @@ task clean(type: Delete) {
}

ext {
OKHTTP_VERSION = "3.6.0"
SUPPORT_LIB_VERSION = "25.3.1"
OKHTTP_VERSION = "3.8.0"
SUPPORT_LIB_VERSION = "26.1.0"
}
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 @@
#Thu Mar 30 13:59:00 IST 2017
#Thu Oct 26 21:37:34 EDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip