Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
59098f710e | |||
25c77ea092 | |||
85843dff3a | |||
6bf0f4d158 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,3 +3,4 @@
|
|||||||
/um-react.exe
|
/um-react.exe
|
||||||
/um-react@*.zip
|
/um-react@*.zip
|
||||||
/um-react@*.exe
|
/um-react@*.exe
|
||||||
|
/*.gz
|
||||||
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -3001,7 +3001,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "um-react-wry"
|
name = "um-react-wry"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"clap",
|
"clap",
|
||||||
|
25
Cargo.toml
25
Cargo.toml
@ -1,29 +1,36 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "um-react-wry"
|
name = "um-react-wry"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wry = "0.35.1"
|
wry = { version = "0.35.1", optional = true }
|
||||||
tao = { version = "0.24", default-features = false, features = ["rwh_05"] }
|
tao = { version = "0.24", default-features = false, optional = true, features = [
|
||||||
zip = "0.6.6"
|
"rwh_05",
|
||||||
http = "0.2"
|
] }
|
||||||
bytes = "1.5.0"
|
image = { version = "0.24", default-features = true, optional = true, features = [
|
||||||
clap = { version = "4.4.12", features = ["derive"] }
|
|
||||||
image = { version = "0.24", default-features = true, features = [
|
|
||||||
"webp",
|
"webp",
|
||||||
"ico",
|
"ico",
|
||||||
] }
|
] }
|
||||||
dirs = "5.0.1"
|
|
||||||
|
zip = { version = "0.6.6" }
|
||||||
|
http = { version = "0.2" }
|
||||||
|
bytes = { version = "1.5.0" }
|
||||||
|
clap = { version = "4.4.12", features = ["derive"] }
|
||||||
|
dirs = { version = "5.0.1" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
winres = "0.1"
|
winres = "0.1"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
stub-pkgs = ["wry", "tao", "image"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "um-react-wry-stub"
|
name = "um-react-wry-stub"
|
||||||
path = "src/stub.rs"
|
path = "src/stub.rs"
|
||||||
|
required-features = ["stub-pkgs"]
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "builder"
|
name = "builder"
|
||||||
|
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM rust
|
||||||
|
|
||||||
|
ENV CARGO_HOME=/h
|
||||||
|
WORKDIR /c
|
||||||
|
|
||||||
|
COPY src /c/src/
|
||||||
|
COPY build.rs Cargo.toml Cargo.lock /c/
|
||||||
|
RUN cargo build --bin builder --release
|
||||||
|
|
||||||
|
CMD gzip < target/release/builder | base64
|
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
一个利用 [wry](https://github.com/tauri-apps/wry) 框架库制作的 um-react 单文件打包工具。
|
一个利用 [wry](https://github.com/tauri-apps/wry) 框架库制作的 um-react 单文件打包工具。
|
||||||
|
|
||||||
|
> **WARNING**
|
||||||
|
> 这是打包工具的源码与下载。打包好的文件将会在 [um-react 的 Release 页面][um_react_release]提供下载。
|
||||||
|
|
||||||
|
[um_react_release]: https://git.unlock-music.dev/um/um-react/releases
|
||||||
|
|
||||||
## 构建单文件
|
## 构建单文件
|
||||||
|
|
||||||
1. 确保 rust 已经安装。[参考说明](https://www.rust-lang.org/tools/install)。
|
1. 确保 rust 已经安装。[参考说明](https://www.rust-lang.org/tools/install)。
|
||||||
|
4
build.sh
Normal file
4
build.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
docker build -t wry-builder .
|
||||||
|
docker run --rm wry-builder | base64 -d >um-react-wry-builder-linux-amd64.gz
|
@ -71,7 +71,7 @@ fn main() -> wry::Result<()> {
|
|||||||
.join(format!("um-react!{}", APP_UUID));
|
.join(format!("um-react!{}", APP_UUID));
|
||||||
let exe_path = std::env::current_exe().unwrap();
|
let exe_path = std::env::current_exe().unwrap();
|
||||||
let um_react_external = exe_path.parent().unwrap().join("um-react.zip");
|
let um_react_external = exe_path.parent().unwrap().join("um-react.zip");
|
||||||
let zip_content = if um_react_external.exists() {
|
let zip_content = if cfg!(debug_assertions) && um_react_external.exists() {
|
||||||
// debug/prod: override by reading from external zip archive
|
// debug/prod: override by reading from external zip archive
|
||||||
parse_external_zip(&um_react_external).unwrap()
|
parse_external_zip(&um_react_external).unwrap()
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user