本文主要是介绍关于make update-api命令,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
关于make update-api命令
何时需要执行make update-api命令
- 添加系统API或者修改@hide的API后,需要执行
make update-api,然后再make - 修改公共api后,需要
make update-api
1.在修改完系统Api或部分公共Api后(常见于修改Intent.java、KeyEvent.java等等),执行源码编译时会有如下提示
see build/core/apicheck_msg_current.txt
******************************
You have tried to change the API from what has been previously approved.To make these errors go away, you have two choices:1) You can add "@hide" javadoc comments to the methods, etc. listed in theerrors above.2) You can update current.txt by executing the following command:make update-apiTo submit the revised current.txt to the main Android repository,you will need approval.
******************************
2.错误信息表明是由于API错误导致
谷歌对于所有的类和API,分为开方和非开放两种,而开放的类和API,可以通过“Javadoc标签”与源码同步生成“程序的开发文档”;当我们修改或者添加一个新的API时,我们有两种方案可以避免出现上述错误.
- 其一是将该接口加上 非公开的标签:/*{@hide}/;
- 再者可以在修改后执行:make update-api(公开),将修改内容与API的doc文件更新到一致。
3.解决办法:
- 执行: make update -api ;
- 修改后相应API文件后,在base库下面会产生“.current.txt”文件的差异,提交时将该差异一并提交审核即可。
这篇关于关于make update-api命令的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!