Class TrackerLensExtension

java.lang.Object
com.arc_e_tect.gradle.trackerlens.TrackerLensExtension

public abstract class TrackerLensExtension extends Object
DSL extension for the Tracker Lens Gradle plugin.
 trackerLens {
     trackers {
         register("bdd-scenarios") { historyFiles.from(file("gherkin-progress-history.ndjson")); source = TrackerSourceKind.GHERKIN_SCENARIO }
         register("api-contracts") { historyFiles.from(file("api-contract-progress.ndjson")); source = TrackerSourceKind.API_CONTRACT }
     }
     lensStylesheet = file("my-theme.css")           // optional: contributes a lens called "custom-lens", highest precedence for that one id
     preferredLensPack = "com.example:midnight-theme" // optional: restrict which external pack's lenses are offered
     defaultLens = "dark-lens"                        // optional
     template = file("dashboard-template.html")       // optional: override the bundled dashboard.html Mustache template
     outputDir = layout.buildDirectory.dir("reports/tracker-lens")  // default shown
     dashboardName = "Checkout Service Lens"          // optional; default: "${project.name} Lens"
     version = "2.3.0"                                // optional; default: project.version
 }

 dependencies {
     lensStyle("com.example:midnight-theme:1.2.0")
 }
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Name of the resolvable configuration external style packs are declared against.
    static final String
    Extension DSL block name, i.e.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TrackerLensExtension(org.gradle.api.model.ObjectFactory objects)
    Creates the extension.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.provider.Property<String>
    The dashboard's displayed name, shown in the browser tab title and the page heading.
    abstract org.gradle.api.provider.Property<String>
    The lens id active on first load.
    abstract org.gradle.api.file.RegularFileProperty
    Optional single CSS file contributing a lens called custom-lens, always resolved with the highest precedence for that id (it is placed first among lens sources, so it can never be pushed into an auto-namespaced id by a collision).
    abstract org.gradle.api.file.DirectoryProperty
    Where dashboard.html and its lens CSS files are written.
    abstract org.gradle.api.provider.Property<String>
    Optional Maven coordinate restricting which single external lensStyle pack's lenses are offered in the switcher, for when several resolved packs contribute distinct, non-colliding lenses and only one pack's lenses should ever be shown.
    abstract org.gradle.api.file.RegularFileProperty
    Optional Mustache template overriding this plugin's own bundled default for dashboard.html.
    org.gradle.api.NamedDomainObjectContainer<TrackerRegistration>
    The registered trackers.
    abstract org.gradle.api.provider.Property<String>
    Version shown alongside the dashboard's name, the same way systemUnderTestVersion works on the API-detector plugins (e.g.
    void
    trackers(org.gradle.api.Action<? super org.gradle.api.NamedDomainObjectContainer<TrackerRegistration>> action)
    Configures getTrackers().

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NAME

      public static final String NAME
      Extension DSL block name, i.e. the name used to register the extension with the project.
      See Also:
    • LENS_STYLE_CONFIGURATION_NAME

      public static final String LENS_STYLE_CONFIGURATION_NAME
      Name of the resolvable configuration external style packs are declared against.
      See Also:
  • Constructor Details

    • TrackerLensExtension

      @Inject public TrackerLensExtension(org.gradle.api.model.ObjectFactory objects)
      Creates the extension. Instantiated by Gradle's extension-creation infrastructure.
      Parameters:
      objects - Gradle's object factory
  • Method Details

    • getTrackers

      public org.gradle.api.NamedDomainObjectContainer<TrackerRegistration> getTrackers()
      The registered trackers. At least one must be registered.
      Returns:
      the tracker registration container
    • trackers

      public void trackers(org.gradle.api.Action<? super org.gradle.api.NamedDomainObjectContainer<TrackerRegistration>> action)
      Configures getTrackers().
      Parameters:
      action - the configuration block
    • getLensStylesheet

      public abstract org.gradle.api.file.RegularFileProperty getLensStylesheet()
      Optional single CSS file contributing a lens called custom-lens, always resolved with the highest precedence for that id (it is placed first among lens sources, so it can never be pushed into an auto-namespaced id by a collision).
      Returns:
      mutable file property for the custom lens stylesheet
    • getPreferredLensPack

      public abstract org.gradle.api.provider.Property<String> getPreferredLensPack()
      Optional Maven coordinate restricting which single external lensStyle pack's lenses are offered in the switcher, for when several resolved packs contribute distinct, non-colliding lenses and only one pack's lenses should ever be shown. Not needed to resolve an id collision - those are auto-namespaced regardless of this property.
      Returns:
      mutable property for the preferred lens pack coordinate
    • getDefaultLens

      public abstract org.gradle.api.provider.Property<String> getDefaultLens()
      The lens id active on first load. When unset, defaults to light-lens if discovered, otherwise the first lens id in alphabetical order.
      Returns:
      mutable property for the default lens id
    • getOutputDir

      public abstract org.gradle.api.file.DirectoryProperty getOutputDir()
      Where dashboard.html and its lens CSS files are written.
      Returns:
      mutable directory property for the output directory
    • getTemplate

      public abstract org.gradle.api.file.RegularFileProperty getTemplate()
      Optional Mustache template overriding this plugin's own bundled default for dashboard.html. Every data-bound element ContractRule governs is still available to the template as context (see DASHBOARD-THEMING.adoc); everything else - headings, captions, disclaimer wording - is the template's own literal text, so a translated or reworded copy of the bundled template survives regeneration instead of being overwritten. Whichever template rendered it, the output is always validated against ContractRule exactly like the bundled default's own output is.
      Returns:
      mutable file property for the custom dashboard template
    • getDashboardName

      public abstract org.gradle.api.provider.Property<String> getDashboardName()
      The dashboard's displayed name, shown in the browser tab title and the page heading. Defaults to "<project.name> Lens"; set this to use a different name verbatim - whatever it's set to is used exactly as given, with no " Lens" suffix added.
      Returns:
      mutable property for the dashboard's displayed name
    • getVersion

      public abstract org.gradle.api.provider.Property<String> getVersion()
      Version shown alongside the dashboard's name, the same way systemUnderTestVersion works on the API-detector plugins (e.g. shadow-api-detector): defaults to the project's own version (as set in the build file or a properties file); set this property to show a different version instead, e.g. when the trackers registered here reflect a different artifact than the one being built.
      Returns:
      mutable property for the displayed version