准备阶段
- 准备tauri开发环境,请参考Prerequisites | Tauri Apps
- 下载代码 desktop · AtomGit_开放原子开源基金会代码托管平台
- git checkout到最新的tag
修改vendor_cfg
打开src-tauri/src/vendor_config.rs,按需调整配置。
//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only
use crate::client_cfg_api_plugin::{
VendorAbility, VendorAccount, VendorConfig, VendorDataView, VendorProject,
};
pub fn get_vendor_config() -> VendorConfig {
return VendorConfig {
default_server_name: "官方".into(), //默认服务器名称
default_server_addr: "serv.linksaas.pro:5000".into(), //默认服务器地址
global_server_addr: "serv.linksaas.pro:5000".into(), //公共资源服务器地址(用户微应用,公共资源数据获取)
show_server_switch: true, //是否显示切换服务器开关
ability: VendorAbility {
enable_dataview: true, //打开数据视图功能
enable_project: true, //打开项目功能
enable_org: true, //打开团队功能
enable_pubres: true, //打开共资源功能
},
account: VendorAccount {
inner_account: true, //内容账号
external_account: true, //支持外部账号登录
external_atomgit: true, //支持atomgit oauth登录
external_gitcode: true, //支持gitcode oauth登录
external_gitee: true, //支持gitee oauth登录
},
dataview: VendorDataView {
enable_atomgit: true, //支持atomgit视图组件
enable_gitcode: true, //支持gitcode视图组件
enable_gitee: true, //支持gitee视图组件
enable_gitlab: true, //支持gitlab视图组件
enable_tencloud: true, //支持腾讯云视图组件
enable_alicloud: true, //未实现
enable_hwcloud: true, //未实现
},
project: VendorProject {
show_requirement_list_entry: true, //显示项目需求列表入口
show_task_list_entry: true, //显示任务列表入口
show_bug_list_entry: true, //显示缺陷列表入口
show_testcase_list_entry: true, //显示测试用例列表入口
},
enable_normal_layout: true, //true表示普通布局,false表示精简布局
show_layout_switch: true, //显示布局切换开关
enable_server_menu: true, //显示服务端的额外菜单配置
menu_list: vec![], //本地额外菜单配置
};
}
测试软件
yarn install
yarn tauri dev
发布软件
release版本需要考虑如下因素
- 是否更换软件logo
- 软件显示名称
- 是否更换软件简介
- 软件签名(防止操作系统出现不安全软件提示)
- 软件更新配置
tauri支持多文件配置:
- 在windows下可增加/src-tauri/tauri.windows.conf.json
- 在mac下可增加/src-tauri/tauri.macos.conf.json
- 在linux下可增加/src-tauri/tauri.linux.conf.json
具体配置请查看 Configuration | Tauri Apps
需要关注如下属性
package.productName |
产品名称 |
tauri.bundle.identifier |
软件ID,ID相同就任务是同一个软件 |
tauri.bundle.icon |
软件Logo配置 |
demo配置
{
"tauri": {
"bundle": {
"windows": {
"tsp": true,
"certificateThumbprint": "xxx",
"digestAlgorithm": "sha256",
"timestampUrl": "https://"
}
},
"updater": {
"active": true,
"endpoints":[
"https://www.linksaas.pro/release/{{target}}-{{arch}}.json"
],
"dialog": false,
"pubkey": ""
}
}
}