[ALOY-866] Only recompile app.js when necessary

GitHub Issuen/a
Resolution Date2013-10-30T19:33:32.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.3.0, 2013 Sprint 22
ComponentsRuntime, Tooling
ReporterTony Lukasavage


app.js is recompiled on every build now. We should only rebuild when changes occur to the app.js, or alloy is compiled for a platform for which is has not already compiled (meaning it has not already generated a platform-specific app.js). NOTE: We also need to consider source maps when doing this.


  1. Tony Lukasavage 2013-10-30 PR: https://github.com/appcelerator/alloy/pull/265 Functional testing:

    Create a default alloy app

    compile the app for ios with alloy compile --platform ios

    Make sure you see the following line in the alloy log:

       [INFO] [app.js] Titanium entry point processing...
       [TRACE] - Processing "builtins" module...
       [TRACE] - Processing "optimizer" module...
       [TRACE] - Processing "compress" module...
       [INFO]   created:    "Resources/iphone/app.js"
       [DEBUG]  map:        "build/map/Resources/iphone/app.js.map"

    After the compile completes, run it again. This time you should see the following instead in the log:

       [INFO] [app.js] using cached app.js...

    Now, compile for a different platform, alloy compile --platform android

    You should see a log similar to step 3, citing the android folders this time

    Compile again for android, and you should see a log like step 4

    GO back and compile again for ios. It should still use the cached app.js, since it is contained in the platform-specific folder and was not overwritten by our android testing.

    Make a change to the alloy.js and then compile for both android and ios. Both should generate a log as in step #3 the first time, then the log in step #4 on all subsequent builds.

JSON Source