summaryrefslogtreecommitdiff
path: root/platform/android/gradle-lint.gradle
diff options
context:
space:
mode:
authorPablo Guardiola <guardiola31337@gmail.com>2017-07-21 14:03:37 +0200
committerGitHub <noreply@github.com>2017-07-21 14:03:37 +0200
commitb83d79708185f0d8def1d3638fcc702305cd3fab (patch)
treed4b974c35626cdf1d95533133cfaf930aaf87ceb /platform/android/gradle-lint.gradle
parentfb8d40ae6754ef1becd09cd91d45b1f980cf19e5 (diff)
downloadqtlocation-mapboxgl-b83d79708185f0d8def1d3638fcc702305cd3fab.tar.gz
[android] add lint using current baseline as starting point (#9318)
Diffstat (limited to 'platform/android/gradle-lint.gradle')
-rw-r--r--platform/android/gradle-lint.gradle30
1 files changed, 30 insertions, 0 deletions
diff --git a/platform/android/gradle-lint.gradle b/platform/android/gradle-lint.gradle
new file mode 100644
index 0000000000..cbebeaa74a
--- /dev/null
+++ b/platform/android/gradle-lint.gradle
@@ -0,0 +1,30 @@
+task ciLint(type: Copy) {
+ if (isLocalBuild()) {
+ from "${projectDir}/lint/lint-baseline-local.xml"
+ into "${projectDir}"
+ rename { String fileName ->
+ fileName.replace("lint-baseline-local.xml", "lint-baseline.xml")
+ }
+ } else {
+ from "${projectDir}/lint/lint-baseline-ci.xml"
+ into "${projectDir}"
+ rename { String fileName ->
+ fileName.replace("lint-baseline-ci.xml", "lint-baseline.xml")
+ }
+ }
+}
+
+def isLocalBuild() {
+ if (System.getenv('IS_LOCAL_DEVELOPMENT') != null) {
+ return System.getenv('IS_LOCAL_DEVELOPMENT').toBoolean()
+ }
+ return true
+}
+
+lint.dependsOn ciLint
+
+tasks.whenTaskAdded { task ->
+ if (task.name == 'lintVitalRelease') {
+ task.dependsOn ciLint
+ }
+} \ No newline at end of file