Browse Source

use higher sdk only for lint

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 4 years ago
parent
commit
e4c7e22c59
1 changed files with 5 additions and 2 deletions
  1. 5 2
      build.gradle

+ 5 - 2
build.gradle

@@ -90,13 +90,16 @@ def versionMinor = 15
 def versionPatch = 0
 def versionBuild = 0 // 0-50=Alpha / 51-98=RC / 90-99=stable
 
+def testMinSdk = 21
 for (TaskExecutionRequest tr : getGradle().getStartParameter().getTaskRequests()) {
     for (String arg : tr.args) {
         // any gplay, but only exact "build", as e.g. buildGeneric shall not apply gplay.grade
         if (arg.contains("Gplay") || arg.contains("lint") || arg.contains("ExecuteScreenshot") || arg == "build") {
             apply from: 'gplay.gradle'
             System.console().println("Applying gplay.gradle")
-            break
+        }
+        if (arg.contains("lint")) {
+            testMinSdk = 19
         }
     }
 }
@@ -189,7 +192,7 @@ android {
         testOptions {
             unitTests.returnDefaultValues = true
             animationsDisabled true
-            minSdkVersion 21
+            minSdkVersion testMinSdk
         }
     }