gwtpruning

How to disable pruning with GWT compiler


How do I disable pruning in the GWT compiler?

(I'm trying to use the GWT compiler to create a Javascript version of a some game logic written in Java)

Maybe pruning is not the issue? I'm testing with the following Java class and none of the fields or the string "test123" are in the generated .js file;

Test1.java

package com.joyplay.web.games.mmrb.shared.d1;

public class Test1 {
    public String field1;
    public int field2=0;

    public void onModuleLoad() {
        field1 = "test123";
    }

    public int doSomething1(int a){
        return a+555;
    }

    public int doSomething2(){
        return ++field2;
    }    
}

Test1.gwt.xml

<module rename-to="hello">
    <inherits name="com.google.gwt.core.Core" />
    <source path="d1"/>
    <entry-point class="com.joyplay.web.games.mmrb.shared.d1.Test1"/>
</module>

Solution

  • (I'm trying to use the GWT compiler to create a Javascript version of a some game logic written in Java)

    Have a look at the gwt-exporter project.