generated from cortinico/kotlin-gradle-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from takahirom/takahirom/add-repoters-to-Measu…
…reBuildsExtension/2024-03-18 Add Customizable MetricsReporters to the Measure-Builds Gradle Plugin
- Loading branch information
Showing
13 changed files
with
195 additions
and
139 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
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
23 changes: 23 additions & 0 deletions
23
...-builds/src/main/java/com/automattic/android/measure/reporters/InMemoryMetricsReporter.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,23 @@ | ||
package com.automattic.android.measure.reporters | ||
|
||
import com.automattic.android.measure.InMemoryReport | ||
import org.gradle.api.Action | ||
import org.gradle.api.provider.Property | ||
|
||
object InMemoryMetricsReporter { | ||
|
||
lateinit var buildMetricsPreparedAction: Property<Action<MetricsReport>> | ||
|
||
fun report( | ||
report: InMemoryReport, | ||
gradleScanId: String? | ||
) { | ||
val result = object : MetricsReport { | ||
override val report: InMemoryReport | ||
get() = report | ||
override val gradleScanId: String? | ||
get() = gradleScanId | ||
} | ||
buildMetricsPreparedAction.get().execute(result) | ||
} | ||
} |
Oops, something went wrong.