Does anyone know how to give loaded scripts a pack...
# scripting
a
Does anyone know how to give loaded scripts a package? I suspect I have something misconfigured
i
Sorry, I'm not sure I understand the question. If you mean defining a package for the script, then
package
directive is supported in the scripts too.
a
@ilya.chernikov Thanks. At the time I also didn't understand the right question to ask. Using the
package
declaration I was able to set the package within a script. Originally I was trying to set a default package to scripts I loaded which didn't have a package declaration--I didn't figure that out but I discovered I was going about it all wrong. I'm working on supporting kts scripts for Cucumber tests. Initially I was hooking into the existing Cucumber Java8 provider that uses reflection to find all of the implementing classes under a list of packages. Although I was able to get kts scripts working this way by manipulating the class loader hierarchy, the real solution for my case is to implement the class service provider that Cucumber provides.