Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allure-description-javadoc: mark all java versions as supported #930

Merged
merged 3 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.ExecutableElement;
Expand All @@ -45,7 +44,6 @@
* @author Egor Borisov [email protected]
*/
@SupportedAnnotationTypes("io.qameta.allure.Description")
@SupportedSourceVersion(SourceVersion.RELEASE_8)
public class JavaDocDescriptionsProcessor extends AbstractProcessor {

private Filer filer;
Expand All @@ -61,6 +59,11 @@ public synchronized void init(final ProcessingEnvironment env) {
messager = env.getMessager();
}

@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latest();
}

@Override
public boolean process(final Set<? extends TypeElement> annotations, final RoundEnvironment env) {
final Set<? extends Element> elements = env.getElementsAnnotatedWith(Description.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ void captureDescriptionTest() {
"}"
);

Compiler compiler = javac().withProcessors(new JavaDocDescriptionsProcessor());
Compiler compiler = javac().withProcessors(new JavaDocDescriptionsProcessor())
.withOptions("-Werror");
Compilation compilation = compiler.compile(source);
assertThat(compilation).generatedFile(
StandardLocation.CLASS_OUTPUT,
Expand Down