Gradle:列出不推荐使用的功能 [英] Gradle: List deprecated features

查看:70
本文介绍了Gradle:列出不推荐使用的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在构建中收到有关已弃用功能的使用的警告.有没有办法列出所有不推荐使用的功能,以便我可以检查和更新我的代码?

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?

*说明

我知道我可以转到gradle文档中,看看现在不赞成使用的东西,我特别希望能通过我的代码并列出我不赞成使用的功能.

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.

推荐答案

我只是遇到了完全相同的问题,并且每次通过命令行运行Gradle构建任务对我来说都不是最佳选择,因为在开发过程中,我通常只使用内置的Gradle构建任务运行,所以:

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:

我知道我可以转到Gradle文档中,看看现在不赞成使用的东西,我特别想要的是一种检查我的代码并列出我不赞成使用的功能的方法.

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.

您可以通过在Android Studio设置的gradle命令行选项中添加提到的-warning-mode = all 标志来实现此目的:

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

这样会打印出适当的警告,以提醒您您的应用正在使用的特定不推荐使用的功能.

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.

这篇关于Gradle:列出不推荐使用的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆