Class DashboardHtmlWriter

java.lang.Object
com.arc_e_tect.gradle.trackerlens.dashboard.DashboardHtmlWriter

public class DashboardHtmlWriter extends Object
Renders DashboardView to dashboard.html plus one CSS file per discovered lens, via a Mustache template - this plugin's own bundled default, or a user-supplied override.

Every element governed by ContractRule is emitted exactly as that contract requires by the bundled default template; everything else - headings, captions, disclaimer wording - is free text and may be reworded at will, including by simply editing a copy of it (see template in the extension DSL). Whichever template rendered it, this writer's output is always run back through com.arc_e_tect.gradle.trackerlens.contract.LensContractValidator by GenerateTrackerLensTask as the unconditional last step of generation - a user template that has drifted from the contract is caught exactly the same way the bundled one would be.

  • Constructor Details

    • DashboardHtmlWriter

      public DashboardHtmlWriter()
      Creates a new DashboardHtmlWriter.
  • Method Details

    • write

      public File write(File outputDir, DashboardView view, File customTemplate)
      Writes dashboard.html and one CSS file per lens in view.lenses() to outputDir, rendering dashboard.html from customTemplate when given, otherwise from this plugin's own bundled default template.
      Parameters:
      outputDir - the directory to write into; created if missing
      view - the data to render
      customTemplate - a user-supplied Mustache template file, or null to use the bundled default
      Returns:
      the written dashboard.html file