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 the
      errors above.

   2) You can update current.txt by executing the following command:
         make update-api

      To submit the revised current.txt to the main Android repository,
      you will need approval.
******************************
 
 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
2.错误信息表明是由于API错误导致

谷歌对于所有的类和API,分为开方和非开放两种,而开放的类和API,可以通过“Javadoc标签”与源码同步生成“程序的开发文档”;当我们修改或者添加一个新的API时,我们有两种方案可以避免出现上述错误.

  • 其一是将该接口加上 非公开的标签:/*{@hide}/;
  • 再者可以在修改后执行:make update-api(公开),将修改内容与API的doc文件更新到一致。
3.解决办法:
  • 执行: make update -api ;
  • 修改后相应API文件后,在base库下面会产生“.current.txt”文件的差异,提交时将该差异一并提交审核即可。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值