From 149c6be1bfd4bd84381757940fece1be7b9801aa Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 31 Dec 2018 18:57:28 -0500 Subject: Enhancement/coroutines (#1273) * Convert rest of fbcookie to suspended methods * Replace active checks with yield * Apply spotless * Switch cookie domain to exact url * Optimize imports and enable travis tests again * Update proguard rules * Remove unnecessary yield * Remove unused flyweight * Remove unused disposable and method * Use contexthelper instead of dispatcher main * Convert login activity to coroutines * Use kau helper methods for coroutines * Enhancement/offline site (#1288) * Begin conversion of offline site logic * Fix offline tests and add validation tests * Ignore cookie in jsoup if it is blank * Force load and zip to be in io * Use different zip files to fix tests * Log all test output * Do not log stdout * Allow test skip for fb offline --- app/build.gradle | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'app/build.gradle') diff --git a/app/build.gradle b/app/build.gradle index 23ba05d7..76e96599 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -90,6 +90,8 @@ android { } + def compilerArgs = ["-Xuse-experimental=kotlin.Experimental" /*, "-XXLanguage:+InlineClasses"*/] + buildTypes { debug { minifyEnabled false @@ -101,7 +103,7 @@ android { resValue "string", "frost_web", "Frost Web Debug" ext.enableBugsnag = false - kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlin.Experimental", "-XXLanguage:+InlineClasses"] + kotlinOptions.freeCompilerArgs += compilerArgs } releaseTest { minifyEnabled true @@ -138,9 +140,16 @@ android { targetCompatibility JavaVersion.VERSION_1_8 } - testOptions { - unitTests { - includeAndroidResources = true + testOptions.unitTests { + includeAndroidResources = true + // Don't throw runtime exceptions for android calls that are not mocked + returnDefaultValues = true + + // Always show the result of every unit test, even if it passes. + all { + testLogging { + events 'passed', 'skipped', 'failed', 'standardError' + } } } @@ -163,7 +172,6 @@ dependencies { androidTestImplementation kauDependency.espresso androidTestImplementation kauDependency.testRules androidTestImplementation kauDependency.testRunner - androidTestImplementation "com.squareup.okhttp3:mockwebserver:${OKHTTP}" testImplementation kauDependency.kotlinTest testImplementation "org.jetbrains.kotlin:kotlin-reflect:${KOTLIN}" @@ -232,9 +240,9 @@ dependencies { implementation "com.squareup.okhttp3:okhttp:${OKHTTP}" implementation "com.squareup.okhttp3:logging-interceptor:${OKHTTP}" + testImplementation "com.squareup.okhttp3:mockwebserver:${OKHTTP}" androidTestImplementation "com.squareup.okhttp3:mockwebserver:${OKHTTP}" - implementation "co.zsmb:materialdrawer-kt:${MATERIAL_DRAWER_KT}" implementation "com.bugsnag:bugsnag-android:${BUGSNAG}" -- cgit v1.2.3