so, I'm obnoxiously having to deal with a regressi...
# community-support
c
so, I'm obnoxiously having to deal with a regression by hibernate jpa modelgen https://hibernate.atlassian.net/browse/HHH-18676 how would I do this, such that it keeps only java files. Right now I'm giving it source directories... but he's sticking non java there.
Copy code
tasks.withType<Javadoc>().configureEach {
  dependsOn(tasks.classes)
  source(sourceSets.main.map { it.output.generatedSourcesDirs })
I have no idea how to get from there to actual files
wait, I think this works, but how does this work?
Copy code
exclude {
    logger.quiet("excluding: {}", it.file.path)
    it.file.extension != "java"
  }
it prints
Copy code
excluding: /home/xeno/IdeaProjects/HHH-18676/src/main/java/example
excluding: /home/xeno/IdeaProjects/HHH-18676/build/generated/sources/annotationProcessor/java/main/entity
excluding: /home/xeno/IdeaProjects/HHH-18676/build/generated/sources/annotationProcessor/java/main/example
but if I return false, it prints
Copy code
excluding: /home/xeno/IdeaProjects/HHH-18676/build/generated/sources/annotationProcessor/java/main/entity/index/MyClass
excluding: /home/xeno/IdeaProjects/HHH-18676/build/generated/sources/annotationProcessor/java/main/example
excluding: /home/xeno/IdeaProjects/HHH-18676/build/generated/sources/annotationProcessor/java/main/example/MyClass_.java
excluding: /home/xeno/IdeaProjects/HHH-18676/src/main/java/example
excluding: /home/xeno/IdeaProjects/HHH-18676/src/main/java/example/MyClass.java
excluding: /home/xeno/IdeaProjects/HHH-18676/build/generated/sources/annotationProcessor/java/main/example
excluding: /home/xeno/IdeaProjects/HHH-18676/build/generated/sources/annotationProcessor/java/main/example/MyClass_.java
excluding: /home/xeno/IdeaProjects/HHH-18676/build/generated/sources/annotationProcessor/java/main/entity
excluding: /home/xeno/IdeaProjects/HHH-18676/build/generated/sources/annotationProcessor/java/main/entity/index
excluding: /home/xeno/IdeaProjects/HHH-18676/build/generated/sources/annotationProcessor/java/main/entity/index/MyClass
why does it appear to be printing the filtered items in my log statement although I haven't filtered them yet
actually, I think it's
include("**/*.java")
that's the right answer, but I still don't get the above logging...
t
Fwiw, I agree with the Hibernate maintainer that it's not a bug on their part. An annotation processor can only output files to either CLASS_OUTPUT, SOURCE_OUTPUT or NATIVE_HEADER_OUTPUT. It's your responsibility to only give .java files as input to the javadoc tool.
c
idk, I see it as it worked in version 6.4, it shouldn't break in 6.6 because semver; I see this as a breaking change, not a configuration error on my part. I'd love to know why these files were added, but I'm not going to delve into that. however, the other things you've said are interesting, I didn't know that. we could also talk about why that other code was even needed in the first place... I believe that was a conversation had when I put that piece of code in, whether or not it should even be required for javadoc. Subsequently, since javadoc was being handed directories it might also be rationale to question whether or not javadoc should simply ignore files the doclet doesn't recognize... neither here nor there, I found a fix; it won't be fixed upstream.