kscripting / kscript

Scripting enhancements for Kotlin
MIT License
2.07k stars 125 forks source link

Kotlin options in script don't make it into packaging #365

Open vsajip opened 2 years ago

vsajip commented 2 years ago

This line https://github.com/holgerbrandl/kscript/blob/dc827753adf707cf31cd220716e85139cae2d9cd/src/main/kotlin/kscript/app/code/GradleTemplates.kt#L44 fails to pick up Kotlin options declared like this: https://github.com/holgerbrandl/kscript/blob/dc827753adf707cf31cd220716e85139cae2d9cd/test/resources/package_example.kts#L1

I see that the Script has these two fields: https://github.com/holgerbrandl/kscript/blob/dc827753adf707cf31cd220716e85139cae2d9cd/src/main/kotlin/kscript/app/model/Script.kt#L21-L22 However the kotlinOpts seems not to be used, at least in the Gradle template generation, How come?

vsajip commented 2 years ago

Also, I can't see how the original Gradle capsule plugin would have got the information (like the -Xmx setting). Any pointers?

aartiPl commented 2 years ago

Some small improvements are already in 4.1 branch. Please have a look.

vsajip commented 2 years ago

I compared branches - there's little to no overlap. Anyway, I've updated my code to pick up those flags now.