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

package-info.java Support #16

Open
mageddo opened this issue Feb 2, 2023 · 0 comments
Open

package-info.java Support #16

mageddo opened this issue Feb 2, 2023 · 0 comments

Comments

@mageddo
Copy link
Member

mageddo commented Feb 2, 2023

Need to support something like this:

package-info.java

@Reflection(
  scanPackage = "com.mageddo.dnsproxyserver.config.entrypoint",
  publicConstructors = true, constructors = true, declaredConstructors = true,
  publicMethods = true, declaredMethods = true,
  publicFields = true, declaredFields = true
)
package com.mageddo.dnsproxyserver.config.entrypoint;

import nativeimage.Reflection;

Actually you will get this error

warning: Supported source version 'RELEASE_7' from annotation processor 'org.gradle.api.internal.tasks.compile.processing.TimeTrackingProcessor' less than -source '17'
error: fatal: element type must be class but is PACKAGE
  java.lang.IllegalArgumentException: element type must be class but is PACKAGE
        at org.apache.commons.lang3.Validate.isTrue(Validate.java:158)
        at com.mageddo.aptools.elements.ElementUtils.validateTypeElement(ElementUtils.java:35)
        at com.mageddo.aptools.elements.ElementUtils.toClassName(ElementUtils.java:23)
        at nativeimage.core.NativeImageReflectionConfigGenerator.addElement(NativeImageReflectionConfigGenerator.java:141)
        at nativeimage.core.NativeImageReflectionConfigGenerator.addToElementAndNested(NativeImageReflectionConfigGenerator.java:126)
        at nativeimage.core.NativeImageReflectionConfigGenerator.addMatchingProjectSourceElements(NativeImageReflectionConfigGenerator.java:95)
        at nativeimage.core.NativeImageReflectionConfigGenerator.processElementsForAnnotation(NativeImageReflectionConfigGenerator.java:82)
        at nativeimage.core.NativeImageReflectionConfigGenerator.processElementsForAnnotation(NativeImageReflectionConfigGenerator.java:72)
        at nativeimage.core.NativeImageReflectionConfigGenerator.process(NativeImageReflectionConfigGenerator.java:50)
        at nativeimage.processor.AnnotationProcessor.process(AnnotationProcessor.java:41)
        at org.gradle.api.internal.tasks.compile.processing.DelegatingProcessor.process(DelegatingProcessor.java:62)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant