intendia-oss / autorest

Auto RESTful Service Proxy Generator for GWT
Apache License 2.0
80 stars 19 forks source link

dependency #3

Closed jesperldk closed 7 years ago

jesperldk commented 7 years ago

Sorry, I am new to (too) many things: RxJava, GWT and also totally new to Maven :-( And new to githup as well. This is probably just a cry for help and not an real issue. Please let me know where I should ask this question instead of here. In the Eclipse Maven plugin I searched for com.intendia.gwt.autorest and selected the artifact autorest-gwt, and I got version 0.5 and scope "Compile". This adds the following to the pom:

    <dependency>
        <groupId>com.intendia.gwt.autorest</groupId>
        <artifactId>autorest-gwt</artifactId>
        <version>0.5</version>
        <type>gwt-lib</type>
    </dependency>

But gives me the following error: Failure to find com.intendia.gwt.autorest:autorest-gwt:gwt-lib:0.5 in https://repo.maven.apache.org/maven2

I am now lost...

ibaca commented 7 years ago

The type is optional, so just remove it. If you still have problems, upload your project to github and I'll try to help. Maybe it is recommended that you first get it work in the command line using mvn, and later on, you try to integrate it in eclipse. And, be careful that eclipse and the GWT eclipse plugin has been changed quite frequently during the last year. This video and the last videos of Brandon chanel is the best way to learn how to use it.

jesperldk commented 7 years ago

Thank you, very kind of your!! I am trying to figure it out, and are making some progress.

I got some jar's when removing the type tag from the pom. I got rxjava and rxjava-source, makes sense. Then I got rxjava-gwt, but no source?? I got autorest-core and autorest-core-sources, good. But I only got autorest-gwt, and seems to be missing autorest-gwt-sources. Am I correct in thinking I am missing rxjava-gwt-sources and autorest-gwt-sources? Do you know how I can convince eclipse/maven to get those?

I also need to figure out how to make gwt compile the source jars, but it is fair that I better read a little about that my self ;-) I figure I need to use the gwt.xml modules from the jars, but have not yet figured out how to do that.

jesperldk commented 7 years ago

Ok, I got a simple Observable to run in my client - that's a start :-) (And I am forcing my self to ignore that I would have liked a Flowable ;-). Of course I just needed to add
<inherits name='com.intendia.gwt.autorest.AutoRest'/> I would still think I need the missing sources? I will look into autorest in the comming days.

ibaca commented 7 years ago

autorest-gwt is a gwt client only library, which means that it include the sources in the lib itself, so the sources variant is not required. More info here https://tbroyer.github.io/gwt-maven-plugin/.

And yep, rxjava 2 will be awesome 🥇!

jesperldk commented 7 years ago

Ah, got it now. Thank you for your patience!

jesperldk commented 7 years ago

It's a bit steep learning curve for me - but still think it will be worth it, Autorest and RxJava-GWT just seems like the right approach.

A few notes to others starting with Autorest (ibaca might choose to add a little to the README ;-) ):

I develop with Eclipse and Maven, I would guess that is pretty common, a few notes about that:

ibaca commented 7 years ago

Thank you! All this comments are very helpful to try to make it more easy to start with! I like the idea behind autorest, but I'm not very "practical", so in general the documentation is a bit confusing centered in how it is done and why, that what it actually does and how to use it.

Actually (hehe confusing again), I think that it is important to know that most of your code will be JAX-RS interfaces and DTOs, and this code is not autorest dependant, and if you use JsInterop as encoding/decoding lib in the client side, this will make your client side request code quite simple (almost completely delegated to the browser). I suppose that this is what you are looking for. If this is right, I also encourage that you should understand or even feel that you can just remove autorest and implement the client side code to make it run again (a bit boilerplate, but quite easy code) in just a few hours. If you feel that way, you are in the right path. This is why a call "a boilerplate reducer" to this lib. And this is why most of the "important" part of autorest is the lot of limitations (like not using inheritance in DTOs 😉) to make it simple to implement encode/decode and request/response code.

Why you said that the example is out of date? I will add a link to the nominatim example, yep! it is a good idea and it is much better example that the example project. Actually, the example project is more an "integration test" project than an pretty/best-practice project, so I suppose is another point that add more confusion. Also, configuring eclipse is out of the scope, but adding a link to a good tutorial is a good idea! this channel is the best place https://www.youtube.com/playlist?list=PLBbgqtDgdc_TqzA-qXrjgTFMC_6DKAQyT.