Class TrackerRegistration

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

public abstract class TrackerRegistration extends Object
One trackerLens.trackers { register("...") { ... } } DSL registration: which history file(s) to read and which TrackerSourceKind to read them with.
 trackerLens {
     trackers {
         register("bdd-scenarios") {
             historyFiles.from(file("gherkin-progress-history.ndjson"))
             source = TrackerSourceKind.GHERKIN_SCENARIO
         }
         register("api-contracts") {
             // One history file per detector plugin, or a directory containing them - either
             // way, records sharing the same id across files are merged into one.
             historyFiles.from(
                 file("shadow-api-detector-contract-history.ndjson"),
                 file("mirage-api-detector-contract-history.ndjson"),
                 file("doppelganger-api-detector-contract-history.ndjson"))
             source = TrackerSourceKind.API_CONTRACT
         }
     }
 }
 
  • Constructor Details

    • TrackerRegistration

      @Inject public TrackerRegistration(String name)
      Creates a new TrackerRegistration. Instantiated by Gradle's NamedDomainObjectContainer infrastructure.
      Parameters:
      name - this tracker's registered name, becomes data-tracker in the dashboard
  • Method Details

    • getName

      public String getName()
      This tracker's registered name.
      Returns:
      the name
    • getHistoryFiles

      public abstract org.gradle.api.file.ConfigurableFileCollection getHistoryFiles()
      The NDJSON history file(s) to read. Accepts one or more individual files and/or a directory containing them (every *.ndjson file directly within it, non-recursive) - useful when a tracker's history is split across several files, e.g. one contract history file per API-detector plugin instead of all three sharing one. Records sharing the same id across files are merged into a single item rather than rendered as duplicates.

      A configured entry that does not exist at task-run time is skipped with a warning, not a build failure - the producing plugin may not have run yet.

      Returns:
      mutable file collection for the history file(s)/directory
    • getSource

      public abstract org.gradle.api.provider.Property<TrackerSourceKind> getSource()
      Which built-in TrackerSource to read getHistoryFiles() with.
      Returns:
      mutable property for the tracker source kind