[ALOY-866] Only recompile app.js when necessary
GitHub Issue | n/a |
---|---|
Type | Sub-task |
Priority | High |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2013-10-30T19:33:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.3.0, 2013 Sprint 22 |
Components | Runtime, Tooling |
Labels | n/a |
Reporter | Tony Lukasavage |
Assignee | Unknown |
Created | 2013-10-30T15:53:14.000+0000 |
Updated | 2018-03-07T22:26:02.000+0000 |
Description
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.Comments
- 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.