Skip to content

Commit 2d1e181

Browse files
authored
Split system crate in another repo (#12)
1 parent 241efae commit 2d1e181

File tree

27 files changed

+257
-463
lines changed

27 files changed

+257
-463
lines changed

Cargo.lock

Lines changed: 15 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
[workspace]
22
resolver = "2"
33
members = [
4-
"wslplugins-sys",
54
"plugin",
65
"wslplugins-rs",
76
"wslplugins-macro",
87
"wslplugins-macro-core",
98
"wslplugins-macro-tests",
109
]
10+
11+
[workspace.package]
12+
authors = ["Mickaël Véril <[email protected]>"]
13+
version = "0.1.0-alpha.0"
14+
edition = "2021"
15+
license = "MIT"
16+
repository = "https://github.com/mveril/wslplugins-rs"
17+
description = "A Rust framework for developing WSL plugins using safe and idiomatic Rust."

plugin/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[package]
22
name = "plugin"
3-
version = "0.1.0-alpha.0"
4-
authors = ["Mickaël Véril <[email protected]>"]
3+
authors.workspace = true
4+
version.workspace = true
5+
license.workspace = true
6+
repository.workspace = true
57
edition = "2021"
68

79
[lib]

wslplugins-macro-core/Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[package]
22
name = "wslplugins-macro-core"
3-
version = "0.1.0-alpha.0"
4-
authors = ["Mickaël Véril <[email protected]>"]
3+
authors.workspace = true
4+
version.workspace = true
5+
license.workspace = true
6+
repository.workspace = true
57
edition = "2021"
68

79
[dependencies]
@@ -12,7 +14,7 @@ heck = "0.5"
1214
strum = { version = "0.26.3", features = ["derive"] }
1315

1416
[build-dependencies]
15-
wslplugins-sys = { path = "../wslplugins-sys", features = [
17+
wslpluginapi-sys = { git = "https://github.com/mveril/wslpluginapi-sys.git", branch = "main", features = [
1618
"hooks-field-names",
1719
] }
1820
quote = "*"

wslplugins-macro-core/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{env, fs::File, io::Write, path::PathBuf};
22
use struct_field_names_as_array::FieldNamesAsSlice;
3-
use wslplugins_sys::WSLPluginHooksV1;
3+
use wslpluginapi_sys::WSLPluginHooksV1;
44

55
fn main() -> Result<(), Box<dyn std::error::Error>> {
66
let items: &'static [&'static str] = WSLPluginHooksV1::FIELD_NAMES_AS_SLICE;

wslplugins-macro-tests/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
[package]
22
name = "wslplugins-macro-tests"
3-
version = "0.1.0-alpha.0"
4-
authors = ["Mickaël Véril <[email protected]>"]
3+
authors.workspace = true
4+
version.workspace = true
5+
license.workspace = true
6+
repository.workspace = true
7+
description = "A Rust framework for developing WSL plugins using safe and idiomatic Rust."
58
edition = "2021"
69

710
[dependencies]
811
wslplugins-rs = { path = "../wslplugins-rs", features = ["macro"] }
9-
wslplugins-sys = { path = "../wslplugins-sys" }
12+
wslpluginapi-sys = { git = "https://github.com/mveril/wslpluginapi-sys.git", branch = "main" }
1013
[dependencies.windows]
1114
version = "0.58"
1215
features = ["Win32_Foundation"]

wslplugins-macro/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
[package]
22
name = "wslplugins-macro"
3-
version = "0.1.0-alpha.0"
4-
authors = ["Mickaël Véril <[email protected]>"]
3+
authors.workspace = true
4+
version.workspace = true
5+
license.workspace = true
6+
repository.workspace = true
57
edition = "2021"
8+
69
[lib]
710
proc-macro = true
811

wslplugins-rs/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[package]
22
name = "wslplugins-rs"
3-
version = "0.1.0-alpha.0"
4-
authors = ["Mickaël Véril <[email protected]>"]
3+
authors.workspace = true
4+
version.workspace = true
5+
license.workspace = true
6+
repository.workspace = true
7+
description.workspace = true
58
edition = "2021"
69

710
[dependencies.windows]
@@ -18,7 +21,7 @@ thiserror = "2.0.7"
1821
typed-path = ">0.1"
1922
widestring = { version = "1", features = ["alloc"] }
2023
wslplugins-macro = { path = "../wslplugins-macro", optional = true }
21-
wslplugins-sys = { path = "../wslplugins-sys" }
24+
wslpluginapi-sys = { git = "https://github.com/mveril/wslpluginapi-sys.git", branch = "main" }
2225

2326
[dependencies.semver]
2427
version = ">0.1"

wslplugins-rs/src/api/api_v1.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
extern crate wslplugins_sys;
1+
extern crate wslpluginapi_sys;
22
#[cfg(doc)]
33
use super::Error;
44
use super::Result;
55
use crate::api::errors::require_update_error::Result as UpReqResult;
66
use crate::cstring_ext::CstringExt;
77
use crate::wsl_session_information::WSLSessionInformation;
8+
use crate::WSLVersion;
89
#[cfg(feature = "log-instrument")]
910
use log_instrument::instrument;
1011
use std::ffi::{CString, OsStr};
@@ -23,7 +24,7 @@ use windows::{
2324
Win32::Foundation::BOOL,
2425
};
2526

26-
use wslplugins_sys::{WSLPluginAPIV1, WSLVersion};
27+
use wslpluginapi_sys::WSLPluginAPIV1;
2728

2829
use super::utils::check_required_version_result;
2930

@@ -72,7 +73,7 @@ impl ApiV1 {
7273
/// );
7374
#[cfg_attr(feature = "log-instrument", instrument)]
7475
pub fn version(&self) -> &WSLVersion {
75-
&self.0.Version
76+
self.0.Version.as_ref()
7677
}
7778

7879
/// Create plan9 mount between Windows & Linux

wslplugins-rs/src/api/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use thiserror::Error;
88
pub mod require_update_error;
99
pub use require_update_error::Error as RequireUpdateError;
1010
use windows::core::{Error as WinError, HRESULT};
11-
use wslplugins_sys::WSL_E_PLUGIN_REQUIRES_UPDATE;
11+
use wslpluginapi_sys::WSL_E_PLUGIN_REQUIRES_UPDATE;
1212

1313
/// A comprehensive error type for WSL plugins.
1414
///

0 commit comments

Comments
 (0)