<commit_before>
add_custom_command(OUTPUT tikz-uml.sty
                   COMMAND wget http://perso.ensta-paristech.fr/~kielbasi/tikzuml/src/tikzuml-v1.0b-2013-02-01.tbz
                   COMMAND tar xf tikzuml-v1.0b-2013-02-01.tbz
                   COMMAND mv tikzuml-v1.0b/tikz-uml.sty tikz-uml.sty
                   )
add_custom_command(OUTPUT header.tex footer.tex
                   COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/common-header.tex header.tex
                   COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/common-footer.tex footer.tex
                   DEPENDS 
                       ${CMAKE_CURRENT_SOURCE_DIR}/common-header.tex
                       ${CMAKE_CURRENT_SOURCE_DIR}/common-footer.tex
                   )

set(LATEX_SOURCES
bar_handler.tex
bind.tex
bind_instance.tex
checked_adder.tex
checked_incrementer.tex
component_composition.tex
component_dep_loop.tex
foo_handler.tex
greeter.tex
incrementer.tex
incrementer_component.tex
inject_macro.tex
inject_macro_no_args.tex
inject_macro_template.tex
inject_typedef_greeter.tex
inject_typedef_writer.tex
inject_typedef_writer2.tex
inject_typedef_templated_constructor.tex
multiplier.tex
parametrized_component.tex
provider.tex
provider_functor.tex
register_constructor.tex
register_constructor_component.tex
register_factory.tex
register_factory_use.tex
register_factory_macro.tex
request_dispatcher.tex
request_injector.tex
scaler.tex
server.tex
simple_greeter.tex
simple_incrementer.tex
simple_adder.tex
templated_component.tex
)

foreach(S ${LATEX_SOURCES})
  string(REPLACE ".tex" "" N ${S})
  add_custom_command(OUTPUT ${N}.png
                     COMMAND pdflatex -halt-on-error ${CMAKE_CURRENT_SOURCE_DIR}/${N}.tex
                     COMMAND convert -density 300 -trim ${N}.pdf -quality 100 -sharpen 0x1.0 ${N}.png
                     DEPENDS
                         tikz-uml.sty
                         header.tex
                         footer.tex
                         ${N}.tex
                     )
  add_custom_target(${N}-png ALL
                    DEPENDS ${N}.png)
endforeach(S)

set(EXAMPLE_DIRECTORIES
hello_world
server
scaling_doubles
multibindings
simple_injection
)

foreach(D ${EXAMPLE_DIRECTORIES})
  add_custom_command(OUTPUT ${D}-deps.png
                     COMMAND bash < ${CMAKE_CURRENT_SOURCE_DIR}/extract_dependencies.sh > ${CMAKE_CURRENT_BINARY_DIR}/${D}.dot
                     COMMAND dot -Goverlap=prism10000 ${CMAKE_CURRENT_BINARY_DIR}/${D}.dot -Tpng -o ${CMAKE_CURRENT_BINARY_DIR}/${D}-deps.png
                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../examples/${D}
                     DEPENDS
                        ../examples/${D}
                        extract_dependencies.sh
                     )
  add_custom_target(${D}-deps ALL
                    DEPENDS ${D}-deps.png)
endforeach(D)

<commit_msg>When generating PNGs for the documentation, strip the metadata so that the same sources always give the same result.<commit_after>

add_custom_command(OUTPUT tikz-uml.sty
                   COMMAND wget http://perso.ensta-paristech.fr/~kielbasi/tikzuml/var/files/src/tikzuml-v1.0-2016-03-29.tbz
                   COMMAND tar xf tikzuml-v1.0-2016-03-29.tbz
                   COMMAND mv tikzuml-v1.0-2016-03-29/tikz-uml.sty tikz-uml.sty
                   )
add_custom_command(OUTPUT header.tex footer.tex
                   COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/common-header.tex header.tex
                   COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/common-footer.tex footer.tex
                   DEPENDS 
                       ${CMAKE_CURRENT_SOURCE_DIR}/common-header.tex
                       ${CMAKE_CURRENT_SOURCE_DIR}/common-footer.tex
                   )

set(LATEX_SOURCES
bar_handler.tex
bind.tex
bind_instance.tex
checked_adder.tex
checked_incrementer.tex
component_composition.tex
component_dep_loop.tex
foo_handler.tex
greeter.tex
incrementer.tex
incrementer_component.tex
inject_macro.tex
inject_macro_no_args.tex
inject_macro_template.tex
inject_typedef_greeter.tex
inject_typedef_writer.tex
inject_typedef_writer2.tex
inject_typedef_templated_constructor.tex
multiplier.tex
parametrized_component.tex
provider.tex
provider_functor.tex
register_constructor.tex
register_constructor_component.tex
register_factory.tex
register_factory_use.tex
register_factory_macro.tex
request_dispatcher.tex
request_injector.tex
scaler.tex
server.tex
simple_greeter.tex
simple_incrementer.tex
simple_adder.tex
templated_component.tex
)

foreach(S ${LATEX_SOURCES})
  string(REPLACE ".tex" "" N ${S})
  add_custom_command(OUTPUT ${N}.png
                     COMMAND pdflatex -halt-on-error ${CMAKE_CURRENT_SOURCE_DIR}/${N}.tex
                     COMMAND convert -density 300 -trim ${N}.pdf -quality 100 -sharpen 0x1.0 ${N}.png
                     # This normalizes the PNG files, so that we avoid tracking multiple copies of the same file in the Github wiki repo.
                     COMMAND exiftool -all= -overwrite_original ${N}.png
                     DEPENDS
                         tikz-uml.sty
                         header.tex
                         footer.tex
                         ${N}.tex
                     )
  add_custom_target(${N}-png ALL
                    DEPENDS ${N}.png)
endforeach(S)

set(EXAMPLE_DIRECTORIES
hello_world
server
scaling_doubles
multibindings
simple_injection
)

foreach(D ${EXAMPLE_DIRECTORIES})
  add_custom_command(OUTPUT ${D}-deps.png
                     COMMAND bash < ${CMAKE_CURRENT_SOURCE_DIR}/extract_dependencies.sh > ${CMAKE_CURRENT_BINARY_DIR}/${D}.dot
                     COMMAND dot -Goverlap=prism10000 ${CMAKE_CURRENT_BINARY_DIR}/${D}.dot -Tpng -o ${CMAKE_CURRENT_BINARY_DIR}/${D}-deps.png
                     # This normalizes the PNG files, so that we avoid tracking multiple copies of the same file in the Github wiki repo.
                     COMMAND exiftool -all= -overwrite_original ${CMAKE_CURRENT_BINARY_DIR}/${D}-deps.png
                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../examples/${D}
                     DEPENDS
                        ../../examples/${D}
                        extract_dependencies.sh
                     )
  add_custom_target(${D}-deps ALL
                    DEPENDS ${D}-deps.png)
endforeach(D)


{'fraction_non_alphanumeric': 0.08602835749561892, 'fraction_numerical': 0.013063565397482874, 'mean_word_length': 2.3146779303062304, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1327656', 'n_tokens_mistral': 2124, 'n_tokens_neox': 1905, 'n_words': 326}