theHacker
theHacker

Reputation: 4043

Is it possible to suppress warnings in a specific directory?

In my project I had to copy a library into my source to make some minor adjustments. This library throws a couple of warnings when compiling. I don't like that ;-)

Since I don't want to change the library code any more than absolutely necessary, I do not want to put @Suppress lines into the library code.

Is there a possability to advise the compiler "Please ignore warnings, but only in src/foo/bar"? Maybe a compiler flag?
I am using a Gradle build, if that opens additional options.

Upvotes: 1

Views: 750

Answers (1)

Cisco
Cisco

Reputation: 23052

foo.bar is a package and packages can not be suppressed.

Your options are:

  1. Remove compiler warnings entirely
  2. Create separate source set and compile task for the problematic code.
  3. Fix the warnings.

Upvotes: 1

Related Questions