summaryrefslogtreecommitdiff
path: root/platform/android/gradle-lint.gradle
blob: cbebeaa74aa32a67159666086ecc1ddd657d3570 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
    }
}