kotlin-script-parser-test icon indicating copy to clipboard operation
kotlin-script-parser-test copied to clipboard

[Question] Adding dependencies to classpath not working?

Open chippmann opened this issue 5 years ago • 0 comments

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?

chippmann avatar Feb 14 '20 14:02 chippmann