操作指南
基础命令
查看版本
$ wing -v
查看帮助
$ wing -help
wing命令
配置工作空间
-space add {name} {host} [manifest]Config space host information
-spacePrint all the spcase information
# 本地索引模式
# wing -space add {space name} {git host}
# such as:
$ wing -space add test git@github.com/iofomo
$ wing -space add test2 ssh://git@192.168.1.250:1022
# 云端索引模式
# wing -space add {space name} {git host} {manifest}
# such as:
$ wing -space add test git@github.com/iofomo manifest.git
$ wing -space add test2 ssh://git@192.168.1.250:1022 manifest.git
# print app space info
$ wing -space
获取代码
init {workspace name} {branch or tag name} {manifest name}Create wing-space, such as:
wing init workspace1 develop dev.xml
wing init workspace2 tag_1.0 release.xml
$ wing init test master admin.xml
同步代码
同步代码组各git库代码:
sync [f] sync code from remote from manifests
f: Force switch to new branch, discard all local changes
# 安全同步,同步失败不做处理,当前分支和索引不一致不同步
$ wing sync
# 强制同步(谨慎使用,Jenkins默认启用),失败则同步终止,当前分支和索引不一致则终止
$ wing sync f
属性命令
-prop {s/set} {key} [value]Set key and value to wing property
-prop {g/get} {key}Get value from wing property
-propPrint all wing properties
# set
$ wing -prop s mvnusr xxx
# get
$ wing -prop g mvnusr
# print
$ wing -prop
Git封装命令
查看状态
-status Check if the local code has changed
$ wing -status
# output like this
.wing/wing master : `changes`
.wing/manifests main (nothing to commit)
pc/tinyui main (nothing to commit)
pc/mobtools dev_0.6 (nothing to commit)
android/konker main (nothing to commit)
server/homesite main (nothing to commit)
查看分支
-branch Check if the branch is consistent with the remote
$ wing -branch
# output like this
.wing/wing master (no changes)
.wing/manifests main (no changes)
pc/tinyui main (no changes)
pc/mobtools `dev_0.6 ≠ main(remote)`
android/konker main (no changes)
server/homesite main (no changes)
提交代码
-push [f] Push code to remote
f Directly push to the remote end without code review
# 提交代码至当前分支所在的远程分支,之后需要在Gerrit上进行Code-Review确认后才能入库
# git branch -vv
# git push origin HEAD:refs/for/${origin branch name}
$ wing -push
# 直接提交服务器,无需Code-Review
# git branch -vv
# git push origin HEAD:refs/heads/${origin branch name}
$ wing -push f
创建分支
基于某一原分支创建新分支。
-create b {new branch name} {base branch name}Create a new branch from the base or current branch
$ wing -create b release_1.0 main
创建标签
基于某一分支创建新tag。
-create t {new tag name} {base branch name} [tag message]Create a new tag from the base or current branch
$ wing -create t tag_v1.0 main
切换分支
将工作空间的代码库整体切换到指定的分支
-switch b {branch name}Switch all git libraries in the workspace to the target branch
$ wing -switch b release_1.0
切换标签
将工作空间的代码库整体切换到指定的tag
-switch t {tag name}Switch all git libraries in the workspace to the target tag
$ wing -switch t tag_v1.0
工具命令
tree工具
-tree [l] Print directory structure
l level of file directory depth
$ wing -tree
├── .DS_Store
├── .wing
│ └── space.json
└── doc.md
密钥工具
创建RSA密钥:
-key create {key type} {mode}create RSA public and private keys with 1024 or 2048(default) mode
$ wing -key create rsa 2048
查看密钥:
-key list {file} [pwd]print key/sign information for apk/ipa/mobileprovision/keystore/jks/rsa/... file
#【Android】查看安装包文件的签名信息
$ wing -key list com.demo.apk
#【Android】查看签名证书的信息,无密码,需要两次回车,即输入密码时忽略
$ wing -key list debug.keystore
#【Android】查看签名证书的信息,带密码
$ wing -key list debug.keystore 123456
#【iOS】查看安装包文件的签名信息(解析Payload/Demo.app/embedded.mobileprovision)
$ wing -key list demo.ipa
#【iOS】查看p12的签名信息
$ wing -key list debug.p12 xxxxxx 123456
#【iOS】查看签名文件信息
$ wing -key list embedded.mobileprovision
计算hash:
-key hash {file}print md5/sha256/hash/... of file
$ wing -key hash /Users/xxx/test.txt
