I'm trying to use just the Java to Javascript compiler of the GWT from Ant.
Can I use the GWT compiler without extending any Google classes such as com.google.gwt.core.Core
or similar. If so how? I'm currently using the setup below on GWT 2.4.0.
I'm calling the ant task:
build.xml
<target name="gwtc" description="GWT compile to JavaScript (production mode)">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler">
<classpath>
<pathelement location="src"/>
<path refid="project.class.path"/>
<pathelement location="${gwt.sdk}/validation-api-1.0.0.GA.jar" />
<pathelement location="${gwt.sdk}/validation-api-1.0.0.GA-sources.jar" />
</classpath>
<!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
<jvmarg value="-Xmx256M"/>
<arg line="-war"/>
<arg value="war"/>
<!-- Additional arguments like -style PRETTY or -logLevel DEBUG -->
<arg line="${gwt.args}"/>
<arg value="foo.Test1"/>
</java>
</target>
foo/Test.java
package foo;
public class Test1 {
public String field1;
public String field2;
public int field3;
}
foot/Test1.gwt.xml
<module rename-to="hello">
<source path="foo.Test1"/>
<!--entry-point class="foo.Test1"/-->
</module>
And output:
gwtc:
[java] Compiling module foo.Test1
[java] [ERROR] Unable to find type 'java.lang.Object'
[java] [ERROR] Hint: Check that your module inherits 'com.google.gwt.core.Core' either directly or indirectly (most often by inheriting module 'com.google.gwt.user.User')