Class LensScanner

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

public class LensScanner 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/lenses/*.css convention and returns the Lenses it finds.

This is the single method called both for this plugin's own bundled built-in lenses and for every resolved external style pack: only the technical means of locating the classpath root File to pass in differs between the two: it is never special-cased here. See LensResolver for the cross-root merge, collision, and auto-namespacing logic that follows scanning.

  • Constructor Details

    • LensScanner

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

    • scan

      public List<Lens> scan(File classpathRoot)
      Scans classpathRoot for lenses.
      Parameters:
      classpathRoot - a directory or a .jar file; must exist
      Returns:
      the lenses found, in discovery order
      Throws:
      org.gradle.api.GradleException - if classpathRoot ships two lens files that resolve to the same lower-cased id (a defensive check: within one pack, one directory is inherently one namespace, so this should not happen in practice)