kotlin-script-parser-test
kotlin-script-parser-test copied to clipboard
[Question] Adding dependencies to classpath not working?
Sorry to post a relatively unrelated question, but I don't know where to ask otherwise.
How can i add dependencies to the parsing process?
More specifically i have some custom annotations inside another module. These annotations look like so: annotation class Foo(val bar: String = "")
.
When i parse a class i cannot access the parameter bar
.
But when I add the source file of the annotation as well, I can. But this is not possible in the final "product". I there only have the annotation as a dependency.
In the class parser there is this line: classpath += PathUtil.getResourcePathForClass(AnnotationTarget.CLASS.javaClass)
I tried adding the annotation dependency there like so: classpath += PathUtil.getResourcePathForClass(Foo::class.java)
but this doesn't seem to change anything.
Do you know a solution to this problem?