<https://github.com/Tapchicoma/ktsexec-gradle> - `...
# scripting
t
https://github.com/Tapchicoma/ktsexec-gradle -
KtxExec
task that, for now, supports only simple scripts (jcenter approval is pending)
3
n
so why not on the gradle plugin repo ?
t
it is just a task - plugin is not required in this case
n
then it should be possible to add it as dependency of buildSrc right ?
t
theoretically - yes
n
also whats the ScriptDef used and how can i use a custom one ?
t
it is just a quick hack over yesterday evening - for now just a simple script without external dependencies or special script annotation is supported
if you want something more - open issue/PR 🙂
n
it seems liek this: https://github.com/Tapchicoma/ktsexec-gradle/blob/master/host/src/main/kotlin/by/egorr/gradle/ktsexec/host/KtsExecKotlinScriptHost.kt#L14-L15 has no arguments ? i could recommend a
val vararg args: String
i like the gradle task idea
i can see quite a few usecases to aid gradle-kts
t
yes, next that I want to add is passing arguments to script
n
thats 5-6 lines i think, heh
what i want to try is make this work with custom ScriptDefinitions
t
but how you will pass it to host? 🤔
n
inline reified function should be able to pass the type through
and then its up to the user that they do not mess up the arguments
also could add custom
script${name}
gradle dependencies.. i have the skeleton for that already laying around
but that might be better to solve with file annotations that alreadyx exist in main-kts
e
you could publish it to the portal as a no-op plugin, this would make it possible to bring it into build scripts using the plugins block
t
plugin with empty
apply()
?
e
yup
t
mm, ok
e
the
KtsExec.script
input is a simple string it should be a
RegularFileProperty
instead so Gradle can track the changes in the script
t
thank you for input 🙂
will try to update it later this week
e
The other thing that comes to mind is managing the Kotlin version. It could come from the applied kotlin plugin by convention or be set explicitely.
Good stuff @tapchicoma
👍 2