diff --git a/Cargo.toml b/Cargo.toml index 8160d4b..a34447e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,24 +1,4 @@ -[package] -name = "hooked" -description = "Git hooks manager." -repository = "https://git.bauke.xyz/Holllo/hooked" -license = "AGPL-3.0-or-later" -version = "0.1.0" -authors = ["Holllo "] -edition = "2021" - -[lib] -name = "hooked" -path = "source/lib.rs" - -[dependencies] -color-eyre = "0.6.2" -toml = "0.5.9" - -[dependencies.serde] -features = ["derive"] -version = "1.0.147" - -[dev-dependencies] -insta = "1.21.0" -test-case = "2.2.2" +[workspace] +members = [ + "hooked-library" +] diff --git a/Makefile.toml b/Makefile.toml index d640ca1..999c3e5 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -1,3 +1,6 @@ +[env] +CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true + [tasks.fmt] command = "cargo" args = ["fmt", "${@}"] diff --git a/hooked-library/Cargo.toml b/hooked-library/Cargo.toml new file mode 100644 index 0000000..f90b988 --- /dev/null +++ b/hooked-library/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "hooked-library" +description = "Git hooks manager." +repository = "https://git.bauke.xyz/Holllo/hooked" +license = "AGPL-3.0-or-later" +version = "0.1.0" +authors = ["Holllo "] +edition = "2021" + +[lib] +path = "source/lib.rs" + +[dependencies] +color-eyre = "0.6.2" +toml = "0.5.9" + +[dependencies.serde] +features = ["derive"] +version = "1.0.147" + +[dev-dependencies] +insta = "1.21.0" +test-case = "2.2.2" diff --git a/source/config/exit_action.rs b/hooked-library/source/config/exit_action.rs similarity index 100% rename from source/config/exit_action.rs rename to hooked-library/source/config/exit_action.rs diff --git a/source/config/general.rs b/hooked-library/source/config/general.rs similarity index 100% rename from source/config/general.rs rename to hooked-library/source/config/general.rs diff --git a/source/config/mod.rs b/hooked-library/source/config/mod.rs similarity index 100% rename from source/config/mod.rs rename to hooked-library/source/config/mod.rs diff --git a/source/config/pre_commit.rs b/hooked-library/source/config/pre_commit.rs similarity index 100% rename from source/config/pre_commit.rs rename to hooked-library/source/config/pre_commit.rs diff --git a/source/config/task.rs b/hooked-library/source/config/task.rs similarity index 100% rename from source/config/task.rs rename to hooked-library/source/config/task.rs diff --git a/source/lib.rs b/hooked-library/source/lib.rs similarity index 100% rename from source/lib.rs rename to hooked-library/source/lib.rs diff --git a/tests/parsing.rs b/hooked-library/tests/parsing.rs similarity index 89% rename from tests/parsing.rs rename to hooked-library/tests/parsing.rs index 3a290ba..175e244 100644 --- a/tests/parsing.rs +++ b/hooked-library/tests/parsing.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use {color_eyre::Result, hooked::Config}; +use {color_eyre::Result, hooked_library::Config}; use {insta::assert_debug_snapshot, test_case::test_case}; diff --git a/tests/parsing/defaults.toml b/hooked-library/tests/parsing/defaults.toml similarity index 100% rename from tests/parsing/defaults.toml rename to hooked-library/tests/parsing/defaults.toml diff --git a/tests/parsing/with-hooks.toml b/hooked-library/tests/parsing/with-hooks.toml similarity index 100% rename from tests/parsing/with-hooks.toml rename to hooked-library/tests/parsing/with-hooks.toml diff --git a/tests/serialize.rs b/hooked-library/tests/serialize.rs similarity index 92% rename from tests/serialize.rs rename to hooked-library/tests/serialize.rs index 1191157..304ddfa 100644 --- a/tests/serialize.rs +++ b/hooked-library/tests/serialize.rs @@ -1,5 +1,5 @@ use { - hooked::{Config, ExitAction, PreCommit, Task}, + hooked_library::{Config, ExitAction, PreCommit, Task}, toml::to_string_pretty, }; diff --git a/tests/snapshots/parsing__defaults.snap b/hooked-library/tests/snapshots/parsing__defaults.snap similarity index 100% rename from tests/snapshots/parsing__defaults.snap rename to hooked-library/tests/snapshots/parsing__defaults.snap diff --git a/tests/snapshots/parsing__with-hooks.snap b/hooked-library/tests/snapshots/parsing__with-hooks.snap similarity index 100% rename from tests/snapshots/parsing__with-hooks.snap rename to hooked-library/tests/snapshots/parsing__with-hooks.snap diff --git a/tests/snapshots/serialize__serialize.snap b/hooked-library/tests/snapshots/serialize__serialize.snap similarity index 100% rename from tests/snapshots/serialize__serialize.snap rename to hooked-library/tests/snapshots/serialize__serialize.snap