소스 검색

override minSdk only when using Karumi

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 4 년 전
부모
커밋
0826398c06
4개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 0
      .drone.yml
  2. 4 2
      build.gradle
  3. 1 0
      scripts/androidScreenshotTest
  4. 1 0
      scripts/runAllScreenshotCombinations

+ 2 - 0
.drone.yml

@@ -185,6 +185,7 @@ steps:
       GIT_TOKEN:
         from_secret: GIT_TOKEN
       ORG_GRADLE_PROJECT_coverage: ''
+      ORG_GRADLE_PROJECT_screenshot: ''
     commands:
       - scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
       - emulator-headless -avd android-27 -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
@@ -239,6 +240,7 @@ steps:
       GIT_TOKEN:
         from_secret: GIT_TOKEN
       ORG_GRADLE_PROJECT_coverage: ''
+      ORG_GRADLE_PROJECT_screenshot: ''
     commands:
       - scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
       - emulator-headless -avd android-27 -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &

+ 4 - 2
build.gradle

@@ -27,7 +27,7 @@ buildscript {
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
         classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.14.2"
         classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
-        classpath 'com.karumi:shot:5.1.0'
+        classpath 'com.karumi:shot:5.3.0'
     }
 }
 
@@ -156,7 +156,9 @@ android {
         buildTypes {
             debug {
                 testCoverageEnabled (project.hasProperty('coverage'))
-                minSdkVersion 21 // remove once we use 21 globally, only needed for karumi.shot
+                if (project.hasProperty('screenshot')) {
+                    minSdkVersion 21 // remove once we use 21 globally, only needed for karumi.shot
+                }
             }
         }
 

+ 1 - 0
scripts/androidScreenshotTest

@@ -71,6 +71,7 @@ if [[ $4 = "all" ]]; then
     scripts/runAllScreenshotCombinations "noCI" "$1" "-Pandroid.testInstrumentationRunnerArguments.class=$class$method"
 else
     ./gradlew --offline gplayDebugExecuteScreenshotTests $record \
+    -Pscreenshot=true \
     -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest \
     -Pandroid.testInstrumentationRunnerArguments.class=$class$method \
     $darkMode \

+ 1 - 0
scripts/runAllScreenshotCombinations

@@ -22,6 +22,7 @@ do
     if [[ $1 = "noCI" ]]; then
         ./gradlew --console plain gplayDebugExecuteScreenshotTests \
         $record \
+        -Pscreenshot=true \
         -Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest \
         -Pandroid.testInstrumentationRunnerArguments.COLOR="$color" \
         -Pandroid.testInstrumentationRunnerArguments.DARKMODE="$darkMode" \