Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian-panek-vmltech committed Nov 28, 2022
1 parent c3bb916 commit efbb35b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ open class ConfigExtension(val project: Project) {

fun valuesSaved(propFilter: (Prop) -> Boolean) = get().valuesSaved(propFilter)

fun valueSaved(propName: String) = get().valueSaved(propName)

fun value(propName: String) = read().value(propName)

fun valueOrNull(propName: String) = read().valueOrNull(propName)
Expand Down
2 changes: 2 additions & 0 deletions plugin/src/main/kotlin/io/wttech/gradle/config/Definition.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ open class Definition(val name: String, val project: Project) {

fun valuesSaved(propFilter: (Prop) -> Boolean) = props.filter(propFilter).associate { it.name to it.valueSaved() }.toSortedMap()

fun valueSaved(propName: String) = getProp(propName).valueSaved()

fun value(propName: String) = valueOrNull(propName)
?: throw ConfigException("Config '$name' prop '$propName' is null!")

Expand Down

0 comments on commit efbb35b

Please sign in to comment.