google / gwteventbinder

Making GWT EventBus easy
http://google.github.io/gwteventbinder
Apache License 2.0
140 stars 28 forks source link

Missing EventBinder.gwt.xml #15

Closed vasvir closed 10 years ago

vasvir commented 10 years ago

Hi,

The documentation states in the client project's .gwt.xml one should add

In the git checkout there is no such file. There is only module.gwt.xml If I copy this to the proper location the compile runs fine.

cd gwteventbinder/ cp eventbinder/src/main/module.gwt.xml eventbinder/src/main/java/com/google/web/bindery/event/EventBinder.gwt.xml

Am I missing something?

ekuefler commented 10 years ago

Are you using Maven? Maven should automatically generate the file with the correct name based on module.gwt.xml. It should also already be there if you download the jar directly.

It is kind of unfortunate that non-Maven users have to make the change manually. @tbroyer, what's your opinion on best practice here?

vasvir commented 10 years ago

Hi,

Nope I am not using maven. I am building with ant. I don't get it why it is necessary for maven to move around source files?

Vassilis

tbroyer commented 10 years ago

@vasvir It's really not clear to me what your problem is, and what you're trying to do.

The JAR contains com/google/web/bindery/event/EventBinder.gwt.xml so all you have to do is put it in your classpath and add <inherits name="com.google.web.bindery.event.EventBinder" /> to your gwt.xml. And if you're using Maven and the net.ltgt.gwt.maven:gwt-maven-plugin for your own project, you actually just need to add the dependency to your pom.xml and the plugin will automatically generate the <inherits> line in the gwt.xml (see the eventbinder-sample for an example).

There's no such file in the sources because it's generated from the src/main/module.gwt.xml by the net.ltgt.gwt.maven:gwt-maven-plugin (granted, currently and in this project it's just a copy), but I don't see what the problem is here. If you want to build the project yourself, then use Maven as that's what gwt-eventbinder uses; or if you absolutely want to build the project yourself but using another build tool (for whatever reason), then you'll have to replicate what the Maven build does within your build script, and that involves massaging the src/main/module.gwt.xml into com/google/web/bindery/event/EventBinder.gwt.xml (currently just a copy, but in the future the <inherits name="com.google.web.bindery.event.Event" /> line could be generated automatically by the net.ltgt.gwt.maven:gwt-maven-plugin).

So: what are you trying to do? and what is your problem exactly?

vasvir commented 10 years ago

Hi,

Thanks for the detailed answer.

I was trying to build it with ant. Why I didn't use directly the jar? I think it was depending on GWT 2.5 and I wanted to use 2.6. Maybe a misunderstanding of my part.

I didn't guess that producing the gwt.xml was the job of a maven plugin. I thought it was a defect or an indication that I was missing something (indeed).

Anyway it works for me (for now) from my non maven build.

Vassilis

ekuefler commented 10 years ago

Thanks for the explanation Thomas. I pushed v1.0.2 yesterday with support for GWT 2.6, so if you download the new jar you might be able to use it directly.

tbroyer commented 10 years ago

@vasvir no need to recompile just for a different dependency version (unless there are braking changes), a GWT lib is just a JAR with both compiled classes and java sources (and other resources; and possibly a META-INF/gwt/mainModule but that's only used by the net.ltgt.gwt.maven:gwt-maven-plugin), there's no hard/direct dependency with the dependencies used to build it, just like any other JAR.

v1.0.1 was built (and tested) against GWT 2.5.1 but works just as well as v1.0.2 with GWT 2.6 (there was no other change than updating the dependency in the pom.xml; the small breaking change in GWT 2.6 –re. an internal API– was already addressed in v1.0.1)