Gradle: fix check for gradle-related files
(cherry picked from commit 140b618)
IDEA-116087 Warning when using new wrapper.gradleVersion construction
(cherry picked from commit d3a81f0)