cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbektchiev <...@git.apache.org>
Subject [GitHub] cordova-lib pull request: CB-6698: Support library references for ...
Date Tue, 03 Jun 2014 11:25:24 GMT
Github user mbektchiev commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/21#discussion_r13329193
  
    --- Diff: cordova-lib/src/plugman/platforms/android.js ---
    @@ -80,10 +84,115 @@ module.exports = {
         },
         "framework": {
             install:function(source_el, plugin_dir, project_dir, plugin_id) {
    -            events.emit('verbose', 'framework.install is not supported for android');
    +            var src = source_el.attrib.src;
    +            var custom = source_el.attrib.custom;
    +            if (!src) throw new Error('src not specified in framework element');
    +
    +            events.emit('verbose', "Installing Android library: " + src);
    +            var parent = source_el.attrib.parent;
    +            var parentDir = parent ? path.resolve(project_dir, parent) : project_dir;
    +            var subDir;
    +            if (custom) {
    +                subDir = path.resolve(project_dir, src);
    +            } else {
    +                var localProperties = properties_parser.createEditor(path.resolve(project_dir,
"local.properties"));
    +                subDir = path.resolve(localProperties.get("sdk.dir"), src);
    +            }
    +            var projectConfig = module.exports.parseProjectFile(project_dir);
    +            projectConfig.addSubProject(parentDir, subDir);
             },
             uninstall:function(source_el, project_dir, plugin_id) {
    -            events.emit('verbose', 'framework.uninstall is not supported for android');
    +            var src = source_el.attrib.src;
    +            if (!src) throw new Error('src not specified in framework element');
    +
    +            events.emit('verbose', "Uninstalling Android library: " + src);
    +            var parent = source_el.attrib.parent;
    +            var parentDir = parent ? path.resolve(project_dir, parent) : project_dir;
    +            var subDir = path.resolve(project_dir, src);
    +            var projectConfig = module.exports.parseProjectFile(project_dir);
    +            projectConfig.removeSubProject(parentDir, subDir);
             }
    +    },
    +    parseProjectFile: function(project_dir){
    +        if (!projectFileCache[project_dir]) {
    +            projectFileCache[project_dir] = {
    --- End diff --
    
    I totally agree! I extracted it in a separate js.


---
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.
---

Mime
View raw message