quarkusio / gizmo

Apache License 2.0
52 stars 41 forks source link

support package-info for package annotation #34

Open dufoli opened 4 years ago

dufoli commented 4 years ago

the need is to support package annotation. In cxf patch, I need to support this generation: https://github.com/apache/cxf/blob/master/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/WrapperClassGenerator.java#L234

stuartwdouglas commented 4 years ago

What is actually missing here? Is it just the flags that are wrong or is there something else missing?

dufoli commented 4 years ago

ClassCreator is usefull to generate a class with annotation /methods/fields but when I need to annotate only package without class. What can I use ?

here is an example: https://github.com/apache/cxf/blob/master/testutils/src/main/java/org/apache/cxf/customer/bare/package-info.java

stuartwdouglas commented 4 years ago

package-info is just a normal class file, can't you just generate a class named package-info and add class level anntoations?

dufoli commented 4 years ago

I have check by dumping my class file. Here is the result in idea:

package io.quarkus.it.cxf.quarkus_jaxws_asm;

@javax.xml.bind.annotation.XmlSchema(namespace = "http://cxf.it.quarkus.io/") public class $$package-info / Real name is 'package-info' / { public $$package-info / Real name is 'package-info' /() { / compiled code / } }

dufoli commented 4 years ago

I expect to have :

@javax.xml.bind.annotation.XmlSchema(namespace = "http://cxf.it.quarkus.io/") package io.quarkus.it.cxf.quarkus_jaxws_asm;

dufoli commented 4 years ago

I need feedback, for implementation of package info support before going further.

stuartwdouglas commented 4 years ago

Are you sure it does not already work? Just create a class called package-info

dufoli commented 4 years ago

I will retry with class creator

dufoli commented 4 years ago

indeed I can not test it because the important parameter is an enum. and enum has been fixed few weeks ago. So I will wait release to test it on my project .

stuartwdouglas commented 4 years ago

https://github.com/quarkusio/quarkus/pull/12814