mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 08:27:12 -07:00
Allow variables in buildScript{}.
Fixes https://github.com/cbeust/kobalt/issues/340
This commit is contained in:
parent
c90125ede0
commit
204ca452e5
1 changed files with 3 additions and 0 deletions
|
@ -21,6 +21,7 @@ class BlockExtractor(val regexp: Pattern, val opening: Char, val closing: Char)
|
||||||
var foundClosing = false
|
var foundClosing = false
|
||||||
var count = 0
|
var count = 0
|
||||||
val result = StringBuffer()
|
val result = StringBuffer()
|
||||||
|
val topLines = arrayListOf<String>()
|
||||||
|
|
||||||
fun updateCount(line: String) {
|
fun updateCount(line: String) {
|
||||||
val currentLine = StringBuffer()
|
val currentLine = StringBuffer()
|
||||||
|
@ -46,8 +47,10 @@ class BlockExtractor(val regexp: Pattern, val opening: Char, val closing: Char)
|
||||||
if (found) {
|
if (found) {
|
||||||
foundKeyword = true
|
foundKeyword = true
|
||||||
count = 1
|
count = 1
|
||||||
|
result.append(topLines.joinToString("\n"))
|
||||||
result.append(line).append("\n")
|
result.append(line).append("\n")
|
||||||
} else {
|
} else {
|
||||||
|
topLines.add(line)
|
||||||
updateCount(line)
|
updateCount(line)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue