cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TimBarham <...@git.apache.org>
Subject [GitHub] cordova-lib pull request: Fix prepare to wait the promise from plu...
Date Tue, 14 Jul 2015 13:10:41 GMT
Github user TimBarham commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/259#discussion_r34565570
  
    --- Diff: cordova-lib/src/cordova/prepare.js ---
    @@ -106,28 +106,29 @@ function prepare(options) {
                 if (options.browserify) {
                     plugman.prepare = require('../plugman/prepare-browserify');
                 }
    -            plugman.prepare(platformPath, platform, plugins_dir, null, true, pluginInfoProvider);
    -
    -            // Make sure that config changes for each existing plugin is in place
    -            var platformJson = PlatformJson.load(plugins_dir, platform);
    -            var munger = new PlatformMunger(platform, platformPath, plugins_dir, platformJson,
pluginInfoProvider);
    -            munger.reapply_global_munge();
    -            munger.save_all();
    -
    -            // Update platform config.xml based on top level config.xml
    -            var cfg = new ConfigParser(xml);
    -            var platform_cfg = new ConfigParser(parser.config_xml());
    -            exports._mergeXml(cfg.doc.getroot(), platform_cfg.doc.getroot(), platform,
true);
    -
    -            // CB-6976 Windows Universal Apps. For smooth transition and to prevent mass
api failures
    -            // we allow using windows8 tag for new windows platform
    -            if (platform == 'windows') {
    -                exports._mergeXml(cfg.doc.getroot(), platform_cfg.doc.getroot(), 'windows8',
true);
    -            }
    -
    -            platform_cfg.write();
    -
    -            return parser.update_project(cfg);
    +            var preparePromise =  plugman.prepare(platformPath, platform, plugins_dir,
null, true, pluginInfoProvider);
    +            return Q(preparePromise).then(function () {                   
    --- End diff --
    
    Yep, realized that eventually - sorry about that :smile:.
    
    However, because ultimately the goal will be to replace the current prepare with browserify
prepare , I'd prefer to keep this code simple and consistent with how browserify prepare works,
and modify the `plugman.prepare` to return a promise. Then when the regular prepare goes away,
we won't be left with unnecessary complexity here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message