gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.53k stars 377 forks source link

InterfaceGenerator should create public interface and offer -out option #4599

Open dankurka opened 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 4599

The InterfaceGenerator generates a CssInterface that is in the default
scope, i.e. without a modifier. It would be more flexible if the interface
would be public.

In addition it would be nice, if the InterfaceGenerator would offer a
"-out" argument that can be used to specify the file the output should be
written to.

(The output using System.out does not work when the InterfaceGenerator is
called by an Ant java task started from the NetBeans IDE. I guess that
NetBeans tweaks System.out in such a way that Ant does not receive the output.)

Reported by stefan.wachter@gmx.de on 2010-02-06 21:09:20

dankurka commented 9 years ago
Another trivial bug (oversight) that would take literally 5 seconds to fix!

Along the same lines, the InterfaceGenerator should also probably include SuppressWarning("unused");
in -standalone mode because the imports aren't always used, creating unnecessary warnings
in a generated file.

Reported by kozura on 2011-06-06 02:52:46

dankurka commented 9 years ago
Would like to raise priority on this issue or have a worlaround: the InterfaceGenerator
 is used by the Maven plugin, for automatic generation of interface file, and it becomes
 complex to manage as the number of packages is increasing.

Reported by serge.andouche on 2011-12-19 13:46:56

dankurka commented 9 years ago
workaround:

implement the generated interface by another public interface.

in the code you've to use the created public interface.

Reported by fippi.ko on 2011-12-19 14:15:13

dankurka commented 9 years ago
You can also use a post processing ant task from maven.

<replace dir="${mydir}">
    <include name="**/*CssResource.java"/>
    <replacetoken><![CDATA[import com.google.gwt.resources.client.CssResource.ClassName;
interface]]></replacetoken>
      <replacevalue><![CDATA[import com.google.gwt.resources.client.CssResource.ClassName;
public interface]]></replacevalue>
</replace>

Reported by sanjiv.jivan on 2011-12-19 15:00:41

dankurka commented 9 years ago
Uploaded a review to:

http://gwt-code-reviews.appspot.com/1615806/

Reported by stephen.haberman on 2011-12-19 23:41:17

dankurka commented 9 years ago
Looks good, thanks, can remove the hacky workarounds now...

Reported by kozura on 2011-12-25 22:36:40

dankurka commented 9 years ago
is there a way we can get this included into 2.5.1?

Reported by kurka.daniel on 2013-01-12 00:06:15

dankurka commented 9 years ago
I'm not familiar with the tool but looks like a reasonable change (tough on implementation
side, I'm not sure about the use of guava Function class to the job - which is an easy
fix).

Reported by goktug@google.com on 2013-01-12 00:50:57

dankurka commented 9 years ago
Agreed, the use of Function seems overly complicated.  We could simply have the OutHandler
set a File member, and write to that file if it's non-null and to System.out otherwise.

Reported by mdempsky@google.com on 2013-01-12 00:53:09

dankurka commented 9 years ago
That's agile development. A simple bug that needs 3 years to fix.

Reported by MarkStier on 2013-03-08 16:55:05