[ALOY-866] Only recompile app.js when necessary
|Fix Version/s||Alloy 1.3.0, 2013 Sprint 22|
Descriptionapp.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.
- Tony Lukasavage 2013-10-30
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.