forked from ben-manes/gradle-versions-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OutputFormatterArgument.kt
32 lines (26 loc) · 1.09 KB
/
OutputFormatterArgument.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.github.benmanes.gradle.versions.updates
import com.github.benmanes.gradle.versions.reporter.Reporter
import com.github.benmanes.gradle.versions.reporter.result.Result
import org.gradle.api.Action
/**
* Represents all the types of arguments for output formatting supported in [DependencyUpdatesTask].
*/
sealed interface OutputFormatterArgument {
/**
* A string representing one of the built-in output formatters (i.e. "json", "text", "html" or
* "xml"), or a comma-separated list with a combination of them (e.g. "json,text").
*/
class BuiltIn(val formatterNames: String) : OutputFormatterArgument
/**
* An implementation of the [Reporter] interface to provide a custom output formatting.
*/
class CustomReporter(val reporter: Reporter) : OutputFormatterArgument
/**
* An [Action] to provide a custom output formatting. Enables the use of the trailing closure/lambda
* syntax for output formatting definition.
*/
class CustomAction(val action: Action<Result>) : OutputFormatterArgument
companion object {
val DEFAULT = BuiltIn(formatterNames = "text")
}
}