<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_after_build_all(self, builder, **extra):
 """ after-build-all lektor event """

        # NOTE(vesuvium): compatibility for lektor 2.X and 3.X
        try:
            is_enabled = self.is_enabled(builder.build_flags)
        except AttributeError:
            is_enabled = self.is_enabled(builder.extra_flags)

        if not is_enabled:
            return

        reporter.report_generic('Starting HTML minification')
        for htmlfile in self.find_html_files(builder.destination_path):
            self.minify_file(htmlfile)
        reporter.report_generic('HTML minification finished')