Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
WIP prepare to restructure rust for xplat
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Dec 25, 2023
1 parent bdd78d2 commit fa5f5f3
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 75 deletions.
46 changes: 7 additions & 39 deletions src/Rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 36 additions & 25 deletions src/Rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ name = "clowd_squirrel"
version = "0.0.0-local"
edition = "2021"

[features]
windows_build = []

[[bin]]
name = "setup"
path = "src/setup.rs"
required-features = ["windows_build"]

[[bin]]
name = "update"
Expand All @@ -14,10 +18,12 @@ path = "src/update.rs"
[[bin]]
name = "testapp"
path = "src/testapp.rs"
required-features = ["windows_build"]

[[bin]]
name = "stub"
path = "src/stub.rs"
required-features = ["windows_build"]

[profile.release]
opt-level = "z" # optimize for size
Expand All @@ -32,10 +38,33 @@ rpath = false # disable rpath

[dependencies]
anyhow = "1.0"
memmap2 = "0.9"
pretty-bytes-rust = "0.3"
xml = "0.8"
os_info = { git = "https://github.com/stanislav-tkach/os_info.git", branch = "master", default-features = false } # public releases don't yet have processor arch info
zip = { version = "0.6", default-features = false, features = ["deflate"] }
regex = "1.10"
rand = "0.8"
log = "0.4"
simplelog = "0.12"
clap = "4.4"
xml = "0.8"
semver = "1.0"
chrono = "0.4"
wait-timeout = "0.2"
lazy_static = "1.4"
strum = { version = "0.25", features = ["derive"] }
ureq = { version = "2.9", default-features = false, features = [
"native-tls",
"gzip",
] }
native-tls = "0.2"
file-rotate = "0.7"
derivative = "2.2"
simple-stopwatch = "0.1.4"

[target.'cfg(windows)'.dependencies]
fs_extra = "1.2"
glob = "0.3"
memmap2 = "0.9"
winsafe = { git = "https://github.com/caesay/winsafe.git", branch = "cs/only-ipersistfile", features = [
"kernel",
"version",
Expand All @@ -45,18 +74,11 @@ winsafe = { git = "https://github.com/caesay/winsafe.git", branch = "cs/only-ipe
"gui",
"ole",
] }
zip = { version = "0.6", default-features = false, features = ["deflate"] }
regex = "1.10"
rand = "0.8"
log = "0.4"
simplelog = "0.12"
clap = "4.4"
image = { version = "0.24", default-features = false, features = [
"gif",
"jpeg",
"png",
] }
fs_extra = "1.2"
windows = { version = "0.52", default-features = false, features = [
"Win32_Foundation",
"Win32_Security",
Expand All @@ -74,26 +96,15 @@ windows-sys = { version = "0.52", default-features = false, features = [
"Wdk_System",
"Wdk_System_Threading",
] }
semver = "1.0"
chrono = "0.4"
wait-timeout = "0.2"
lazy_static = "1.4"
strum = { version = "0.25", features = ["derive"] }
ureq = { version = "2.9", default-features = false, features = [
"native-tls",
"gzip",
remove_dir_all = { git = "https://github.com/caesay/remove_dir_all.git", features = [
"log",
] }
native-tls = "0.2"
file-rotate = "0.7"
derivative = "2.2"
remove_dir_all = { git = "https://github.com/caesay/remove_dir_all.git", features = ["log"] }
glob = "0.3"
normpath = "1.0.1"
codesign-verify = { git = "https://github.com/caesay/codesign-verify-rs.git" }
com = "0.2.0"
widestring = "1.0.2"
simple-stopwatch="0.1.4"

[build-dependencies]
semver = "1.0"

[target.'cfg(windows)'.build-dependencies]
winres = "0.1"
semver = "1.0"
4 changes: 4 additions & 0 deletions src/Rust/build.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#![allow(unused_variables)]
use semver;
use std::process::Command;

#[cfg(target_os = "windows")]
extern crate winres;

fn main() {
let ver_output = Command::new("nbgv").args(&["get-version", "-v", "NuGetPackageVersion"]).output().expect("Failed to execute nbgv get-version");
let version = String::from_utf8(ver_output.stdout).expect("Unable to convert ngbv output to string");
Expand All @@ -12,6 +15,7 @@ fn main() {

println!("cargo:rustc-env=NGBV_VERSION={}", version);

#[cfg(target_os = "windows")]
let _ = winres::WindowsResource::new()
.set_manifest_file("app.manifest")
.set_version_info(winres::VersionInfo::PRODUCTVERSION, ver)
Expand Down
11 changes: 0 additions & 11 deletions src/Rust/src/platform/mod.rs

This file was deleted.

File renamed without changes.
File renamed without changes.
Empty file added src/Rust/src/shared/mod.rs
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit fa5f5f3

Please sign in to comment.