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

Update gradle #97

Open
wants to merge 5 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
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
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,25 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:3.1.3'
}
}

ext {
projectMinSdkVersion = 14
projectCompileSdkVersion = 27
projectTargetSdkVersion = 27
projectBuildTools = "27.0.3"
}

allprojects {
repositories {
mavenCentral()
google()
jcenter()
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
31 changes: 19 additions & 12 deletions rosie/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,33 @@ apply plugin: 'com.android.library'
apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion projectCompileSdkVersion
buildToolsVersion projectBuildTools

defaultConfig {
minSdkVersion 14
targetSdkVersion 23
minSdkVersion projectMinSdkVersion
targetSdkVersion projectTargetSdkVersion
}

testOptions {
unitTests.all {
systemProperty 'robolectric.enabledSdks', projectCompileSdkVersion
}
}
}

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'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know why the dagger dependency is added twice but I maintain them.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't remember why xD

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'
}

Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private static class OnErrorCallbackToErrorHandlerAdapter implements OnErrorCall
private final WeakReference<ErrorHandler> errorHandler;
private final WeakReference<OnErrorCallback> useCaseOnErrorCallback;

public OnErrorCallbackToErrorHandlerAdapter(ErrorHandler errorHandler,
private OnErrorCallbackToErrorHandlerAdapter(ErrorHandler errorHandler,
OnErrorCallback useCaseOnErrorCallback) {
this.errorHandler = new WeakReference<>(errorHandler);
this.useCaseOnErrorCallback = new WeakReference<>(useCaseOnErrorCallback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class UseCaseWrapperJob extends Job {
private static final int PRIORITY_NORMAL = 3;
private final UseCaseWrapper useCaseWrapper;

public UseCaseWrapperJob(UseCaseWrapper useCaseWrapper) {
UseCaseWrapperJob(UseCaseWrapper useCaseWrapper) {
super(new Params(PRIORITY_NORMAL));
this.useCaseWrapper = useCaseWrapper;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ private class NoUseCase extends RosieUseCase {

private class EmptyResponseUseCase extends RosieUseCase {

public EmptyResponseUseCase() {
private EmptyResponseUseCase() {
setCallbackScheduler(new FakeCallbackScheduler());
}

Expand All @@ -416,7 +416,7 @@ public EmptyResponseUseCase() {

private class ErrorUseCase extends RosieUseCase {

public ErrorUseCase() {
private ErrorUseCase() {
setCallbackScheduler(new FakeCallbackScheduler());
}

Expand All @@ -431,12 +431,12 @@ public ErrorUseCase() {

private class SuccessUseCase extends RosieUseCase {

public SuccessUseCase() {
private SuccessUseCase() {
setCallbackScheduler(new FakeCallbackScheduler());
}

@UseCase public void execute() {
notifySuccess();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private RosiePresenter givenARosiePresenterWithRegisteredCallback() {

private static class RosiePresenterWithRegisteredCallback extends RosiePresenter
implements OnErrorCallback {
public RosiePresenterWithRegisteredCallback(UseCaseHandler useCaseHandler) {
private RosiePresenterWithRegisteredCallback(UseCaseHandler useCaseHandler) {
super(useCaseHandler);
registerOnErrorCallback(this);
}
Expand Down
52 changes: 27 additions & 25 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ def getPrivateMarvelKey() {
def preDexEnabled = "true".equals(System.getProperty("pre-dex", "true"))

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion projectCompileSdkVersion
buildToolsVersion projectBuildTools

dexOptions {
preDexLibraries = preDexEnabled
}

defaultConfig {
applicationId "com.karumi.rosie.sample"
minSdkVersion 18
targetSdkVersion 23
minSdkVersion projectMinSdkVersion
targetSdkVersion projectTargetSdkVersion
versionCode 1
versionName "1.0"
buildConfigField "String", "MARVEL_PUBLIC_KEY", getPublicMarvelKey()
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

class CharacterDataSourceFactory {

@Inject public CharacterDataSourceFactory() {
@Inject CharacterDataSourceFactory() {
}

PaginatedReadableDataSource<String, Character> createDataSource() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class ComicSeriesDataSourceFactory {

@Inject public ComicSeriesDataSourceFactory() {
@Inject ComicSeriesDataSourceFactory() {
}

ComicSeriesDataSource createDataSource() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public void addFragment(Fragment fragment, String pageTitle) {

private static class ViewPagerFragmentHolder {
public final Fragment fragment;
public final String pageTitle;
private final String pageTitle;

public ViewPagerFragmentHolder(Fragment fragment, String pageTitle) {
private ViewPagerFragmentHolder(Fragment fragment, String pageTitle) {
this.fragment = fragment;
this.pageTitle = pageTitle;
}
Expand Down