Class TemplateScanner

java.lang.Object
com.arc_e_tect.gradle.trackerlens.lens.TemplateScanner

public class TemplateScanner extends Object
Scans one classpath root - a directory or a jar, this plugin's own bundled resources or a resolved lensStyle dependency, no distinction - for the fixed META-INF/arc-e-tect/tracker-lens/templates/*.html convention and returns the Templates it finds.

A lens pack is not just a color scheme - it can also ship one or more Mustache dashboard templates, each a whole alternate view over the same tracking data, selectable via trackerLens.templateId. This mirrors LensScanner exactly, one directory over from lenses/; see that type's own javadoc for the reasoning behind every design choice here, none of which differs for templates.

  • Constructor Details

    • TemplateScanner

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

    • scan

      public List<Template> scan(File classpathRoot)
      Scans classpathRoot for templates.
      Parameters:
      classpathRoot - a directory or a .jar file; must exist
      Returns:
      the templates found, in discovery order
      Throws:
      org.gradle.api.GradleException - if classpathRoot ships two template files that resolve to the same lower-cased id