lint.xml file can not be found when i move it from module directory to project directory

Viewed 204

I have an lint.xml file and want to apply it to whole project but not only one module. It can't be found when i move it from module dir to project dir.

This is my config about lintOptions in build.gradle from module

  lintOptions {
        checkReleaseBuilds false
        abortOnError false
        lintConfig file("../lint.xml")
    }

and my lint.xml file is under project dir.(same dir as settings.gradle)

1 Answers

I don't know why it's not working exactly, but maybe you have to copy it to module directory anyway?

def copyLintFile(path) {
    from file(path)
    into file("lint.xml")
    file("lint.xml")
}

lintOptions {
        checkReleaseBuilds false
        abortOnError false
        lintConfig copyLintFile("../lint.xml")
    }

Related