Skip to content

Commit

Permalink
Implement a release flag for builds
Browse files Browse the repository at this point in the history
Change-Id: I5338ee15a316828495e3782491a90785b46cdb1b
  • Loading branch information
ewpatton authored and jisqyv committed Mar 1, 2021
1 parent 58dd96b commit a918557
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 12 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,21 @@ Before entering or scanning the QR code in the Companion, check the box labeled
The automated tests depend on [Phantomjs](http://phantomjs.org/). Make sure you install it and add it to your path. After that, you can run all tests by typing the following in a terminal window:

$ ant tests


### Building Release Code

Release builds with optimizations turned on for the web components of the system can be done by passing `-Drelease=true` to `ant`, e.g.:

```
ant -Drelease=true noplay
```

The release configuration sets the following additional options:

- Blockly Editor is compiled with SIMPLE optimizations (instead of RAW)
- App Engine YaClient module is compiled without `<collapse-all-properties/>` to create per-language/browser builds
- App Engine YaClient module is compiled with optimization tuned to 9 and with 8 threads

### Hot-reloading GWT code with 'Super Dev Mode'
1. Run `ant devmode`
2. [Run the main server](#running-the-main-server).
Expand Down
20 changes: 17 additions & 3 deletions appinventor/appengine/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@
Definition for generating a Unique ID.
===================================================================== -->

<property name="release" value="false"/>

<condition property="client.module"
value="com.google.appinventor.YaClient"
else="com.google.appinventor.YaClient-dev">
<equals arg1="${release}" arg2="true" />
</condition>

<condition property="client.flags"
value="-optimize 9 -localWorkers 8"
else="-style pretty">
<equals arg1="${release}" arg2="true" />
</condition>

<scriptdef name="generateguid" language="javascript">
<attribute name="property" />
<![CDATA[
Expand Down Expand Up @@ -594,8 +608,8 @@
<jvmarg value="-Dfile.encoding=UTF-8" />
<arg line="-war"/>
<arg value="${build.war.dir}"/>
<arg line="-logLevel INFO -extra ${build.extra.dir} -style pretty"/>
<arg value="com.google.appinventor.YaClient"/>
<arg line="-logLevel INFO -extra ${build.extra.dir} ${client.flags}"/>
<arg value="${client.module}"/>
</java>
</target>

Expand Down Expand Up @@ -630,7 +644,7 @@
</classpath>
<jvmarg value="-Xmx1G" />
<arg line="-style PRETTY -logLevel INFO" />
<arg value="com.google.appinventor.YaClient" />
<arg value="com.google.appinventor.YaClient-dev" />
<arg value="-bindAddress"/>
<arg value="0.0.0.0"/>
</java>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.3.0//EN" "http://www.gwtproject.org/doctype/2.8.1/gwt-module.dtd">
<module rename-to='ode'>
<inherits name="com.google.appinventor.YaClient" />
<collapse-all-properties/>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,4 @@
<extend-property name="locale" values="lt"/>

<set-property-fallback name="locale" value="en"/>
<collapse-all-properties/>

</module>
13 changes: 10 additions & 3 deletions appinventor/blocklyeditor/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
In-browser blocks editor for App Inventor based on Blockly
</description>

<property name="release" value="false"/>

<condition property="blockly.config"
value="ploverConfig.js"
else="ploverConfig-dev.js">
<equals arg1="${release}" arg2="true"/>
</condition>

<target name="all"
depends="BlocklyTranslationGenerator">
</target>
Expand Down Expand Up @@ -99,8 +107,7 @@
<srcfiles dir="src/" includes="**/*.js" />
<srcfiles dir="${blockly.src.dir}/" includes="core/**/*.js" />
<srcfiles dir="${lib.dir}/closure-library/" includes="closure/goog/**/*.js" />
<srcfiles dir="${basedir}" includes="ploverConfig.js" />
<!-- <mapper type="merge" to="${public.build.dir}/blockly-all.js" /> -->
<srcfiles dir="${basedir}" includes="${blockly.config}" />
</uptodate>
</target>

Expand All @@ -109,7 +116,7 @@
depends="init,CheckBlocklyCompile"
unless="BlocklyCompile.uptodate">
<java failonerror="true" fork="true" jar="${lib.dir}/plovr/plovr-eba786b34df9.jar">
<arg line="build ploverConfig.js" />
<arg line="build ${blockly.config}" />
</java>
</target>

Expand Down
5 changes: 5 additions & 0 deletions appinventor/blocklyeditor/ploverConfig-dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "blockly-config-dev",
"inherits": "ploverConfig.js",
"mode": "RAW"
}
4 changes: 1 addition & 3 deletions appinventor/blocklyeditor/ploverConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@
// will be included, so when test-raw.html loads each input in RAW mode,
// it is important that the proper charset be used.
"output-charset": "UTF-8",
"mode": "RAW",
// "mode": "SIMPLE",
// "mode" : "WHITESPACE_ONLY",
"mode": "SIMPLE",
"experimental-compiler-options": {
"languageIn": "ECMASCRIPT5"
},
Expand Down

0 comments on commit a918557

Please sign in to comment.