Class TrackerLensExtension
java.lang.Object
com.arc_e_tect.gradle.trackerlens.TrackerLensExtension
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
templateId = "venn-diagram-view" // optional: select a lens pack's own template instead (mutually exclusive with 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 -
Constructor Summary
ConstructorsConstructorDescriptionTrackerLensExtension(org.gradle.api.model.ObjectFactory objects) Creates the extension. -
Method Summary
Modifier and TypeMethodDescriptionabstract 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.RegularFilePropertyOptional single CSS file contributing a lens calledcustom-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.DirectoryPropertyWheredashboard.htmland its lens CSS files are written.abstract org.gradle.api.provider.Property<String> Optional Maven coordinate restricting which single externallensStylepack'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.RegularFilePropertyOptional Mustache template overriding this plugin's own bundled default fordashboard.html.abstract org.gradle.api.provider.Property<String> Optional id of a lens-pack-provided template (built-in or from a resolvedlensStylepack - seelistTrackerLensTemplates) to renderdashboard.htmlfrom, instead of this plugin's own bundled default.org.gradle.api.NamedDomainObjectContainer<TrackerRegistration> The registered trackers.abstract org.gradle.api.provider.Property<String> Version shown alongside the dashboard's name, the same waysystemUnderTestVersionworks on the API-detector plugins (e.g.voidtrackers(org.gradle.api.Action<? super org.gradle.api.NamedDomainObjectContainer<TrackerRegistration>> action) ConfiguresgetTrackers().
-
Field Details
-
NAME
Extension DSL block name, i.e. the name used to register the extension with the project.- See Also:
-
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
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) ConfiguresgetTrackers().- Parameters:
action- the configuration block
-
getLensStylesheet
public abstract org.gradle.api.file.RegularFileProperty getLensStylesheet()Optional single CSS file contributing a lens calledcustom-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
Optional Maven coordinate restricting which single externallensStylepack'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
The lens id active on first load. When unset, defaults tolight-lensif 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()Wheredashboard.htmland 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 fordashboard.html. Every data-bound elementContractRulegoverns is still available to the template as context (seeDASHBOARD-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 againstContractRuleexactly like the bundled default's own output is.- Returns:
- mutable file property for the custom dashboard template
-
getTemplateId
Optional id of a lens-pack-provided template (built-in or from a resolvedlensStylepack - seelistTrackerLensTemplates) to renderdashboard.htmlfrom, instead of this plugin's own bundled default. A lens pack is not just a color scheme: it can ship one or more whole alternate views over the same tracking data, each a Mustache template under itsMETA-INF/arc-e-tect/tracker-lens/templates/resources, selectable by id here.Mutually exclusive with
getTemplate()- setting both fails the build with a clear error, since a project file and a lens-pack id are two different answers to the same question of which template to render. Setting neither keeps today's default: this plugin's own bundled template.- Returns:
- mutable property for the selected lens-pack template's id
-
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
Version shown alongside the dashboard's name, the same waysystemUnderTestVersionworks on the API-detector plugins (e.g.shadow-api-detector): defaults to the project's ownversion(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
-