Annotation processor in Gradle outputs source files to build/classes making javadoc fail. How to fix it?

前端 未结 2 1292
庸人自扰
庸人自扰 2021-01-05 13:37

I have an annotation processor that is automatically picked up by the Java compiler at build time (using SPI). During a gradle build, the generated java sources of this anno

2条回答
  •  清歌不尽
    2021-01-05 13:58

    I am not quite sure weather it is a bug or not. But as a workaround just filter the sources of javadoc.

    Depending on how your build script looks like, it should look something like thistask

    myJavadocs(type: Javadoc) {
      classpath = sourceSets.main.output.filter { it -> !it.name.endsWith('.java') }
    }
    

提交回复
热议问题