[ https://issues.apache.org/jira/browse/CB-5063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14059271#comment-14059271 ]
ASF subversion and git services commented on CB-5063: ----------------------------------------------------- Commit 3695d6fef8998929189a36681bbe1f99c13f7887 in cordova-lib's branch refs/heads/master from [~kamrik] [ https://git-wip-us.apache.org/repos/asf?p=cordova-lib.git;h=3695d6f ] CB-6512: platform add <path> was using wrong www/cordova.js cordova prepare nukes the www dir under platform on each prepare, so it was using www/cordova.js from the cached platfrom files to restore it. For this to work, prepare was starting with a lazy_load(platform) to make sure it has the platform files cached. For the case of platform add <path> this was downloading a stock version of platform files instead of using the ones in <path>. Some time ago see CB-5063 cordova started keeping a copy of cordova.js under /platfroms/<platfrom>/platfrom_www/ but the cached files were still needed for older projects that didn't yet have platform_www. This commit removes the lazy_load before prepare and counts on platform_www to exist. It also adds platform_www during `platform add`. > "Prepare" should not depend on the ~/.cordova/libs directory > ------------------------------------------------------------ > > Key: CB-5063 > URL: https://issues.apache.org/jira/browse/CB-5063 > Project: Apache Cordova > Issue Type: Bug > Components: CLI > Reporter: Andrew Grieve > Assignee: Mark Koudritsky > Priority: Minor > > Look in src/metadata/*_parser.js > They all have logic in `update_www()` to copy the cordova.js file from > util.libDirectory. > When users change machines, this turns into an error since the ~/.lib > directory is not populated. > On iOS, the fix is trivial - a copy of cordova.js already exists at > platforms/ios/CordovaLib/cordova.js > For other platforms, we could trivially fix the problem just by not blowing > away the www/cordova.js file during prepare, but I think it would be better > to not rely on that since likely people should not be committing the > generated www/ into source control. > Instead, let's ensure that all platforms keep a copy of their cordova.js file > within their platform/ directory and use copy that into www/ during prepare. > We could maybe even get rid of the custom logic entirely by putting the > cordova.js file within `merges/` upon `platform add`. -- This message was sent by Atlassian JIRA (v6.2#6252)