-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring
booster-task-analyser
to support reporting API for perf…
…ormance analysis
- Loading branch information
1 parent
4498913
commit 684272a
Showing
5 changed files
with
112 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...n/kotlin/com/didiglobal/booster/task/analyser/performance/reporting/PerformanceReports.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.didiglobal.booster.task.analyser.performance.reporting | ||
|
||
import org.gradle.api.reporting.CustomizableHtmlReport | ||
import org.gradle.api.reporting.ReportContainer | ||
import org.gradle.api.reporting.SingleFileReport | ||
import org.gradle.api.tasks.Internal | ||
|
||
interface PerformanceReports : ReportContainer<SingleFileReport> { | ||
|
||
@get:Internal | ||
val html: CustomizableHtmlReport | ||
|
||
@get:Internal | ||
val json: SingleFileReport | ||
|
||
@get:Internal | ||
val dot: SingleFileReport | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
...tlin/com/didiglobal/booster/task/analyser/performance/reporting/PerformanceReportsImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.didiglobal.booster.task.analyser.performance.reporting | ||
|
||
import org.gradle.api.Task | ||
import org.gradle.api.internal.CollectionCallbackActionDecorator | ||
import org.gradle.api.reporting.CustomizableHtmlReport | ||
import org.gradle.api.reporting.SingleFileReport | ||
import org.gradle.api.reporting.internal.CustomizableHtmlReportImpl | ||
import org.gradle.api.reporting.internal.TaskGeneratedSingleFileReport | ||
import org.gradle.api.reporting.internal.TaskReportContainer | ||
import javax.inject.Inject | ||
|
||
open class PerformanceReportsImpl @Inject constructor( | ||
task: Task, | ||
callbackActionDecorator: CollectionCallbackActionDecorator | ||
) : TaskReportContainer<SingleFileReport>(SingleFileReport::class.java, task, callbackActionDecorator), PerformanceReports { | ||
|
||
init { | ||
add(CustomizableHtmlReportImpl::class.java, "html", task) | ||
add(TaskGeneratedSingleFileReport::class.java, "json", task) | ||
add(TaskGeneratedSingleFileReport::class.java, "dot", task) | ||
} | ||
|
||
override val html: CustomizableHtmlReport | ||
get() = withType(CustomizableHtmlReport::class.java).getByName("html") | ||
|
||
override val json: SingleFileReport | ||
get() = getByName("json") | ||
|
||
override val dot: SingleFileReport | ||
get() = getByName("dot") | ||
|
||
} |