Skip to content

Commit

Permalink
add singleFile support (via #111)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrolamarao authored Jul 30, 2024
1 parent be42a50 commit c81d3c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,14 @@ open class AllureReportExtension @Inject constructor(
fun dependsOnTests() {
dependsOnTests.set(true)
}

/**
* By default, Allure generates multi-file reports.
* To generate single-file reports, set this property to true.
*/
val singleFile: Property<Boolean> = objects.property<Boolean>().convention(
project.provider {
false
}
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ abstract class AllureReport @Inject constructor(objects: ObjectFactory) : Allure
@Option(option = "clean", description = "Clean Allure report directory before generating a new one")
val clean = objects.property<Boolean>().convention(false)

@Input
val singleFile = objects.property<Boolean>().convention(
project.the<AllureExtension>().report.singleFile
)

companion object {
const val NAME = "allureReport"
const val GENERATE_COMMAND = "generate"
Expand All @@ -50,6 +55,9 @@ abstract class AllureReport @Inject constructor(objects: ObjectFactory) : Allure
if (clean.get()) {
args += "--clean"
}
if (singleFile.get()) {
args += "--single-file"
}
args
}
)
Expand Down

0 comments on commit c81d3c2

Please sign in to comment.