2

I'm using NewerVersionAvailable lint check to determine newer dependencies versions. But it looks like that this check is useful only for implementation dependencies. I think we don't need to update junit anytime soon. How to disable this check for separate dependency type? It is boring to add //noinspection to each testImplementation dependency. Example given:

dependencies { // should warn implementation 'com.android.support:support-annotations:25.0.0' // shouldn't warn testImplementation 'junit:junit:4.12' } 
2
  • How you added check "NewerVersionAvailable". Please post code Commented Nov 7, 2016 at 12:03
  • @SagarTrehan. Updated. Thanks Commented Nov 7, 2016 at 13:06

3 Answers 3

3

One should better disable the check for individual dependencies, simply because then one would still be notified of any further outdated libraries:

<issue id="NewerVersionAvailable"> <ignore regexp="junit:junit*"/> </issue> 

With such a pattern: junit:junit* one can ignore individual dependencies - and one can ignore whole dependency-groups with such a pattern: junit:*.

This still needs to be combined with //noinspection GradleDependency, because lint and the IDE's code-inspection are not the same thing.

Sign up to request clarification or add additional context in comments.

Comments

0

You can create a configuration file for lint inside your project and add this line to it, likes below:

<lint> ... <issue id="NewerVersionAvailable" severity="ignore" /> ... </lint> 

1 Comment

This doesn't answer the question, because it would ignore all the warnings.
0

If linting error was thrown in any library you that are not owned (flutter, react-native, etc) rules you specify in app/build.gradle will be ignored.

The way you could ignore them is to put block like this into /build.gradle in the root of the project.

allprojects { ... afterEvaluate { if (getPlugins().hasPlugin('android') || getPlugins().hasPlugin('android-library')) { configure(android.lintOptions) { disable 'MissingPermission', 'NewerVersionAvailable' } } } ... } 

It will apply specified rules to your project dependencies.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.