From 24d2b9bc0ced900a218265407decbfc00bb596b5 Mon Sep 17 00:00:00 2001 From: Alex Charlton Date: Sun, 26 Mar 2023 21:52:57 -0700 Subject: [PATCH] Separate core workspace from CLI --- Cargo.lock | 12 ++++++++++-- Cargo.toml | 16 +++++++++++----- core/Cargo.toml | 11 +++++++++++ core/src/lib.rs | 2 ++ {src => core/src}/midi_file.rs | 0 {src => core/src}/song_to_midi.rs | 0 src/main.rs | 4 +--- 7 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 core/Cargo.toml create mode 100644 core/src/lib.rs rename {src => core/src}/midi_file.rs (100%) rename {src => core/src}/song_to_midi.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 1e58e1b..56c6a38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,12 +297,20 @@ checksum = "bc4010833aea396656c2f91ee704d51a6f1329ec2ab56ffd00bfd56f7481ea94" [[package]] name = "midi-m8" -version = "1.0.0" +version = "1.1.0" dependencies = [ - "byteorder", "clap", "human-panic", "m8-files", + "midi-m8-core", +] + +[[package]] +name = "midi-m8-core" +version = "1.1.0" +dependencies = [ + "byteorder", + "m8-files", "midi-msg", ] diff --git a/Cargo.toml b/Cargo.toml index bd60147..3228082 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,8 +8,14 @@ license = "MIT" keywords = ["music"] [dependencies] -byteorder = "1.4.3" -clap = { version = "4.1.6", features = ["derive"] } -human-panic = { version = "1.1.1", features = ["color"] } -m8-files = "0.1.3" -midi-msg = "0.4.0" +clap = { version = "4.1", features = ["derive"] } +human-panic = { version = "1.1", features = ["color"] } +midi-m8-core = { version = "1.1", path = "./core" } +m8-files = { workspace = true } + +[workspace] +members = ["core"] + +[workspace.dependencies] +midi-msg = "0.4" +m8-files = "0.1.3" \ No newline at end of file diff --git a/core/Cargo.toml b/core/Cargo.toml new file mode 100644 index 0000000..c1725d8 --- /dev/null +++ b/core/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "midi-m8-core" +version = "1.1.0" +edition = "2021" +repository = "https://github.com/AlexCharlton/midi-m8" +license = "MIT" + +[dependencies] +byteorder = "1.4.3" +m8-files = { workspace = true } +midi-msg = { workspace = true } diff --git a/core/src/lib.rs b/core/src/lib.rs new file mode 100644 index 0000000..d468bcc --- /dev/null +++ b/core/src/lib.rs @@ -0,0 +1,2 @@ +pub mod midi_file; +pub mod song_to_midi; diff --git a/src/midi_file.rs b/core/src/midi_file.rs similarity index 100% rename from src/midi_file.rs rename to core/src/midi_file.rs diff --git a/src/song_to_midi.rs b/core/src/song_to_midi.rs similarity index 100% rename from src/song_to_midi.rs rename to core/src/song_to_midi.rs diff --git a/src/main.rs b/src/main.rs index 58f30cd..c97b44b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,10 +5,8 @@ use std::io::Write; use clap::Parser; use m8_files::Song; -mod midi_file; -mod song_to_midi; -use song_to_midi::*; +use midi_m8_core::song_to_midi::*; #[derive(Parser)] #[command(version, about)]