Skip to content

Passing explicit classes to .compile() requires annotation processing #354

@ascopes

Description

@ascopes

It would appear that passing explicit class names to JctCompiler.compile(Workspace, String...); results in an error if annotation processing is not explicitly enabled.

Looks like this is the result of how we use the
class names collection in JavaCompiler.getTask, which appears to be explicitly for annotation processors only (see https://docs.oracle.com/en/java/javase/12/docs/api/java.compiler/javax/tools/JavaCompiler.html#getTask(java.io.Writer,javax.tools.JavaFileManager,javax.tools.DiagnosticListener,java.lang.Iterable,java.lang.Iterable,java.lang.Iterable)).

Since this argument is specifically for filtering the classes that get annotation processed, the class names should probably be used to filter out the compilation units internally instead of using them in the classes collection.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions