android 用 ant 進行 build. android sdk 下面的 tools/ant 下面的 build.xml 就是 build 的整個過程。
其中的 build 參數可在 ant.properties 文件中進行 override。也可以自己定制 build 的腳本。
用 ant build 非常簡單
1)安裝 ant 並加入到系統 path 變量中
2)為項目生成 build.xml
android update project -p .
3)生成 debug 版本
ant debug
4) 如果要生成 release 版本需要提供 keystore 進行簽名
在項目根目錄新建 ant.properties 文件,在里面配置 keystore 的路徑
key.store=path/to/my/keystore key.alias=alias_name key.store.password=111111 key.alias.password=111111
5) 運行 ant release 即可生成具有簽名信息的 apk
ant release
注意項目中引用的 library 庫也要用 ant build 需要先生成 build.xml
上面就是官方文檔中整個的 build 過程, 如果想做持續集成基本就是上面的思路
官方文檔 :
http://developer.android.com/tools/building/index.html
http://developer.android.com/tools/building/building-cmdline.html