Skip to content

Commit

Permalink
fixing cyclic dependency problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Nov 5, 2024
1 parent f92c46f commit 665cfaf
Show file tree
Hide file tree
Showing 8 changed files with 594 additions and 94 deletions.
13 changes: 7 additions & 6 deletions module/core/test_tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ all-features = false
[features]
default = [
"enabled",
"error_typed",
"error_untyped",
# "standalone",
]
full = [ "default" ]
no_std = [
Expand Down Expand Up @@ -66,6 +65,8 @@ enabled = [
]
# nightly = [ "typing_tools/nightly" ]

standalone = [ "standalone_error_tools" ]
standalone_error_tools = [ "dep:anyhow", "dep:thiserror", "error_typed", "error_untyped" ]
error_typed = []
error_untyped = []

Expand All @@ -81,11 +82,10 @@ rand = "0.8.5"

## internal

# error_tools = { workspace = true, features = [ "full" ] }
error_tools = { workspace = true, features = [ "full" ] }
meta_tools = { workspace = true, features = [ "full" ] }
mem_tools = { workspace = true, features = [ "full" ] }
typing_tools = { workspace = true, features = [ "full" ] }
data_type = { workspace = true, features = [ "full" ] }
diagnostics_tools = { workspace = true, features = [ "full" ] }
process_tools = { workspace = true, features = [ "full" ] }
collection_tools = { workspace = true, features = [ "full" ] }
Expand All @@ -94,8 +94,9 @@ collection_tools = { workspace = true, features = [ "full" ] }

## transient

anyhow = { workspace = true }
thiserror = { workspace = true }
# # error_tools
anyhow = { workspace = true, optional = true }
thiserror = { workspace = true, optional = true }

[build-dependencies]
rustc_version = "0.4"
203 changes: 156 additions & 47 deletions module/core/test_tools/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,70 +21,159 @@ pub mod dependency

// #[ doc( inline ) ]
// pub use ::error_tools;
#[ doc( inline ) ]
pub use ::meta_tools;
#[ doc( inline ) ]
pub use ::mem_tools;
#[ doc( inline ) ]
pub use ::typing_tools;
#[ doc( inline ) ]
pub use ::num_traits;
#[ doc( inline ) ]
pub use ::diagnostics_tools;

#[ doc( inline ) ]
pub use ::process_tools;
// #[ doc( inline ) ]
// pub use ::meta_tools;
// #[ doc( inline ) ]
// pub use ::mem_tools;
// #[ doc( inline ) ]
// pub use ::typing_tools;
// #[ doc( inline ) ]
// pub use ::num_traits;
// #[ doc( inline ) ]
// pub use ::diagnostics_tools;
//
// #[ doc( inline ) ]
// pub use ::process_tools;

// #[ doc( inline ) ]
// #[ allow( unused_imports ) ]
// pub use ::process_tools as process_tools;

}

mod private {}

//

// #[ cfg( feature = "enabled" ) ]
// // #[ cfg( not( feature = "no_std" ) ) ]
// ::meta_tools::mod_interface!
// {
// // #![ debug ]
//
// own use super::dependency::*;
//
// layer test;
//
// // xxx : comment out
// use super::exposed::meta;
// use super::exposed::mem;
// use super::exposed::typing;
// use super::exposed::dt;
// use super::exposed::diagnostics;
// use super::exposed::collection;
// // use super::exposed::process;
//
// // prelude use ::rustversion::{ nightly, stable };
//
// // // xxx : eliminate need to do such things, putting itself to proper category
// // exposed use super::test::compiletime;
// // exposed use super::test::helper;
// // exposed use super::test::smoke_test;
//
// prelude use ::meta_tools as meta;
// prelude use ::mem_tools as mem;
// prelude use ::typing_tools as typing;
// prelude use ::data_type as dt;
// prelude use ::diagnostics_tools as diagnostics;
// prelude use ::collection_tools as collection;
// // prelude use ::process_tools as process;
//
// use ::collection_tools; // xxx : do that for all dependencies
//
// prelude use ::meta_tools::
// {
// impls,
// index,
// tests_impls,
// tests_impls_optional,
// tests_index,
// };
//
// prelude use ::typing_tools::{ implements };
//
// }

// xxx : use module namespaces
// #[ cfg( feature = "enabled" ) ]
// #[ cfg( not( feature = "no_std" ) ) ]
// pub use test::{ compiletime, helper, smoke_test };

#[ cfg( feature = "enabled" ) ]
pub mod test;

#[ cfg( feature = "standalone" ) ]
#[ path = "../../../core/error_tools/src/error/mod.rs" ]
pub mod error_tools;

mod private {}
#[ cfg( feature = "enabled" ) ]
#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use own::*;

//
/// Own namespace of the module.
#[ cfg( feature = "enabled" ) ]
#[ allow( unused_imports ) ]
pub mod own
{
use super::*;

#[ doc( inline ) ]
pub use test::own::*;

#[ doc( inline ) ]
pub use
{
error_tools::orphan::*,
// meta_tools::orphan::*,
mem_tools::orphan::*,
typing_tools::orphan::*,
diagnostics_tools::orphan::*,
collection_tools::orphan::*,
};

}

/// Shared with parent namespace of the module
#[ cfg( feature = "enabled" ) ]
// #[ cfg( not( feature = "no_std" ) ) ]
::meta_tools::mod_interface!
#[ allow( unused_imports ) ]
pub mod orphan
{
// #![ debug ]
use super::*;

own use super::dependency::*;
#[ doc( inline ) ]
pub use exposed::*;

layer test;
#[ doc( inline ) ]
pub use test::orphan::*;

// xxx : comment out
use super::exposed::meta;
use super::exposed::mem;
use super::exposed::typing;
use super::exposed::dt;
use super::exposed::diagnostics;
use super::exposed::collection;
// use super::exposed::process;
}

// prelude use ::rustversion::{ nightly, stable };
/// Exposed namespace of the module.
#[ cfg( feature = "enabled" ) ]
#[ allow( unused_imports ) ]
pub mod exposed
{
use super::*;

// // xxx : eliminate need to do such things, putting itself to proper category
// exposed use super::test::compiletime;
// exposed use super::test::helper;
// exposed use super::test::smoke_test;
#[ doc( inline ) ]
pub use prelude::*;

prelude use ::meta_tools as meta;
prelude use ::mem_tools as mem;
prelude use ::typing_tools as typing;
prelude use ::data_type as dt;
prelude use ::diagnostics_tools as diagnostics;
prelude use ::collection_tools as collection;
// prelude use ::process_tools as process;
#[ doc( inline ) ]
pub use test::exposed::*;

use ::collection_tools; // xxx : do that for all dependencies
#[ doc( inline ) ]
pub use
{
error_tools::exposed::*,
// meta_tools::exposed::*,
mem_tools::exposed::*,
typing_tools::exposed::*,
diagnostics_tools::exposed::*,
collection_tools::exposed::*,
};

prelude use ::meta_tools::
pub use meta_tools::
{
impls,
index,
Expand All @@ -93,11 +182,31 @@ mod private {}
tests_index,
};

prelude use ::typing_tools::{ implements };
}

/// Prelude to use essentials: `use my_module::prelude::*`.
#[ cfg( feature = "enabled" ) ]
#[ allow( unused_imports ) ]
pub mod prelude
{
use super::*;

#[ doc( inline ) ]
pub use test::prelude::*;

#[ doc( inline ) ]
pub use
{
error_tools::prelude::*,
// meta_tools::prelude::*,
mem_tools::prelude::*,
typing_tools::prelude::*,
diagnostics_tools::prelude::*,
collection_tools::prelude::*,
};

}

// xxx : use module namespaces
// #[ cfg( feature = "enabled" ) ]
// #[ cfg( not( feature = "no_std" ) ) ]
// pub use test::{ compiletime, helper, smoke_test };
// use test::prelude::hmap as xxx;
// use prelude::hmap as xxx;
// use meta_tools::prelude::hmap as xxx;
69 changes: 64 additions & 5 deletions module/core/test_tools/src/test/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,73 @@ mod private
}


// //
// // #[ cfg( not( feature = "no_std" ) ) ]
// crate::mod_interface!
// {
//
// #[ cfg( not( feature = "no_std" ) ) ]
crate::mod_interface!
// // exposed use super;
// exposed use super::super::asset;
//
// // own use path_to_exe;
//
// }

#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use own::*;

/// Own namespace of the module.
#[ allow( unused_imports ) ]
pub mod own
{
use super::*;

#[ doc( inline ) ]
pub use
{
};

}

/// Shared with parent namespace of the module
#[ allow( unused_imports ) ]
pub mod orphan
{
use super::*;

#[ doc( inline ) ]
pub use exposed::*;

// exposed use super;
exposed use super::super::asset;
pub use super::super::asset;

}

/// Exposed namespace of the module.
#[ allow( unused_imports ) ]
pub mod exposed
{
use super::*;

#[ doc( inline ) ]
pub use prelude::*;

#[ doc( inline ) ]
pub use
{
};

}

/// Prelude to use essentials: `use my_module::prelude::*`.
#[ allow( unused_imports ) ]
pub mod prelude
{
use super::*;

// own use path_to_exe;
#[ doc( inline ) ]
pub use
{
};

}
Loading

0 comments on commit 665cfaf

Please sign in to comment.