@@ -9,7 +9,7 @@ pub struct Args {
99 /// Build docs for only these crates (must be publishable)
1010 #[ clap( long = "crate" ) ]
1111 pub crates : Vec < String > ,
12-
12+
1313 /// Output directory for generated documentation
1414 #[ clap( short, long) ]
1515 pub output : PathBuf ,
@@ -20,7 +20,7 @@ pub fn run(ctx: &Context, args: Args) -> Result<()> {
2020 // Build docs for all publishable crates
2121 ctx. crates
2222 . iter ( )
23- . filter ( |( _, crate_info) | crate_info. publish )
23+ . filter ( |( _, crate_info) | crate_info. publish && crate_info . doc )
2424 . map ( |( crate_id, _) | crate_id. clone ( ) )
2525 . collect ( )
2626 } else {
@@ -31,6 +31,10 @@ pub fn run(ctx: &Context, args: Args) -> Result<()> {
3131 anyhow:: bail!( "Crate '{}' not found" , crate_name) ;
3232 }
3333 let crate_info = & ctx. crates [ crate_name] ;
34+ if !crate_info. doc {
35+ println ! ( "⚠️ Skipping non-documentable crate: {}" , crate_name) ;
36+ continue ;
37+ }
3438 if !crate_info. publish {
3539 println ! ( "⚠️ Skipping non-publishable crate: {}" , crate_name) ;
3640 continue ;
@@ -53,30 +57,34 @@ pub fn run(ctx: &Context, args: Args) -> Result<()> {
5357 let crate_info = & ctx. crates [ crate_id] ;
5458 let input_path = & crate_info. path ;
5559 let output_path = args. output . join ( "crates" ) . join ( crate_id) . join ( "git.zup" ) ;
56-
60+
5761 println ! ( "Building docs for crate: {}" , crate_id) ;
58-
62+
5963 let mut cmd = Command :: new ( "docserver" ) ;
6064 cmd. arg ( "build" )
6165 . arg ( "-i" )
6266 . arg ( input_path)
6367 . arg ( "-o" )
6468 . arg ( & output_path) ;
65-
69+
6670 // Add --output-static for the first docserver invocation
6771 if is_first_invocation {
6872 let static_output = args. output . join ( "static" ) ;
6973 cmd. arg ( "--output-static" ) . arg ( & static_output) ;
7074 is_first_invocation = false ;
7175 }
72-
76+
7377 match cmd. status ( ) {
7478 Ok ( status) if status. success ( ) => {
7579 println ! ( "✅ Successfully built docs for {}" , crate_id) ;
7680 success_count += 1 ;
7781 }
7882 Ok ( status) => {
79- eprintln ! ( "❌ Failed to build docs for {} (exit code: {:?})" , crate_id, status. code( ) ) ;
83+ eprintln ! (
84+ "❌ Failed to build docs for {} (exit code: {:?})" ,
85+ crate_id,
86+ status. code( )
87+ ) ;
8088 failed_crates. push ( crate_id. clone ( ) ) ;
8189 }
8290 Err ( e) => {
@@ -88,14 +96,17 @@ pub fn run(ctx: &Context, args: Args) -> Result<()> {
8896
8997 println ! ( "\n Summary:" ) ;
9098 println ! ( "✅ Successfully built docs for {} crates" , success_count) ;
91-
99+
92100 if !failed_crates. is_empty ( ) {
93- println ! ( "❌ Failed to build docs for {} crates:" , failed_crates. len( ) ) ;
101+ println ! (
102+ "❌ Failed to build docs for {} crates:" ,
103+ failed_crates. len( )
104+ ) ;
94105 for crate_name in & failed_crates {
95106 println ! ( " - {}" , crate_name) ;
96107 }
97108 anyhow:: bail!( "Failed to build docs for {} crates" , failed_crates. len( ) ) ;
98109 }
99110
100111 Ok ( ( ) )
101- }
112+ }
0 commit comments