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 Summary

    Constructors
    Constructor
    Description
    Creates a new DashboardHtmlWriter.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    write(File outputDir, DashboardView view, String templateName, String templateContent)
    Writes dashboard.html and one CSS file per lens in view.lenses() to outputDir, rendering dashboard.html from templateContent - a lens-pack template resolved by id via trackerLens.templateId, rather than a project file or this plugin's own bundled default.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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
    • write

      public File write(File outputDir, DashboardView view, String templateName, String templateContent)
      Writes dashboard.html and one CSS file per lens in view.lenses() to outputDir, rendering dashboard.html from templateContent - a lens-pack template resolved by id via trackerLens.templateId, rather than a project file or this plugin's own bundled default.
      Parameters:
      outputDir - the directory to write into; created if missing
      view - the data to render
      templateName - the template's id, used only for error messages and as the Mustache compiler's internal template name
      templateContent - the lens-pack template's own Mustache source
      Returns:
      the written dashboard.html file