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

Igor update.versions #96

Closed
wants to merge 21 commits into from
Closed
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
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ jdk: oraclejdk8

android:
components:
- build-tools-23.0.1
- android-21
# Update Android SDK Tools
- tools

- build-tools-23.0.2
- android-23

script:
./gradlew build
- ./gradlew build
44 changes: 22 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,45 @@ apply from: 'buildsystem/ci.gradle'
apply from: 'buildsystem/dependencies.gradle'

buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
classpath "com.fernandocejas.frodo:frodo-plugin:0.8.2"
}
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath "com.fernandocejas.frodo:frodo-plugin:0.8.2"
}
}

allprojects {
ext {
androidApplicationId = 'com.fernanependocejas.android10.sample.presentation'
androidVersionCode = 1
androidVersionName = "1.0"
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
testApplicationId = 'com.fernandocejas.android10.sample.presentation.test'
}
ext {
androidApplicationId = 'com.fernanependocejas.android10.sample.presentation'
androidVersionCode = 1
androidVersionName = "1.0"
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
testApplicationId = 'com.fernandocejas.android10.sample.presentation.test'
}
}

task wrapper(type: Wrapper) {
description 'Creates the gradle wrapper.'
gradleVersion '2.8'
description 'Creates the gradle wrapper.'
gradleVersion '2.10'
}

task runDomainUnitTests(dependsOn: [':domain:test']) {
description 'Run unit tests for the domain layer.'
description 'Run unit tests for the domain layer.'
}

task runDataUnitTests(dependsOn: [':data:cleanTestDebugUnitTest', ':data:testDebugUnitTest']) {
description 'Run unit tests for the data layer.'
description 'Run unit tests for the data layer.'
}

task runUnitTests(dependsOn: ['runDomainUnitTests', 'runDataUnitTests']) {
description 'Run unit tests for both domain and data layers.'
description 'Run unit tests for both domain and data layers.'
}

task runAcceptanceTests(dependsOn: [':presentation:connectedAndroidTest']) {
description 'Run application acceptance tests.'
description 'Run application acceptance tests.'
}

136 changes: 68 additions & 68 deletions buildsystem/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,82 +1,82 @@
allprojects {
repositories {
jcenter()
}
repositories {
jcenter()
}
}

ext {
//Android
androidBuildToolsVersion = "23.0.1"
androidMinSdkVersion = 15
androidTargetSdkVersion = 21
androidCompileSdkVersion = 21
//Android
androidBuildToolsVersion = "23.0.2"
androidMinSdkVersion = 15
androidTargetSdkVersion = 23
androidCompileSdkVersion = 23

//Libraries
daggerVersion = '2.0.2'
butterKnifeVersion = '7.0.1'
recyclerViewVersion = '21.0.3'
rxJavaVersion = '1.0.14'
rxAndroidVersion = '1.0.1'
javaxAnnotationVersion = '1.0'
gsonVersion = '2.3'
okHttpVersion = '2.5.0'
androidAnnotationsVersion = '21.0.3'
//Libraries
daggerVersion = '2.0.2'
butterKnifeVersion = '7.0.1'
recyclerViewVersion = '23.1.1'
rxJavaVersion = '1.0.14'
rxAndroidVersion = '1.0.1'
javaxAnnotationVersion = '1.0'
gsonVersion = '2.3'
okHttpVersion = '2.5.0'
androidAnnotationsVersion = '23.1.1'

//Testing
robolectricVersion = '3.0'
jUnitVersion = '4.12'
assertJVersion = '1.7.1'
mockitoVersion = '1.9.5'
dexmakerVersion = '1.0'
espressoVersion = '2.0'
testingSupportLibVersion = '0.1'
//Testing
robolectricVersion = '3.0'
jUnitVersion = '4.12'
assertJVersion = '1.7.1'
mockitoVersion = '1.9.5'
dexmakerVersion = '1.0'
espressoVersion = '2.0'
testingSupportLibVersion = '0.1'


presentationDependencies = [
daggerCompiler: "com.google.dagger:dagger-compiler:${daggerVersion}",
dagger: "com.google.dagger:dagger:${daggerVersion}",
butterKnife: "com.jakewharton:butterknife:${butterKnifeVersion}",
recyclerView: "com.android.support:recyclerview-v7:${recyclerViewVersion}",
rxJava: "io.reactivex:rxjava:${rxJavaVersion}",
rxAndroid: "io.reactivex:rxandroid:${rxAndroidVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
]
presentationDependencies = [
daggerCompiler : "com.google.dagger:dagger-compiler:${daggerVersion}",
dagger : "com.google.dagger:dagger:${daggerVersion}",
butterKnife : "com.jakewharton:butterknife:${butterKnifeVersion}",
recyclerView : "com.android.support:recyclerview-v7:${recyclerViewVersion}",
rxJava : "io.reactivex:rxjava:${rxJavaVersion}",
rxAndroid : "io.reactivex:rxandroid:${rxAndroidVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
]

presentationTestDependencies = [
mockito: "org.mockito:mockito-core:${mockitoVersion}",
dexmaker: "com.google.dexmaker:dexmaker:${dexmakerVersion}",
dexmakerMockito: "com.google.dexmaker:dexmaker-mockito:${dexmakerVersion}",
espresso: "com.android.support.test.espresso:espresso-core:${espressoVersion}",
testingSupportLib: "com.android.support.test:testing-support-lib:${testingSupportLibVersion}",
]
presentationTestDependencies = [
mockito : "org.mockito:mockito-core:${mockitoVersion}",
dexmaker : "com.google.dexmaker:dexmaker:${dexmakerVersion}",
dexmakerMockito : "com.google.dexmaker:dexmaker-mockito:${dexmakerVersion}",
espresso : "com.android.support.test.espresso:espresso-core:${espressoVersion}",
testingSupportLib: "com.android.support.test:testing-support-lib:${testingSupportLibVersion}",
]

domainDependencies = [
daggerCompiler: "com.google.dagger:dagger-compiler:${daggerVersion}",
dagger: "com.google.dagger:dagger:${daggerVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
rxJava: "io.reactivex:rxjava:${rxJavaVersion}",
]
domainDependencies = [
daggerCompiler : "com.google.dagger:dagger-compiler:${daggerVersion}",
dagger : "com.google.dagger:dagger:${daggerVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
rxJava : "io.reactivex:rxjava:${rxJavaVersion}",
]

domainTestDependencies = [
junit: "junit:junit:${jUnitVersion}",
mockito: "org.mockito:mockito-core:${mockitoVersion}",
]
domainTestDependencies = [
junit : "junit:junit:${jUnitVersion}",
mockito: "org.mockito:mockito-core:${mockitoVersion}",
]

dataDependencies = [
daggerCompiler: "com.google.dagger:dagger-compiler:${daggerVersion}",
dagger: "com.google.dagger:dagger:${daggerVersion}",
okHttp: "com.squareup.okhttp:okhttp:${okHttpVersion}",
gson: "com.google.code.gson:gson:${gsonVersion}",
rxJava: "io.reactivex:rxjava:${rxJavaVersion}",
rxAndroid: "io.reactivex:rxandroid:${rxAndroidVersion}",
javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
androidAnnotations: "com.android.support:support-annotations:${androidAnnotationsVersion}"
]
dataDependencies = [
daggerCompiler : "com.google.dagger:dagger-compiler:${daggerVersion}",
dagger : "com.google.dagger:dagger:${daggerVersion}",
okHttp : "com.squareup.okhttp:okhttp:${okHttpVersion}",
gson : "com.google.code.gson:gson:${gsonVersion}",
rxJava : "io.reactivex:rxjava:${rxJavaVersion}",
rxAndroid : "io.reactivex:rxandroid:${rxAndroidVersion}",
javaxAnnotation : "javax.annotation:jsr250-api:${javaxAnnotationVersion}",
androidAnnotations: "com.android.support:support-annotations:${androidAnnotationsVersion}"
]

dataTestDependencies = [
junit: "junit:junit:${jUnitVersion}",
assertj: "org.assertj:assertj-core:${assertJVersion}",
mockito: "org.mockito:mockito-core:${mockitoVersion}",
robolectric: "org.robolectric:robolectric:${robolectricVersion}",
]
dataTestDependencies = [
junit : "junit:junit:${jUnitVersion}",
assertj : "org.assertj:assertj-core:${assertJVersion}",
mockito : "org.mockito:mockito-core:${mockitoVersion}",
robolectric: "org.robolectric:robolectric:${robolectricVersion}",
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class UserCacheImpl implements UserCache {
*/
@Inject
public UserCacheImpl(Context context, JsonSerializer userCacheSerializer,
FileManager fileManager, ThreadExecutor executor) {
FileManager fileManager, ThreadExecutor executor) {
if (context == null || userCacheSerializer == null || fileManager == null || executor == null) {
throw new IllegalArgumentException("Invalid null parameter");
}
Expand Down Expand Up @@ -84,7 +84,7 @@ public UserCacheImpl(Context context, JsonSerializer userCacheSerializer,
if (!isCached(userEntity.getUserId())) {
String jsonString = this.serializer.serialize(userEntity);
this.executeAsynchronously(new CacheWriter(this.fileManager, userEntitiyFile,
jsonString));
jsonString));
setLastCacheUpdateTimeMillis();
}
}
Expand Down Expand Up @@ -134,15 +134,15 @@ private File buildFile(int userId) {
private void setLastCacheUpdateTimeMillis() {
long currentMillis = System.currentTimeMillis();
this.fileManager.writeToPreferences(this.context, SETTINGS_FILE_NAME,
SETTINGS_KEY_LAST_CACHE_UPDATE, currentMillis);
SETTINGS_KEY_LAST_CACHE_UPDATE, currentMillis);
}

/**
* Get in millis, the last time the cache was accessed.
*/
private long getLastCacheUpdateTimeMillis() {
return this.fileManager.getFromPreferences(this.context, SETTINGS_FILE_NAME,
SETTINGS_KEY_LAST_CACHE_UPDATE);
SETTINGS_KEY_LAST_CACHE_UPDATE);
}

/**
Expand Down Expand Up @@ -189,4 +189,4 @@ private static class CacheEvictor implements Runnable {
this.fileManager.clearDirectory(this.cacheDir);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public RestApiImpl(Context context, UserEntityJsonMapper userEntityJsonMapper) {
String responseUserEntities = getUserEntitiesFromApi();
if (responseUserEntities != null) {
subscriber.onNext(userEntityJsonMapper.transformUserEntityCollection(
responseUserEntities));
responseUserEntities));
subscriber.onCompleted();
} else {
subscriber.onError(new NetworkConnectionException());
Expand Down Expand Up @@ -111,10 +111,10 @@ private boolean isThereInternetConnection() {
boolean isConnected;

ConnectivityManager connectivityManager =
(ConnectivityManager) this.context.getSystemService(Context.CONNECTIVITY_SERVICE);
(ConnectivityManager) this.context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
isConnected = (networkInfo != null && networkInfo.isConnectedOrConnecting());

return isConnected;
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip