From 7d2a6f12bcc2bff246d545bc2c9ba3d471e9c719 Mon Sep 17 00:00:00 2001
From: Peter Dimov ";
}
void module_end( std::string const & /*module*/ )
{
- std::cout << "
"
+SET STYLESHEET=report.css
+
+SET OPTIONS=--html-stylesheet %STYLESHEET% --html-prefix %PREFIX%
SET OUTDIR=..\report-%BRANCH%-%SHREV%
mkdir %OUTDIR%
+COPY tools\boostdep\examples\%STYLESHEET% %OUTDIR%
+
%BOOSTDEP% --list-modules > %OUTDIR%\list-modules.txt
-%BOOSTDEP% --footer "%FOOTER%" --html --module-overview > %OUTDIR%\module-overview.html
-%BOOSTDEP% --footer "%FOOTER%" --html --module-levels > %OUTDIR%\module-levels.html
-%BOOSTDEP% --footer "%FOOTER%" --html --module-weights > %OUTDIR%\module-weights.html
+%BOOSTDEP% %OPTIONS% --html-title "Boost Module Overview" --html --module-overview > %OUTDIR%\module-overview.html
+%BOOSTDEP% %OPTIONS% --html-title "Boost Module Levels" --html --module-levels > %OUTDIR%\module-levels.html
+%BOOSTDEP% %OPTIONS% --html-title "Boost Module Weights" --html --module-weights > %OUTDIR%\module-weights.html
-FOR /f %%i IN (%OUTDIR%\list-modules.txt) DO %BOOSTDEP% --title "Dependency Report for %%i" --footer "%FOOTER%" --html --primary %%i --secondary %%i --reverse %%i > %OUTDIR%\%%i.html
+FOR /f %%i IN (%OUTDIR%\list-modules.txt) DO %BOOSTDEP% --html-title "Boost Dependency Report for %%i" %OPTIONS% --html --primary %%i --secondary %%i --reverse %%i > %OUTDIR%\%%i.html
diff --git a/examples/report.css b/examples/report.css
new file mode 100644
index 0000000..b4066b5
--- /dev/null
+++ b/examples/report.css
@@ -0,0 +1,24 @@
+/* Copyright 2017 Peter Dimov
+ Distributed under the Boost Software License, Version 1.0. */
+
+A { color: #06C; text-decoration: none; }
+A:hover { text-decoration: underline; }
+
+body { max-width: 60em; margin-left: auto; margin-right: auto; color: #4A6484; font-family: sans-serif; }
+
+.logo { font-family: sans-serif; font-style: italic; }
+.logo .upper { font-size: 48pt; font-weight: 800; }
+.logo .lower { font-size: 17pt; }
+.logo .description { font-size: small; margin-top: 2em; }
+
+.primary-list { font-size: small; }
+.secondary-list { font-size: small; }
+
+#module-overview .primary-list { margin-left: 1em; }
+
+#module-levels h3 { margin-left: 1em; }
+#module-levels .primary-list { margin-left: 2em; }
+
+#module-weights h3 { margin-left: 1em; }
+#module-weights .primary-list { margin-left: 2em; }
+#module-weights .secondary-list { margin-left: 2em; padding-left: 1em; border-left: 1px dotted; }
diff --git a/src/boostdep.cpp b/src/boostdep.cpp
index 0aa36e7..230b1ce 100644
--- a/src/boostdep.cpp
+++ b/src/boostdep.cpp
@@ -809,7 +809,8 @@ int const unknown_level = INT_MAX / 2;
struct module_level_actions
{
- virtual void heading() = 0;
+ virtual void begin() = 0;
+ virtual void end() = 0;
virtual void level_start( int level ) = 0;
virtual void level_end( int level ) = 0;
@@ -972,7 +973,7 @@ static void output_module_level_report( module_level_actions & actions )
// output report
- actions.heading();
+ actions.begin();
for( std::map< int, std::set< std::string > >::iterator i = reverse_level_map.begin(); i != reverse_level_map.end(); ++i )
{
@@ -1006,17 +1007,23 @@ static void output_module_level_report( module_level_actions & actions )
actions.level_end( i->first );
}
+
+ actions.end();
}
struct module_level_txt_actions: public module_level_actions
{
int level_;
- void heading()
+ void begin()
{
std::cout << "Module Levels:\n\n";
}
+ void end()
+ {
+ }
+
void level_start( int level )
{
if( level >= unknown_level )
@@ -1072,9 +1079,14 @@ struct module_level_html_actions: public module_level_actions
{
int level_;
- void heading()
+ void begin()
{
- std::cout << "Module Levels
\n";
+ std::cout << "Module Levels
\n";
+ }
+
+ void end()
+ {
+ std::cout << "\n";
+ std::cout << "\n";
level_ = level;
}
void level_end( int /*level*/ )
{
- std::cout << "
\n";
}
void module_start( std::string const & module )
{
- std::cout << "
⇢";
- }
+ std::cout << " " << module << "
";
- deps_ = false;
+ std::cout << " " << module << "
"; } void module_end( std::string const & /*module*/ ) { - std::cout << "
\n"; + std::cout << "\n"; } void module2( std::string const & module ) { - if( !deps_ ) - { - std::cout << "⇢"; - deps_ = true; - } - std::cout << " " << module; } }; @@ -1267,7 +1276,11 @@ static void output_module_overview_report( bool html ) struct list_dependencies_actions: public module_overview_actions { - void heading() + void begin() + { + } + + void end() { } @@ -1298,19 +1311,30 @@ static void list_dependencies() // -static void output_html_header( std::string const & title ) +static void output_html_header( std::string const & title, std::string const & stylesheet, std::string const & prefix ) { std::cout << "\n"; std::cout << "\n"; std::cout << "" << footer << "
\n"; + std::cout << "\n"; std::cout << "\n"; std::cout << "\n"; } @@ -1355,7 +1379,8 @@ static void list_buildable() struct module_weight_actions { - virtual void heading() = 0; + virtual void begin() = 0; + virtual void end() = 0; virtual void weight_start( int weight ) = 0; virtual void weight_end( int weight ) = 0; @@ -1426,7 +1451,7 @@ static void output_module_weight_report( module_weight_actions & actions ) // output report - actions.heading(); + actions.begin(); for( std::map< int, std::set< std::string > >::const_iterator i = modules_by_weight.begin(); i != modules_by_weight.end(); ++i ) { @@ -1467,15 +1492,21 @@ static void output_module_weight_report( module_weight_actions & actions ) actions.weight_end( i->first ); } + + actions.end(); } struct module_weight_txt_actions: public module_weight_actions { - void heading() + void begin() { std::cout << "Module Weights:\n\n"; } + void end() + { + } + void weight_start( int weight ) { std::cout << "Weight " << weight << ":\n"; @@ -1529,25 +1560,29 @@ struct module_weight_html_actions: public module_weight_actions { int weight_; - void heading() + void begin() { - std::cout << ""; } void module_primary( std::string const & module, int weight ) @@ -1581,11 +1616,12 @@ struct module_weight_html_actions: public module_weight_actions void module_primary_end() { + std::cout << "
"; } void module_secondary_start() { - std::cout << ""; } void module_secondary( std::string const & module, int /*weight*/ ) @@ -1595,7 +1631,7 @@ struct module_weight_html_actions: public module_weight_actions void module_secondary_end() { - std::cout << "
"; + std::cout << ""; } }; @@ -2275,7 +2311,9 @@ int main( int argc, char const* argv[] ) " boostdep --pkgconfig