They are using two-stage compilation, on the resol...
# scripting
i
They are using two-stage compilation, on the resolve request they are splitting the file into “dependencies generating” part and the rest, then run the former (as a script) and use the results as dependencies. This approach should be carefully designed to avoid unnecessary compilation, since resolve requests may come quite often from the IDE. There is an easier way based on annotations, if this is syntactically feasible in your case. The example is implemented here https://github.com/ligee/kotlin-jupyter