- 注册
- 2024/07/26
- 消息
- 677
说明
wing是一个代码同步管理工具类似repo,具有以下特性:- 支持Winddows 、Linux 、MacOS
- 支持代码同步和本地映射
- 扩展了针对工作空间的git命令
- 保留了原git命令
- 增加了更多常用开发工具,覆盖开发环境、代码检查、模板创建、开发调试、应用发布
开发计划
设计
开发空间(dev-space)
结构设计
范例
项目代码
以下为本项目的代码目录简要说明,工程比较简单便于大家快速上手。使用规范
manifest配置
manifest是指定不同的开发人员获取不同的代码库,但整个代码结构保持一致。确保团队开发人员之间,服务端编译(如:jenkins)开发环境均一致。通过初始化命令来获取代码索引(如:wing init iofomo master xxx.xml)manifest中的project对应的是服务端库,其格式如下。
<!-- path:本地相对目录名称 -->
<!-- name:远程库相对地址 -->
<!-- revision:为指定的库分支或标签,未配置则使用默认 default 中的值,若已配置则在整体创建分支或标签时保持不变 -->
<project path="platform/doc" name="platform/doc.git" revision="master" >
<!-- 将该库中src文件导出到本地目录下 -->
<copyfile dest="build.py" src="build.py"/>
</project>
admin code group
通常admin.xml记录本项目或产品所有的库,不作为实际开发使用,项目或技术负责人使用此索引,可以看到整个团队开发每日详情,便于管理和代码审查。<?xml version='1.0' encoding='UTF-8'?>
<manifest>
<remote name="origin" fetch=".."/>
<!-- branch -->
<default revision="master" remote="origin" sync-j="4"/>
<!-- doc -->
<project path="doc" name="project/iofomo/doc.git" />
<!-- platform: always with master -->
<project path="platform/doc" name="platform/doc.git" revision="master" />
<!-- Application -->
<project path="application/client" name="project/iofomo/client.git" />
<!-- Component -->
<project path="compt/common" name="platform/compt/common.git" />
<project path="compt/comm" name="platform/compt/comm.git" />
<project path="compt/uikit" name="platform/compt/uikit.git" />
<project path="compt/framework" name="platform/compt/framework.git" />
<!-- PC: always with master -->
<project path="pc/wing" name="platform/wing.git" />
<project path="pc/tinyui" name="platform/tinyui.git" />
<!-- Template: always with master -->
<project path="template/as" name="platform/template_as.git" revision="master" />
<project path="template/as_mts" name="platform/template_as_jni.git" revision="master" />
<project path="template/as_jar" name="platform/template_as_jar.git" revision="master" />
<project path="template/py" name="platform/template_py.git" revision="master" />
<!-- server -->
<project path="server/fomosite" name="project/iofomo/fomosite.git" />
<project path="server/web" name="project/iofomo/web.git" />
<project path="server/vue" name="project/iofomo/vue.git" />
<!-- Test -->
<project path="test/tools" name="platform/tools.git" revision="master" />
<project path="test/testBot" name="project/iofomo/testBot.git" />
<!-- build -->
<project path="build" name="project/iofomo/build">
<!--<copyfile dest="build.py" src="build.py"/>-->
</project>
</manifest>
pc code group
这是pc组代码索引配置,里面仅包含公共库和pc相关的代码库。<?xml version='1.0' encoding='UTF-8'?>
<manifest>
<remote name="origin" fetch=".."/>
<!-- branch -->
<default revision="master" remote="origin" sync-j="4"/>
<!-- doc -->
<project path="doc" name="project/iofomo/doc.git" />
<!-- platform: always with master -->
<project path="platform/doc" name="platform/doc.git" revision="master" />
<!-- PC: always with master -->
<project path="pc/wing" name="platform/wing.git" />
<project path="pc/tinyui" name="platform/tinyui.git" />
<!-- Test -->
<project path="test/tools" name="platform/tools.git" revision="master" />
<project path="test/testBot" name="project/iofomo/testBot.git" />
<!-- build -->
<project path="build" name="project/iofomo/build">
<!--<copyfile dest="build.py" src="build.py"/>-->
</project>
</manifest>
test code group
这是自动化测试开发组代码索引配置,里面仅包含公共库和test相关的代码库。<?xml version='1.0' encoding='UTF-8'?>
<manifest>
<remote name="origin" fetch=".."/>
<!-- branch -->
<default revision="master" remote="origin" sync-j="4"/>
<!-- doc -->
<project path="doc" name="project/iofomo/doc.git" />
<!-- platform: always with master -->
<project path="platform/doc" name="platform/doc.git" revision="master" />
<!-- Test -->
<project path="test/tools" name="platform/tools.git" revision="master" />
<project path="test/testBot" name="project/iofomo/testBot.git" />
<!-- build -->
<project path="build" name="project/iofomo/build">
<!--<copyfile dest="build.py" src="build.py"/>-->
</project>
</manifest>
创建分支或标签
如通过命令wing -create b release_v1.0.0 master即基于master分支创建新的release_v1.0.0分支(标签命令同理)。则:- manifest所在的Git库会自动创建一个release_v1.0.0的分支。
- manifest中所有的xml索引文件中default默认分支的值为release_v1.0.0
<?xml version='1.0' encoding='UTF-8'?>
<manifest>
<remote name="origin" fetch=".."/>
<!-- branch -->
<default revision="release_v1.0.0" remote="origin" sync-j="4"/>
<!-- doc -->
<project path="doc" name="project/iofomo/doc.git" />
<!-- platform: always with master -->
<project path="platform/doc" name="platform/doc.git" revision="master" />
<!-- Test -->
<project path="test/tools" name="platform/tools.git" revision="master" />
<project path="test/testBot" name="project/iofomo/testBot.git" />
<!-- build -->
<project path="build" name="project/iofomo/build">
<!--<copyfile dest="build.py" src="build.py"/>-->
</project>
</manifest>
快速开始
安装
$ python setup.py install配置环境变量
Windows:将C:\Users\${user name}\bin添加至系统环境变量。
Linux/MacOS:
将~/bin配置为可执行全局目录。
创建工作空间
添加工作空间对应的代码git库服务地址,如:# 本地索引模式
# wing -space add {space name} {git host} [manifest]
# such as:
$ wing -space add test git@github.com/iofomo
获取代码
$ mkdir test$ cd test
# wing init {space name} {branch/tag} {manifest file}
# such as:
$ wing init test master admin.xml
SHELL 复制 全屏
在当前目录下自动创建一个空的模板索引文件(.wing/manifests/admin.xml),需要添加要同步的代码库映射关系。