11//! Configuration for workspace dependency unification
22
3- use crate :: config:: RailConfig ;
3+ use crate :: config:: { RailConfig , TransitiveFeatureHost , UnifyBackupConfig , UnifyOutputConfig } ;
44use std:: collections:: HashSet ;
55
66/// Configuration for workspace unification
7- #[ derive( Debug , Clone ) ]
7+ #[ derive( Debug , Clone , Default ) ]
88pub struct UnifyConfig {
9- /// Whether metadata was collected with --all-features (default: true)
10- pub use_all_features : bool ,
11-
129 /// Allow renamed dependencies to be unified (default: false)
1310 pub allow_renamed : bool ,
1411
@@ -18,40 +15,29 @@ pub struct UnifyConfig {
1815 /// Dependencies to force-include in unification
1916 pub include : HashSet < String > ,
2017
21- /// Auto-resolve version conflicts by picking the highest version (default: true )
22- pub auto_resolve_version_conflicts : bool ,
18+ /// Consolidate transitive-only crates with fragmented features (default: false )
19+ pub consolidate_transitives : bool ,
2320
24- /// Add conflict comments to workspace. dependencies (default: true)
25- pub add_conflict_comments : bool ,
21+ /// Where to add dev- dependencies when consolidating transitive features
22+ pub transitive_host : TransitiveFeatureHost ,
2623
27- /// Generate a detailed unification report (default: true)
28- pub generate_report : bool ,
29- }
24+ /// Output configuration
25+ pub output : UnifyOutputConfig ,
3026
31- impl Default for UnifyConfig {
32- fn default ( ) -> Self {
33- Self {
34- use_all_features : true ,
35- allow_renamed : false ,
36- exclude : HashSet :: new ( ) ,
37- include : HashSet :: new ( ) ,
38- auto_resolve_version_conflicts : true ,
39- add_conflict_comments : true ,
40- generate_report : true ,
41- }
42- }
27+ /// Backup configuration
28+ pub backup : UnifyBackupConfig ,
4329}
4430
4531impl From < & RailConfig > for UnifyConfig {
4632 fn from ( rail_config : & RailConfig ) -> Self {
4733 Self {
48- use_all_features : rail_config. unify . use_all_features ,
4934 allow_renamed : rail_config. unify . allow_renamed ,
5035 exclude : rail_config. unify . exclude . iter ( ) . cloned ( ) . collect ( ) ,
5136 include : rail_config. unify . include . iter ( ) . cloned ( ) . collect ( ) ,
52- auto_resolve_version_conflicts : rail_config. unify . conflicts . auto_resolve ,
53- add_conflict_comments : rail_config. unify . conflicts . add_markers ,
54- generate_report : rail_config. unify . output . generate_report ,
37+ consolidate_transitives : rail_config. unify . consolidate_transitives ,
38+ transitive_host : rail_config. unify . transitive_host . clone ( ) ,
39+ output : rail_config. unify . output . clone ( ) ,
40+ backup : rail_config. unify . backup . clone ( ) ,
5541 }
5642 }
5743}
0 commit comments