make update-api 的由來

     谷歌對於所有的類和API,分爲開放和非開放兩種,當我們修改framework目錄中的java文件時,比如添加API、刪除API、聲明變量,編譯器都需要我們決定API是開放還是非開放。

     對於開放的類和API,可以通過“Javadoc標籤”與源碼同步生成“程序的開發文檔”,方便開發者查看接口說明,同步生成“程序的開發文檔”的方法就是先執行  make update-api (編譯會修改文件 framework/base/api/current.txt),再執行大編譯 make -j4 。

     對於非開放的類和API,將該接口加上非公開的標籤:/**{@hide}*/

 

如果不做上述處理,在添加新API時會報如下錯誤:

******************************
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.
******************************

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章