[TIMOB-16871] Android: iOS: JavaScript files are not being symlinked
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-05-14T17:08:10.000+0000 |
Affected Version/s | Release 3.3.0 |
Fix Version/s | 2014 Sprint 09, 2014 Sprint 09 Tooling, Release 3.3.0 |
Components | Android, iOS, Tooling |
Labels | qe-closed-3.3.0, qe-testadded |
Reporter | Chris Barber |
Assignee | Chris Barber |
Created | 2014-04-21T05:40:46.000+0000 |
Updated | 2014-07-22T08:12:19.000+0000 |
Description
When building Android or iOS app, JavaScript flies are not being symlinked. They should be symlinked whenever the JS files are not being minified. The change needs to take place at line 20 below:
// parse the AST
var r = jsanalyze.analyzeJsFile(from, { minify: this.minifyJS });
// we want to sort by the "to" filename so that we correctly handle file overwriting
this.tiSymbols[to] = r.symbols;
var dir = path.dirname(to);
fs.existsSync(dir) || wrench.mkdirSyncRecursive(dir);
if (this.minifyJS) {
this.logger.debug(__('Copying and minifying %s => %s', from.cyan, to.cyan));
this.cli.createHook('build.android.compileJsFile', this, function (r, from, to, cb2) {
fs.writeFile(to, r.contents, cb2);
})(r, from, to, cb);
} else {
this.logger.debug(__('Copying %s => %s', from.cyan, to.cyan));
// CHANGE THIS TO USE copyFile()!
fs.writeFile(to, r.contents, cb);
}
Master pull request: https://github.com/appcelerator/titanium_mobile/pull/5633 To test: 1) Create an app 2) Build for iOS Simulator 3) Observe output that app.js is now symlinked and not copied 4) Confirm directory listing: ls -l build/iphone/build/Debug-iphonesimulator/testapp.app 5) Build for Android emulator 6) Observe output that app.js is now symlinked and not copied 7) Confirm directory listing: ls -l build/android/bin/assets/Resources
All steps work as described. Passes.
Javascript files are getting copied but not being symlinked. Verified for both android and iOS platoform, so reopening the issue. Verified the issue on: iOS simulator: 7.1 Android emulator: 2.3 SDK: 3.3.0.v20140512162513 CLI version : 3.3.0-dev OS : MAC OSX 10.9.2 Alloy: 1.4.0-dev ACS: 1.0.14 npm:1.3.2 LiveView: 1.0.4 Appcelerator Studio, build: 3.3.0.201405121247 titanium-code-processor: 1.1.1 XCode : 5.1.1
I retested this and it works fine:
Hi chris, Javascript files are being symlinked, problem was caused by this bug TIMOB-16951 as sdk changes to tiapp.xml were not reflected. Closing the issue. Verified the fix on: SDK: 3.3.0.v20140512162513 CLI version : 3.3.0-dev OS : MAC OSX 10.9.2 Alloy: 1.4.0-Alpha ACS: 1.0.14 npm:1.3.2 LiveView: 1.0.4 Appcelerator Studio, build: 3.3.0.201405121247 titanium-code-processor: 1.1.1 XCode : 5.1.1