修改架构,移动端优先。
save
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# Tauri 自动生成
|
||||
gen/
|
||||
target/
|
||||
|
||||
# Android 编译产物
|
||||
android/app/build/
|
||||
android/.gradle/
|
||||
android/build/
|
||||
android/local.properties
|
||||
android/captures/
|
||||
android/.idea/
|
||||
@@ -0,0 +1,30 @@
|
||||
[package]
|
||||
name = "iboard"
|
||||
version = "0.1.0"
|
||||
description = "iBoard - 经济数据与策略"
|
||||
authors = ["iBoard Team"]
|
||||
edition = "2021"
|
||||
rust-version = "1.77"
|
||||
|
||||
# 库目标: 桌面 + Android (cdylib) 都需要
|
||||
[lib]
|
||||
name = "iboard_lib"
|
||||
crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[dependencies]
|
||||
tauri = { version = "2", features = [] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
# Android 平台需要的 JNI / Activity 启动能力
|
||||
[target."cfg(target_os = \"android\")".dependencies]
|
||||
tauri = { version = "2", features = [] }
|
||||
|
||||
[features]
|
||||
# Tauri 的"自定义协议"模式让打包后的 webview 能从 tauri:// 加载资源
|
||||
# 用于生产构建, dev 模式不需要
|
||||
default = ["custom-protocol"]
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"$schema": "../gen/schemas/desktop-schema.json",
|
||||
"identifier": "default",
|
||||
"description": "默认能力: 允许 core API",
|
||||
"windows": ["main"],
|
||||
"permissions": [
|
||||
"core:default"
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 344 B |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,8 @@
|
||||
// 跨平台入口: 桌面从这里走, Android 走 mobile_entry_point 宏
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
tauri::Builder::default()
|
||||
.setup(|_app| Ok(()))
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running iBoard");
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Windows / Linux / macOS 桌面端入口
|
||||
// Android 不走这里, 走 .lib crate
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
iboard_lib::run();
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "iBoard",
|
||||
"version": "0.1.0",
|
||||
"identifier": "com.iboard.app",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
"beforeBuildCommand": "npm run build",
|
||||
"devUrl": "http://localhost:5173",
|
||||
"frontendDist": "../dist"
|
||||
},
|
||||
"app": {
|
||||
"windows": [
|
||||
{
|
||||
"title": "iBoard",
|
||||
"width": 420,
|
||||
"height": 820,
|
||||
"minWidth": 360,
|
||||
"minHeight": 640,
|
||||
"resizable": true,
|
||||
"fullscreen": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": null
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"android": {
|
||||
"minSdkVersion": 24
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user