@@ -14,7 +14,10 @@ import javax.inject.Inject
1414 * dependencyAnalysis {
1515 * reporting {
1616 * onlyOnFailure(false) // when true, only prints postscript when there are failure-level issues.
17+ *
1718 * postscript(/* Some text to help out end users who may not be build engineers. */)
19+ *
20+ * printBuildHealth(false) // when true, prints buildHealth report to console
1821 * }
1922 * }
2023 * ```
@@ -24,6 +27,10 @@ abstract class ReportingHandler @Inject constructor(private val objects: ObjectF
2427 internal val onlyOnFailure: Property <Boolean > = objects.property<Boolean >().convention(false )
2528 internal val postscript: Property <String > = objects.property<String >().convention(" " )
2629
30+ // nb: this intentionally does not have a convention set. If the user does not supply a value, we then check the
31+ // value of the Gradle property, which itself supplies a default value.
32+ internal val printBuildHealth: Property <Boolean > = objects.property<Boolean >()
33+
2734 /* *
2835 * Whether to always include the postscript, or only when the report includes failure-level issues.
2936 */
@@ -40,6 +47,16 @@ abstract class ReportingHandler @Inject constructor(private val objects: ObjectF
4047 this .postscript.disallowChanges()
4148 }
4249
50+ /* *
51+ * Whether to print the buildHealth report to console.
52+ *
53+ * @see [com.autonomousapps.Flags.FLAG_PRINT_BUILD_HEALTH]
54+ */
55+ fun printBuildHealth (printBuildHealth : Boolean ) {
56+ this .printBuildHealth.set(printBuildHealth)
57+ this .printBuildHealth.disallowChanges()
58+ }
59+
4360 internal fun config (): Config {
4461 val config = objects.newInstance<Config >()
4562 config.onlyOnFailure.set(onlyOnFailure)
0 commit comments