Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle: List deprecated features

I am getting a warning about the usage of deprecated features in my build.
Is there a way to list all the deprecated features so that I may go through and update my code?

*clarification

I know I can go to the Gradle documentation and see what is now deprecated, what I would specifically like is a way to go through MY code and list MY deprecated features.

like image 612
Ed Dunn Avatar asked Mar 15 '18 16:03

Ed Dunn


3 Answers

I just faced the exact same problem and running the Gradle build task every time through the command line wasn't the best option for me because, during development, I usually just use the built-in Gradle build task run, so:

I know I can go to the Gradle documentation and see what is now deprecated, what I would specifically like is a way to go through MY code and list out MY deprecated features.

You can do this by adding the mentioned --warning-mode=all flag to your gradle command line options in your Android Studio settings:

enter image description here This will print the proper warnings for you to be aware of what are the specific deprecated features your app is using.

Also, I know you asked this near a year ago, but, it might be useful for other people facing the same issue.

like image 170
Hugo Allexis Cardona Avatar answered Sep 23 '22 16:09

Hugo Allexis Cardona


In order to change the warning verbosity level in the Android Studio IDE, you can add the option org.gradle.warning.mode=(all,none,summary) to the gradle.properties file, which can be found in the root directory of your project.

Add following line to set the warning mode to all:

... org.gradle.warning.mode=all ... 
like image 25
tangens Avatar answered Sep 25 '22 16:09

tangens


Use Gradle option -Dorg.gradle.warning.mode=(all,none,summary) to control verbosity, for example, mode all will log all warnings with detailed descriptions:

./gradlew build -Dorg.gradle.warning.mode=all

More details can be found in the official documentation: Showing or hiding warnings

like image 43
VaL Avatar answered Sep 25 '22 16:09

VaL