Commit d3449728 authored by Pavitra Golchha's avatar Pavitra Golchha Committed by Evan W. Patton

Add support for GWT Super Dev Mode (#1132)

parent d6d09e1e
...@@ -151,5 +151,20 @@ The automated tests depend on [Phantomjs](http://phantomjs.org/). Make sure you ...@@ -151,5 +151,20 @@ The automated tests depend on [Phantomjs](http://phantomjs.org/). Make sure you
$ ant tests $ ant tests
### Hot-reloading GWT code with 'Super Dev Mode'
1. Run `ant devmode`
2. [Run the main server](#running-the-main-server).
3. Open http://localhost:9876 (*GWT CodeServer*) and drag the two bookmarklets (*Dev Mode On & Off*) to the bookmarks bar.
4. Open http://localhost:8888 (*App Engine server*)
5. To see changes "live":
1. Save your changes in file.
2. Click on the *"Dev Mode On"* bookmarklet.
3. A popup will be shown with a button to compile `ode` module.
4. Press that button to compile. (That button is actually a bookmarklet. So you can drag this button to the bookmarks bar as well. This will come handy for subsequent compilations)
5. After that, *GWT CodeServer* will compile the module incrementally.
6. Refresh the page and that's it! The changes are live.
Logs can be found at http://localhost:9876/log/ode and SourceMaps at http://localhost:9876/sourcemaps/ode
## Need help? ## Need help?
Join [our community](https://community.appinventor.mit.edu/). Join [our community](https://community.appinventor.mit.edu/).
...@@ -579,6 +579,41 @@ ...@@ -579,6 +579,41 @@
</java> </java>
</target> </target>
<target name="devmode"
depends="common_CommonUtils,common_CommonVersion,components_CommonConstants,AiClientLib,AiRebindLib,CheckYaClientApp"
description="Run development mode">
<java failonerror="true" fork="true" classname="com.google.gwt.dev.codeserver.CodeServer">
<classpath>
<pathelement location="src" />
<pathelement location="${build.dir}/components/ComponentTranslation/src" />
<pathelement location="${build.war.dir}/WEB-INF/classes" />
<pathelement location="${local.build.dir}/AiRebindLib.jar" />
<pathelement location="${build.dir}/common/BlocksEditorHttpConstants-gwt.jar" />
<pathelement location="${build.dir}/common/CommonUtils-gwt.jar" />
<pathelement location="${build.dir}/common/CommonVersion-gwt.jar" />
<pathelement location="${build.dir}/components/CommonConstants-gwt.jar" />
<!-- external libs -->
<pathelement location="${lib.dir}/findbugs/jsr305.jar" />
<pathelement location="${lib.dir}/guava/guava-20.0.jar" />
<pathelement location="${lib.dir}/guava/guava-gwt-20.0.jar" />
<pathelement location="${lib.dir}/guava/error_prone_annotations-2.0.12.jar" />
<pathelement location="${lib.dir}/guava/j2objc-annotations-1.1.jar" />
<pathelement location="${lib.dir}/gwt_dragdrop/gwt-dnd-3.2.3.jar" />
<pathelement location="${lib.dir}/gwt_incubator/gwt-incubator-20101117-r1766.jar" />
<pathelement location="${lib.dir}/gwt_query/gwtquery-1.5-beta1.jar" />
<!-- gwt libs -->
<pathelement location="${gwt.sdk}/gwt-codeserver.jar" />
<pathelement location="${gwt.sdk}/gwt-dev.jar" />
<pathelement location="${gwt.sdk}/gwt-user.jar" />
<pathelement location="${gwt.sdk}/validation-api-1.0.0.GA.jar" />
<pathelement location="${gwt.sdk}/validation-api-1.0.0.GA-sources.jar" />
</classpath>
<jvmarg value="-Xmx1G" />
<arg line="-style PRETTY -logLevel INFO" />
<arg value="com.google.appinventor.YaClient" />
</java>
</target>
<!-- ===================================================================== <!-- =====================================================================
AiClientLibTests: build and run the AiClientLib tests and generate the output results AiClientLibTests: build and run the AiClientLib tests and generate the output results
===================================================================== --> ===================================================================== -->
......
...@@ -283,7 +283,7 @@ public final class MockComponentsUtil { ...@@ -283,7 +283,7 @@ public final class MockComponentsUtil {
Element element = w.getElement(); Element element = w.getElement();
String widthStyle = DOM.getStyleAttribute(element, "width"); String widthStyle = DOM.getStyleAttribute(element, "width");
String heightStyle = DOM.getStyleAttribute(element, "height"); String heightStyle = DOM.getStyleAttribute(element, "height");
String lineHeightStyle = DOM.getStyleAttribute(element, "line-height"); String lineHeightStyle = DOM.getStyleAttribute(element, "lineHeight");
if (widthStyle != null) { if (widthStyle != null) {
DOM.setStyleAttribute(element, "width", null); DOM.setStyleAttribute(element, "width", null);
} }
...@@ -291,7 +291,7 @@ public final class MockComponentsUtil { ...@@ -291,7 +291,7 @@ public final class MockComponentsUtil {
DOM.setStyleAttribute(element, "height", null); DOM.setStyleAttribute(element, "height", null);
} }
if (lineHeightStyle != null) { if (lineHeightStyle != null) {
DOM.setStyleAttribute(element, "line-height", "initial"); DOM.setStyleAttribute(element, "lineHeight", "initial");
} }
return new String[] { widthStyle, heightStyle, lineHeightStyle }; return new String[] { widthStyle, heightStyle, lineHeightStyle };
} }
...@@ -312,7 +312,7 @@ public final class MockComponentsUtil { ...@@ -312,7 +312,7 @@ public final class MockComponentsUtil {
DOM.setStyleAttribute(element, "height", style[1]); DOM.setStyleAttribute(element, "height", style[1]);
} }
if (style[2] != null) { if (style[2] != null) {
DOM.setStyleAttribute(element, "line-height", style[2]); DOM.setStyleAttribute(element, "lineHeight", style[2]);
} }
} }
......
...@@ -71,6 +71,10 @@ ...@@ -71,6 +71,10 @@
<ant inheritAll="false" useNativeBasedir="true" dir="aimerger" target="AIMergerApp"/> <ant inheritAll="false" useNativeBasedir="true" dir="aimerger" target="AIMergerApp"/>
</target> </target>
<target name="devmode" depends="noplay">
<ant inheritAll="false" useNativeBasedir="true" dir="appengine" target="devmode"/>
</target>
<!-- Convenient target for just running the blockly related tests --> <!-- Convenient target for just running the blockly related tests -->
<target name="BlocklyTest"> <target name="BlocklyTest">
<ant inheritAll="false" useNativeBasedir="true" dir="blocklyeditor" target="tests"/> <ant inheritAll="false" useNativeBasedir="true" dir="blocklyeditor" target="tests"/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment