From b83d79708185f0d8def1d3638fcc702305cd3fab Mon Sep 17 00:00:00 2001 From: Pablo Guardiola Date: Fri, 21 Jul 2017 14:03:37 +0200 Subject: [android] add lint using current baseline as starting point (#9318) --- platform/android/MapboxGLAndroidSDK/.gitignore | 2 + platform/android/MapboxGLAndroidSDK/build.gradle | 2 + .../MapboxGLAndroidSDK/lint/lint-baseline-ci.xml | 629 +++++ .../android/MapboxGLAndroidSDKTestApp/.gitignore | 2 + .../android/MapboxGLAndroidSDKTestApp/build.gradle | 2 + .../lint/lint-baseline-ci.xml | 2569 ++++++++++++++++++++ .../MapboxGLAndroidSDKWearTestApp/.gitignore | 2 + .../MapboxGLAndroidSDKWearTestApp/build.gradle | 2 + .../gradle-config.gradle | 2 +- .../lint/lint-baseline-ci.xml | 823 +++++++ platform/android/gradle-lint.gradle | 30 + 11 files changed, 4064 insertions(+), 1 deletion(-) create mode 100644 platform/android/MapboxGLAndroidSDK/.gitignore create mode 100644 platform/android/MapboxGLAndroidSDK/lint/lint-baseline-ci.xml create mode 100644 platform/android/MapboxGLAndroidSDKTestApp/.gitignore create mode 100644 platform/android/MapboxGLAndroidSDKTestApp/lint/lint-baseline-ci.xml create mode 100644 platform/android/MapboxGLAndroidSDKWearTestApp/.gitignore create mode 100644 platform/android/MapboxGLAndroidSDKWearTestApp/lint/lint-baseline-ci.xml create mode 100644 platform/android/gradle-lint.gradle (limited to 'platform') diff --git a/platform/android/MapboxGLAndroidSDK/.gitignore b/platform/android/MapboxGLAndroidSDK/.gitignore new file mode 100644 index 0000000000..cec211fe81 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/.gitignore @@ -0,0 +1,2 @@ +lint-baseline.xml +lint/lint-baseline-local.xml \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle index 8b92fa1af2..0cb6e529f1 100644 --- a/platform/android/MapboxGLAndroidSDK/build.gradle +++ b/platform/android/MapboxGLAndroidSDK/build.gradle @@ -116,6 +116,7 @@ android { } lintOptions { + baseline file("lint-baseline.xml") checkAllWarnings true warningsAsErrors true } @@ -152,3 +153,4 @@ apply from: 'gradle-javadoc.gradle' apply from: 'gradle-publish.gradle' apply from: 'gradle-checkstyle.gradle' apply from: 'gradle-tests-staticblockremover.gradle' +apply from: '../gradle-lint.gradle' diff --git a/platform/android/MapboxGLAndroidSDK/lint/lint-baseline-ci.xml b/platform/android/MapboxGLAndroidSDK/lint/lint-baseline-ci.xml new file mode 100644 index 0000000000..4dc8ecde70 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/lint/lint-baseline-ci.xml @@ -0,0 +1,629 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/platform/android/MapboxGLAndroidSDKTestApp/.gitignore b/platform/android/MapboxGLAndroidSDKTestApp/.gitignore new file mode 100644 index 0000000000..cec211fe81 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/.gitignore @@ -0,0 +1,2 @@ +lint-baseline.xml +lint/lint-baseline-local.xml \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle index 656789fcdb..b13362751a 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle +++ b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle @@ -25,6 +25,7 @@ android { } lintOptions { + baseline file("lint-baseline.xml") checkAllWarnings true warningsAsErrors true disable 'MissingTranslation' @@ -84,5 +85,6 @@ apply from: 'gradle-config.gradle' apply from: 'gradle-device-farm.gradle' apply from: 'gradle-spoon.gradle' apply from: 'gradle-checkstyle.gradle' +apply from: '../gradle-lint.gradle' diff --git a/platform/android/MapboxGLAndroidSDKTestApp/lint/lint-baseline-ci.xml b/platform/android/MapboxGLAndroidSDKTestApp/lint/lint-baseline-ci.xml new file mode 100644 index 0000000000..89eab70c48 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/lint/lint-baseline-ci.xml @@ -0,0 +1,2569 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/platform/android/MapboxGLAndroidSDKWearTestApp/.gitignore b/platform/android/MapboxGLAndroidSDKWearTestApp/.gitignore new file mode 100644 index 0000000000..cec211fe81 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKWearTestApp/.gitignore @@ -0,0 +1,2 @@ +lint-baseline.xml +lint/lint-baseline-local.xml \ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKWearTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKWearTestApp/build.gradle index 6ac8961421..7c3ffd8ce5 100644 --- a/platform/android/MapboxGLAndroidSDKWearTestApp/build.gradle +++ b/platform/android/MapboxGLAndroidSDKWearTestApp/build.gradle @@ -13,6 +13,7 @@ android { } lintOptions { + baseline file("lint-baseline.xml") disable 'MissingTranslation' } @@ -48,3 +49,4 @@ dependencies { apply from: 'gradle-config.gradle' apply from: 'gradle-checkstyle.gradle' +apply from: '../gradle-lint.gradle' diff --git a/platform/android/MapboxGLAndroidSDKWearTestApp/gradle-config.gradle b/platform/android/MapboxGLAndroidSDKWearTestApp/gradle-config.gradle index 27c13b935b..1068e5e69e 100644 --- a/platform/android/MapboxGLAndroidSDKWearTestApp/gradle-config.gradle +++ b/platform/android/MapboxGLAndroidSDKWearTestApp/gradle-config.gradle @@ -3,7 +3,7 @@ // task accessToken { - def tokenFile = new File("MapboxGLAndroidSDKWearTestApp/src/main/res/values/developer-config.xml") + def tokenFile = new File("${projectDir}/src/main/res/values/developer-config.xml") if (!tokenFile.exists()) { String tokenFileContents = "\n" + "\n" + diff --git a/platform/android/MapboxGLAndroidSDKWearTestApp/lint/lint-baseline-ci.xml b/platform/android/MapboxGLAndroidSDKWearTestApp/lint/lint-baseline-ci.xml new file mode 100644 index 0000000000..de038e3bcc --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKWearTestApp/lint/lint-baseline-ci.xml @@ -0,0 +1,823 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 -- cgit v1.2.1