Has anyone come up with an annotation processor that can mimic the functionary of resources?

103 views
Skip to first unread message

Magali Joine

unread,
Oct 22, 2019, 1:54:59 AM10/22/19
to GWT Users
Has anyone come up with an annotation processor that can mimic the functionary of resources?

Something like:

@ResourceBundle
public interface ResourcesBundle {
      @ResourceBundleFile("my-test-file.txt")
      String getResource1();
      @ResourceBundleFile("my-test-data.bin")
     byte[] getResource2();    
}

public void getResources(){
     ResourcesBundle bundle = new ResourcesBundleBuilder(); //where this is the class generated by the annotation processor
     String r1 = bundle.getResource1();
     byte[] r2 = bundle.getResource2();
}

and the generated class might look something like:

public class ResourcesBundleBuilder {
    public String getResource1(){
        return "contents of text file embedded into Java as Java escaped string";
    }

   public byte[] getResource2(){
       return new byte[]{1,2,3,4,5,6,7,8,9,0xa,0xb,0xc}; //byte sequence read directly from source file
   }
}

Jens

unread,
Oct 22, 2019, 2:16:43 AM10/22/19
to GWT Users
The migrated (J2CL / GWT3 ready) version of GWT Resources uses annotation processing: https://github.com/treblereel/gwt-resources/

-- J.

Juan Pablo Gardella

unread,
Oct 22, 2019, 2:48:37 AM10/22/19
to GWT Users
Thanks Jens,

Do you know if there is a resource where all modules and its repository are documented? I saw some google doc before, but I do not know if it is the last resource with all github repo.

Juan

On Tue, 22 Oct 2019 at 03:17, Jens <jens.ne...@gmail.com> wrote:
The migrated (J2CL / GWT3 ready) version of GWT Resources uses annotation processing: https://github.com/treblereel/gwt-resources/

-- J.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/aff146ac-f8d2-4b58-a5e1-b8d909507d42%40googlegroups.com.

Jens

unread,
Oct 22, 2019, 2:54:20 AM10/22/19
to GWT Users

Do you know if there is a resource where all modules and its repository are documented? I saw some google doc before, but I do not know if it is the last resource with all github repo.

 Only that google doc and ci.vertispan.com basically.

-- J.

Jens

unread,
Oct 22, 2019, 2:58:34 AM10/22/19
to GWT Users
Some projects are already moved to GitHub gwtproject organization.


-- J.

Magali Joine

unread,
Oct 23, 2019, 2:45:42 PM10/23/19
to GWT Users
Are there any guidelines on how to use this? I see it does build with jitpack.io.
Reply all
Reply to author
Forward
0 new messages