Skip to content

Commit

Permalink
Merge branch 'development' into sort
Browse files Browse the repository at this point in the history
  • Loading branch information
iamareebjamal authored Mar 29, 2018
2 parents 30f85a9 + e91d338 commit 23d8ad6
Show file tree
Hide file tree
Showing 62 changed files with 754 additions and 362 deletions.
10 changes: 8 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ jobs:
key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
- run:
name: Run Tests
command: ./gradlew lint test
command: ./gradlew lint androidCheck androidPmd
- run:
name: Test Coverage
command: ./gradlew testDebugUnitTestCoverage
- store_artifacts:
path: app/build/reports
destination: reports
- store_artifacts:
path: app/build/outputs
destination: outputs
- store_test_results:
path: app/build/test-results
path: app/build/test-results
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ install:
script:
- ./gradlew build
- ./gradlew testDebugUnitTestCoverage
after_failure:
# tests
- cat app/build/reports/tests/testDebugUnitTest/index.html

# app
- cat app/build/reports/lint-results.xml
- cat app/build/reports/lint-results.html
after_success:
- bash <(curl -s https://codecov.io/bash)
- bash scripts/prep-key.sh
Expand Down
111 changes: 58 additions & 53 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apply plugin: 'com.android.application'
apply plugin: 'io.sentry.android.gradle'
apply plugin: 'com.noveogroup.android.check'
apply from: './jacoco.gradle'
def versions = {}
apply from: project(':app').file('config.gradle'), to: versions

def app_name = System.getenv('app_name') ?: "eventyay organizer"
def GOOGLE_PLACES_API_KEY = System.getenv('GOOGLE_PLACES_API_KEY') ?: "YOUR_API_KEY"
Expand All @@ -18,12 +16,12 @@ android {
exclude 'META-INF/LICENSE'
}

compileSdkVersion versions.compileSdkVersion
buildToolsVersion versions.buildToolsVersion
compileSdkVersion versions.compileSdk
buildToolsVersion versions.buildTools
defaultConfig {
applicationId "org.fossasia.eventyay"
minSdkVersion versions.minSdkVersion
targetSdkVersion versions.targetSdkVersion
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
versionCode 4
versionName "1.0.3alpha"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -96,57 +94,64 @@ configurations.all { config ->
}

check {
abortOnError true
findbugs {
abortOnError false
}
abortOnError false
findbugs { skip true }
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

// Support Lib
implementation 'com.android.support:multidex:1.0.3'
implementation "com.android.support:appcompat-v7:${versions.support_lib_version}"
implementation "com.android.support:cardview-v7:${versions.support_lib_version}"
implementation "com.android.support:recyclerview-v7:${versions.support_lib_version}"
implementation "com.android.support:design:${versions.support_lib_version}"
implementation "com.android.support:palette-v7:${versions.support_lib_version}"
implementation "com.takisoft.fix:preference-v7:${versions.support_lib_version}.0"
implementation "com.google.android.gms:play-services-vision:${versions.play_services_version}"
implementation "com.google.android.gms:play-services-places:${versions.play_services_version}"
implementation "com.android.support:appcompat-v7:${versions.support_lib}"
implementation "com.android.support:cardview-v7:${versions.support_lib}"
implementation "com.android.support:recyclerview-v7:${versions.support_lib}"
implementation "com.android.support:design:${versions.support_lib}"
implementation "com.android.support:palette-v7:${versions.support_lib}"
implementation "com.takisoft.fix:preference-v7:${versions.support_lib}.0"
implementation "com.google.android.gms:play-services-vision:${versions.play_services}"
implementation "com.google.android.gms:play-services-places:${versions.play_services}"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'

// Misc
implementation "com.jakewharton.timber:timber:${versions.timber_version}"
implementation "com.evernote:android-job:${versions.android_job_version}"
implementation "com.jakewharton.timber:timber:${versions.timber}"
implementation "com.evernote:android-job:${versions.android_job}"
implementation 'com.mikhaellopez:circularprogressbar:1.1.1'
implementation 'com.github.Ilhasoft:data-binding-validator:1.0.0'
implementation "io.sentry:sentry-android:${versions.sentry_android_version}"
implementation "com.github.PhilJay:MPAndroidChart:${versions.mpAndroidChartVersion}"
implementation "io.sentry:sentry-android:${versions.sentry_android}"
implementation "com.github.PhilJay:MPAndroidChart:${versions.mp_android_chart}"
compileOnly 'com.google.code.findbugs:findbugs-annotations:3.0.1'

// Lifecycle
implementation "android.arch.lifecycle:runtime:$versions.lifecycle"
implementation "android.arch.lifecycle:extensions:$versions.lifecycle"
implementation "android.arch.lifecycle:common-java8:$versions.lifecycle"
annotationProcessor "android.arch.lifecycle:compiler:$versions.lifecycle"

// DbFlow
implementation "com.github.raizlabs.dbflow:dbflow-core:${versions.dbflow_version}"
implementation "com.github.raizlabs.dbflow:dbflow:${versions.dbflow_version}"
implementation "com.github.raizlabs.dbflow:dbflow-rx2:${versions.dbflow_version}"
annotationProcessor "com.github.raizlabs.dbflow:dbflow-processor:${versions.dbflow_version}"
implementation "com.github.raizlabs.dbflow:dbflow-core:${versions.dbflow}"
implementation "com.github.raizlabs.dbflow:dbflow:${versions.dbflow}"
implementation "com.github.raizlabs.dbflow:dbflow-rx2:${versions.dbflow}"
annotationProcessor "com.github.raizlabs.dbflow:dbflow-processor:${versions.dbflow}"

// Dagger
implementation "com.google.dagger:dagger:${versions.dagger_version}"
annotationProcessor "com.google.dagger:dagger-compiler:${versions.dagger_version}"
implementation "com.google.dagger:dagger:${versions.dagger}"
implementation "com.google.dagger:dagger-android:${versions.dagger}"
implementation "com.google.dagger:dagger-android-support:${versions.dagger}"
annotationProcessor "com.google.dagger:dagger-compiler:${versions.dagger}"
annotationProcessor "com.google.dagger:dagger-android-processor:${versions.dagger}"

// Retrofit
implementation "com.squareup.okhttp3:okhttp:${versions.okhttp_version}"
implementation "com.squareup.retrofit2:retrofit:${versions.retrofit_version}"
implementation "com.squareup.retrofit2:converter-jackson:${versions.retrofit_version}"
implementation "com.squareup.retrofit2:adapter-rxjava2:${versions.retrofit_version}"
implementation "com.squareup.okhttp3:okhttp:${versions.okhttp}"
implementation "com.squareup.retrofit2:retrofit:${versions.retrofit}"
implementation "com.squareup.retrofit2:converter-jackson:${versions.retrofit}"
implementation "com.squareup.retrofit2:adapter-rxjava2:${versions.retrofit}"
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.github.jasminb:jsonapi-converter:0.8.1'

// RxJava
implementation "io.reactivex.rxjava2:rxandroid:${versions.rxandroid_version}"
implementation "io.reactivex.rxjava2:rxjava:${versions.rxjava_version}"
implementation "io.reactivex.rxjava2:rxandroid:${versions.rxandroid}"
implementation "io.reactivex.rxjava2:rxjava:${versions.rxjava}"
implementation 'com.f2prateek.rx.preferences2:rx-preferences:2.0.0-RC3'

// Fast Adapter
Expand All @@ -161,33 +166,33 @@ dependencies {
implementation ("com.github.florent37:glidepalette:2.1.0") {
transitive = false
}
implementation "com.github.bumptech.glide:glide:${versions.glide_version}"
implementation "com.github.bumptech.glide:okhttp3-integration:${versions.glide_version}"
annotationProcessor "com.github.bumptech.glide:compiler:${versions.glide_version}"
implementation "com.github.bumptech.glide:glide:${versions.glide}"
implementation "com.github.bumptech.glide:okhttp3-integration:${versions.glide}"
annotationProcessor "com.github.bumptech.glide:compiler:${versions.glide}"

// ThreeTen
implementation "com.jakewharton.threetenabp:threetenabp:${versions.threetenbp_version}"
implementation "com.jakewharton.threetenabp:threetenabp:${versions.threetenbp}"
testImplementation 'org.threeten:threetenbp:1.3.6'

// Leak Canary
debugImplementation "com.squareup.leakcanary:leakcanary-android:${versions.leak_canary_version}"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:${versions.leak_canary_version}"
debugImplementation "com.squareup.leakcanary:leakcanary-android:${versions.leak_canary}"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:${versions.leak_canary}"

// Stetho
debugImplementation "com.facebook.stetho:stetho:${versions.stetho_version}"
debugImplementation "com.facebook.stetho:stetho-okhttp3:${versions.stetho_version}"
releaseImplementation "net.igenius:stetho-no-op:${versions.stetho_no_op_version}"
testImplementation "net.igenius:stetho-no-op:${versions.stetho_no_op_version}"
debugImplementation "com.facebook.stetho:stetho:${versions.stetho}"
debugImplementation "com.facebook.stetho:stetho-okhttp3:${versions.stetho}"
releaseImplementation "net.igenius:stetho-no-op:${versions.stetho_no_op}"
testImplementation "net.igenius:stetho-no-op:${versions.stetho_no_op}"

// Butterknife
implementation "com.jakewharton:butterknife:${versions.butterknife_version}"
annotationProcessor "com.jakewharton:butterknife-compiler:${versions.butterknife_version}"
implementation "com.jakewharton:butterknife:${versions.butterknife}"
annotationProcessor "com.jakewharton:butterknife-compiler:${versions.butterknife}"

// Lombok
compileOnly "org.projectlombok:lombok:${versions.lombokVersion}"
testCompileOnly "org.projectlombok:lombok:${versions.lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${versions.lombokVersion}"
testAnnotationProcessor "org.projectlombok:lombok:${versions.lombokVersion}"
compileOnly "org.projectlombok:lombok:${versions.lombok}"
testCompileOnly "org.projectlombok:lombok:${versions.lombok}"
annotationProcessor "org.projectlombok:lombok:${versions.lombok}"
testAnnotationProcessor "org.projectlombok:lombok:${versions.lombok}"

//Testing
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
Expand All @@ -196,7 +201,7 @@ dependencies {
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-inline:2.8.9'
testImplementation 'org.json:json:20160810'
testImplementation "org.robolectric:robolectric:${versions.roboelectric_version}"
testImplementation "org.robolectric:shadows-multidex:${versions.roboelectric_version}"
testImplementation "org.robolectric:shadows-supportv4:${versions.roboelectric_version}"
testImplementation "org.robolectric:robolectric:${versions.roboelectric}"
testImplementation "org.robolectric:shadows-multidex:${versions.roboelectric}"
testImplementation "org.robolectric:shadows-supportv4:${versions.roboelectric}"
}
28 changes: 0 additions & 28 deletions app/config.gradle

This file was deleted.

2 changes: 2 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

-dontwarn org.conscrypt.**

-dontwarn com.google.errorprone.**

-keep class org.fossasia.openevent.app.data.models.** {
*;
}
Expand Down
29 changes: 17 additions & 12 deletions app/src/main/java/org/fossasia/openevent/app/OrgaApplication.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.fossasia.openevent.app;

import android.app.Activity;
import android.content.Context;
import android.os.StrictMode;
import android.support.annotation.NonNull;
Expand All @@ -16,25 +17,30 @@
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;

import org.fossasia.openevent.app.common.di.component.AppComponent;
import org.fossasia.openevent.app.common.di.component.DaggerAppComponent;
import org.fossasia.openevent.app.common.di.module.AndroidModule;
import org.fossasia.openevent.app.common.di.AppInjector;
import org.fossasia.openevent.app.data.db.configuration.OrgaDatabase;

import java.util.concurrent.atomic.AtomicBoolean;

import javax.inject.Inject;

import dagger.android.AndroidInjector;
import dagger.android.DispatchingAndroidInjector;
import dagger.android.HasActivityInjector;
import io.sentry.Sentry;
import io.sentry.android.AndroidSentryClientFactory;
import io.sentry.event.BreadcrumbBuilder;
import timber.log.Timber;

public class OrgaApplication extends MultiDexApplication {
public class OrgaApplication extends MultiDexApplication implements HasActivityInjector {

private static final AtomicBoolean CREATED = new AtomicBoolean();

private static volatile AppComponent appComponent;
private RefWatcher refWatcher;

@Inject
DispatchingAndroidInjector<Activity> dispatchingAndroidInjector;

/**
* Reference watcher to be used in detecting leaks in Fragments
*
Expand All @@ -45,10 +51,6 @@ public static RefWatcher getRefWatcher(Context context) {
return ((OrgaApplication) context.getApplicationContext()).refWatcher;
}

public static AppComponent getAppComponent() {
return appComponent;
}

public static void initializeDatabase(Context context) {
FlowManager.init(new FlowConfig.Builder(context)
.addDatabaseConfig(
Expand All @@ -70,9 +72,7 @@ public void onCreate() {
if (CREATED.getAndSet(true))
return;

appComponent = DaggerAppComponent.builder()
.androidModule(new AndroidModule())
.build();
AppInjector.init(this);

if (isTestBuild())
return;
Expand Down Expand Up @@ -122,6 +122,11 @@ protected boolean isTestBuild() {
return false;
}

@Override
public AndroidInjector<Activity> activityInjector() {
return dispatchingAndroidInjector;
}

private static class ReleaseLogTree extends Timber.Tree {

@Override
Expand Down
Loading

0 comments on commit 23d8ad6

Please sign in to comment.