From e3f713aae157c65af231b1417bea1f8259b8294e Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 1 Mar 2020 23:47:39 -0800 Subject: Avoid version check on travis --- app/build.gradle | 26 ++++++++++++---------- .../frost/activities/ImageActivityTest.kt | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) (limited to 'app') diff --git a/app/build.gradle b/app/build.gradle index 197fe10f..fde143ad 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,18 +40,20 @@ android { versionName '2.4.4' // versionName androidGitVersion.name() - // Verification for F-Droid builds - if (versionCode != androidGitVersion.code()) { - throw new GradleException("Version code mismatch, expected ${androidGitVersion.code()}, got $versionCode") - } - if (versionName != androidGitVersion.name()) { - throw new GradleException("Version name mismatch, expected ${androidGitVersion.name()}, got $versionName") - } - multiDexEnabled true - testInstrumentationRunner "com.pitchedapps.frost.FrostTestRunner" - javaCompileOptions { - annotationProcessorOptions { - arguments = ["room.schemaLocation": "$projectDir/src/schemas".toString()] + if (System.getenv('TRAVIS') != 'true') { + // Verification for F-Droid builds + if (versionCode != androidGitVersion.code()) { + throw new GradleException("Version code mismatch, expected ${androidGitVersion.code()}, got $versionCode") + } + if (versionName != androidGitVersion.name()) { + throw new GradleException("Version name mismatch, expected ${androidGitVersion.name()}, got $versionName") + } + multiDexEnabled true + testInstrumentationRunner "com.pitchedapps.frost.FrostTestRunner" + javaCompileOptions { + annotationProcessorOptions { + arguments = ["room.schemaLocation": "$projectDir/src/schemas".toString()] + } } } } diff --git a/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt b/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt index b582baf6..a23cac0b 100644 --- a/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt +++ b/app/src/androidTest/kotlin/com/pitchedapps/frost/activities/ImageActivityTest.kt @@ -28,6 +28,7 @@ import com.pitchedapps.frost.utils.ARG_TEXT import com.pitchedapps.frost.utils.isIndirectImageUrl import kotlin.test.assertEquals import kotlin.test.assertFalse +import kotlin.test.assertNotNull import kotlin.test.assertNull import kotlin.test.assertTrue import okhttp3.internal.closeQuietly @@ -45,7 +46,6 @@ import org.junit.rules.RuleChain import org.junit.rules.TestRule import org.junit.rules.Timeout import org.junit.runner.RunWith -import kotlin.test.assertNotNull @RunWith(AndroidJUnit4::class) class ImageActivityTest { -- cgit v1.2.3