Skip to content

Commit

Permalink
char sequence maybe? please....
Browse files Browse the repository at this point in the history
  • Loading branch information
trevjonez committed Oct 6, 2016
1 parent 192c52e commit 434a41f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugin/src/main/kotlin/com/trevjonez/agrp/AgrpTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ abstract class AgrpTask : DefaultTask() {
}

private fun tagName(): String {
return applyModifiers(cascadeLookup({ it.tagName }, "tagName", validString())!!.toString())
return applyModifiers(cascadeLookup({ it.tagName }, "tagName", validString())!!)
}

private fun targetCommitish(): String? {
Expand All @@ -120,7 +120,7 @@ abstract class AgrpTask : DefaultTask() {
return cascadeLookup({ it.overwrite }, optional = true) ?: false
}

private fun validString(): (String) -> Boolean = { it.trim().length > 0 }
private fun validString(): (CharSequence) -> Boolean = { it.trim().length > 0 }

private fun <T> cascadeLookup(fieldLookup: (AgrpConfigExtension) -> T?,
fieldName: String = "",
Expand All @@ -145,12 +145,12 @@ abstract class AgrpTask : DefaultTask() {
return result
}

private fun applyModifiers(tagName: String): String {
private fun applyModifiers(tagName: CharSequence): String {
var result = tagName
configs.forEach {
if (it.tagModifier != null)
result = it.tagModifier!!.transform(result.toString()).toString()
result = it.tagModifier!!.transform(result.toString())
}
return result
return result.toString()
}
}

0 comments on commit 434a41f

Please sign in to comment.