Implement source sections compiler plugin
allows to compile only parts of the source files, denoted by top-level "sections" (function with lambda param calls), but preserving original file line/column numbers for easier diagnostics. Allow e.g. to compile gradle "buildscript" section without preprocessing original file in advance. See tests for examples.
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
|
||||
println("should not be printed")
|
||||
|
||||
fun unlistedSectionName(body: () -> Unit): Unit = body()
|
||||
|
||||
let {
|
||||
println("Hello, World!")
|
||||
}
|
||||
|
||||
println("ignore here")
|
||||
|
||||
unlistedSectionName {
|
||||
println("should not be printed too")
|
||||
}
|
||||
|
||||
println("ignore here")
|
||||
|
||||
apply {
|
||||
println("That's all, folks!")
|
||||
}
|
||||
|
||||
println("ignore here")
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let {
|
||||
println("Hello, World!")
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
apply {
|
||||
println("That's all, folks!")
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Hello, World!
|
||||
That's all, folks!
|
||||
Reference in New Issue
Block a user