You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by daserge <gi...@git.apache.org> on 2016/02/04 19:30:52 UTC

[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

GitHub user daserge opened a pull request:

    https://github.com/apache/cordova-lib/pull/378

    CB-10482 Remove references to windows8 from cordova-lib/cli

    [Jira issue](https://issues.apache.org/jira/browse/CB-10482)
    
    `update_from_config method` tests are moved to [the platform](https://github.com/apache/cordova-windows/blob/master/spec/unit/Prepare.Win10.spec.js) along with PlatformApi implementation.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-lib CB-10482

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-lib/pull/378.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #378
    
----
commit e4f6586a43f74c5473b2b2a63ee5db474f088d75
Author: daserge <v-...@microsoft.com>
Date:   2016-02-04T17:50:15Z

    CB-10482 Remove references to windows8 from cordova-lib/cli

----


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-lib/pull/378#issuecomment-180348008
  
    Vladimir, thanks for review! I've addressed the notes.


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-lib/pull/378#issuecomment-181759063
  
    @nikhilkh, @stevengill is this good to go?


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/378#discussion_r51986870
  
    --- Diff: cordova-lib/spec-cordova/metadata/windows_parser.spec.js ---
    @@ -115,31 +110,9 @@ describe('windows8 project parser', function() {
                 read = spyOn(fs, 'readFileSync').andReturn('');
             });
     
    -        describe('update_from_config method', function() {
    --- End diff --
    
    Intead of removing these tests could you please update them to test that corresponding script is being required, and the error is thrown when it is missing.


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/378#discussion_r51986491
  
    --- Diff: cordova-lib/src/cordova/metadata/windows_parser.js ---
    @@ -65,135 +53,13 @@ require('util').inherits(windows_parser, Parser);
     module.exports = windows_parser;
     
     windows_parser.prototype.update_from_config = function(config) {
    -
         //check config parser
         if (config instanceof ConfigParser) {
         } else throw new Error('update_from_config requires a ConfigParser object');
     
    -    if (!this.isOldProjectTemplate) {
    -        // If there is platform-defined prepare script, require and exec it
    -        var platformPrepare = require(path.join(this.projDir, 'cordova', 'lib', 'prepare'));
    -        platformPrepare.applyPlatformConfig();
    -        return;
    -    }
    -
    -    // code below is required for compatibility reason. New template version is not required this anymore.
    -
    -    //Get manifest file
    -    var manifest = xml.parseElementtreeSync(this.manifestPath);
    -
    -    var version = this.fixConfigVersion(config.version());
    -    var name = config.name();
    -    var pkgName = config.packageName();
    -    var author = config.author();
    -
    -    var identityNode = manifest.find('.//Identity');
    -    if(identityNode) {
    -        // Update app name in identity
    -        var appIdName = identityNode['attrib']['Name'];
    -        if (appIdName != pkgName) {
    -            identityNode['attrib']['Name'] = pkgName;
    -        }
    -
    -        // Update app version
    -        var appVersion = identityNode['attrib']['Version'];
    -        if(appVersion != version) {
    -            identityNode['attrib']['Version'] = version;
    -        }
    -    }
    -
    -    // Update name (windows8 has it in the Application[@Id] and Application.VisualElements[@DisplayName])
    -    var app = manifest.find('.//Application');
    -    if(app) {
    -
    -        var appId = app['attrib']['Id'];
    -
    -        if (appId != pkgName) {
    -            app['attrib']['Id'] = pkgName;
    -        }
    -
    -        var visualElems = manifest.find('.//VisualElements') || manifest.find('.//m2:VisualElements');
    -
    -        if(visualElems) {
    -            var displayName = visualElems['attrib']['DisplayName'];
    -            if(displayName != name) {
    -                visualElems['attrib']['DisplayName'] = name;
    -            }
    -        }
    -        else {
    -            throw new Error('update_from_config expected a valid package.appxmanifest' +
    -                            ' with a <VisualElements> node');
    -        }
    -    }
    -    else {
    -        throw new Error('update_from_config expected a valid package.appxmanifest' +
    -                        ' with a <Application> node');
    -    }
    -
    -    // Update properties
    -    var properties = manifest.find('.//Properties');
    -    if (properties && properties.find) {
    -        var displayNameElement = properties.find('.//DisplayName');
    -        if (displayNameElement && displayNameElement.text != name) {
    -            displayNameElement.text = name;
    -        }
    -
    -        var publisherNameElement = properties.find('.//PublisherDisplayName');
    -        if (publisherNameElement && publisherNameElement.text != author) {
    -            publisherNameElement.text = author;
    -        }
    -    }
    -
    -    // sort Capability elements as per CB-5350 Windows8 build fails due to invalid 'Capabilities' definition
    -    // to sort elements we remove them and then add again in the appropriate order
    -    var capabilitiesRoot = manifest.find('.//Capabilities'),
    -        capabilities = capabilitiesRoot._children || [];
    -
    -    capabilities.forEach(function(elem){
    -        capabilitiesRoot.remove(elem);
    -    });
    -    capabilities.sort(function(a, b) {
    -        return (a.tag > b.tag)? 1: -1;
    -    });
    -    capabilities.forEach(function(elem){
    -        capabilitiesRoot.append(elem);
    -    });
    -
    -    //Write out manifest
    -    fs.writeFileSync(this.manifestPath, manifest.write({indent: 4}), 'utf-8');
    -
    -    // Update icons
    -    var icons = config.getIcons('windows8');
    -    var platformRoot = this.projDir;
    -    var appRoot = util.isCordova(platformRoot);
    -
    -    // Icons, that should be added to platform
    -    var platformIcons = [
    -        {dest: 'images/logo.png', width: 150, height: 150},
    -        {dest: 'images/smalllogo.png', width: 30, height: 30},
    -        {dest: 'images/storelogo.png', width: 50, height: 50},
    -    ];
    -
    -    platformIcons.forEach(function (item) {
    -        var icon = icons.getBySize(item.width, item.height) || icons.getDefault();
    -        if (icon){
    -            var src = path.join(appRoot, icon.src),
    -                dest = path.join(platformRoot, item.dest);
    -            events.emit('verbose', 'Copying icon from ' + src + ' to ' + dest);
    -            shell.cp('-f', src, dest);
    -        }
    -    });
    -
    -    // Update splashscreen
    -    // Image size for Windows 8 should be 620 x 300 px
    -    // See http://msdn.microsoft.com/en-us/library/windows/apps/hh465338.aspx for reference
    -    var splash = config.getSplashScreens('windows8').getBySize(620, 300);
    -    if (splash){
    -        var src = path.join(appRoot, splash.src),
    -            dest = path.join(platformRoot, 'images/splashscreen.png');
    -        events.emit('verbose', 'Copying icon from ' + src + ' to ' + dest);
    -        shell.cp('-f', src, dest);
    -    }
    +    // If there is platform-defined prepare script, require and exec it
    +    var platformPrepare = require(path.join(this.projDir, 'cordova', 'lib', 'prepare'));
    --- End diff --
    
    Also it might be better to wrap this into `try/catch` and throw `CordovaError` with appropriate message


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-lib/pull/378#issuecomment-181980800
  
    LGTM


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by nikhilkh <gi...@git.apache.org>.
Github user nikhilkh commented on the pull request:

    https://github.com/apache/cordova-lib/pull/378#issuecomment-180005902
  
    @vladimir-kotikov to review


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-lib/pull/378#issuecomment-181294379
  
    @vladimir-kotikov, thanks, updated.
    Please take a look.


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on the pull request:

    https://github.com/apache/cordova-lib/pull/378#issuecomment-180243971
  
    Added a few comments, otherwise LGTM


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-lib/pull/378


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-lib/pull/378#issuecomment-180407487
  
    @vladimir-kotikov, added the tests for non-default plugman engines, PTAL


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by stevengill <gi...@git.apache.org>.
Github user stevengill commented on the pull request:

    https://github.com/apache/cordova-lib/pull/378#issuecomment-181997030
  
    +1!


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by vladimir-kotikov <gi...@git.apache.org>.
Github user vladimir-kotikov commented on a diff in the pull request:

    https://github.com/apache/cordova-lib/pull/378#discussion_r51986428
  
    --- Diff: cordova-lib/src/cordova/metadata/windows_parser.js ---
    @@ -65,135 +53,13 @@ require('util').inherits(windows_parser, Parser);
     module.exports = windows_parser;
     
     windows_parser.prototype.update_from_config = function(config) {
    -
         //check config parser
         if (config instanceof ConfigParser) {
         } else throw new Error('update_from_config requires a ConfigParser object');
     
    -    if (!this.isOldProjectTemplate) {
    -        // If there is platform-defined prepare script, require and exec it
    -        var platformPrepare = require(path.join(this.projDir, 'cordova', 'lib', 'prepare'));
    -        platformPrepare.applyPlatformConfig();
    -        return;
    -    }
    -
    -    // code below is required for compatibility reason. New template version is not required this anymore.
    -
    -    //Get manifest file
    -    var manifest = xml.parseElementtreeSync(this.manifestPath);
    -
    -    var version = this.fixConfigVersion(config.version());
    -    var name = config.name();
    -    var pkgName = config.packageName();
    -    var author = config.author();
    -
    -    var identityNode = manifest.find('.//Identity');
    -    if(identityNode) {
    -        // Update app name in identity
    -        var appIdName = identityNode['attrib']['Name'];
    -        if (appIdName != pkgName) {
    -            identityNode['attrib']['Name'] = pkgName;
    -        }
    -
    -        // Update app version
    -        var appVersion = identityNode['attrib']['Version'];
    -        if(appVersion != version) {
    -            identityNode['attrib']['Version'] = version;
    -        }
    -    }
    -
    -    // Update name (windows8 has it in the Application[@Id] and Application.VisualElements[@DisplayName])
    -    var app = manifest.find('.//Application');
    -    if(app) {
    -
    -        var appId = app['attrib']['Id'];
    -
    -        if (appId != pkgName) {
    -            app['attrib']['Id'] = pkgName;
    -        }
    -
    -        var visualElems = manifest.find('.//VisualElements') || manifest.find('.//m2:VisualElements');
    -
    -        if(visualElems) {
    -            var displayName = visualElems['attrib']['DisplayName'];
    -            if(displayName != name) {
    -                visualElems['attrib']['DisplayName'] = name;
    -            }
    -        }
    -        else {
    -            throw new Error('update_from_config expected a valid package.appxmanifest' +
    -                            ' with a <VisualElements> node');
    -        }
    -    }
    -    else {
    -        throw new Error('update_from_config expected a valid package.appxmanifest' +
    -                        ' with a <Application> node');
    -    }
    -
    -    // Update properties
    -    var properties = manifest.find('.//Properties');
    -    if (properties && properties.find) {
    -        var displayNameElement = properties.find('.//DisplayName');
    -        if (displayNameElement && displayNameElement.text != name) {
    -            displayNameElement.text = name;
    -        }
    -
    -        var publisherNameElement = properties.find('.//PublisherDisplayName');
    -        if (publisherNameElement && publisherNameElement.text != author) {
    -            publisherNameElement.text = author;
    -        }
    -    }
    -
    -    // sort Capability elements as per CB-5350 Windows8 build fails due to invalid 'Capabilities' definition
    -    // to sort elements we remove them and then add again in the appropriate order
    -    var capabilitiesRoot = manifest.find('.//Capabilities'),
    -        capabilities = capabilitiesRoot._children || [];
    -
    -    capabilities.forEach(function(elem){
    -        capabilitiesRoot.remove(elem);
    -    });
    -    capabilities.sort(function(a, b) {
    -        return (a.tag > b.tag)? 1: -1;
    -    });
    -    capabilities.forEach(function(elem){
    -        capabilitiesRoot.append(elem);
    -    });
    -
    -    //Write out manifest
    -    fs.writeFileSync(this.manifestPath, manifest.write({indent: 4}), 'utf-8');
    -
    -    // Update icons
    -    var icons = config.getIcons('windows8');
    -    var platformRoot = this.projDir;
    -    var appRoot = util.isCordova(platformRoot);
    -
    -    // Icons, that should be added to platform
    -    var platformIcons = [
    -        {dest: 'images/logo.png', width: 150, height: 150},
    -        {dest: 'images/smalllogo.png', width: 30, height: 30},
    -        {dest: 'images/storelogo.png', width: 50, height: 50},
    -    ];
    -
    -    platformIcons.forEach(function (item) {
    -        var icon = icons.getBySize(item.width, item.height) || icons.getDefault();
    -        if (icon){
    -            var src = path.join(appRoot, icon.src),
    -                dest = path.join(platformRoot, item.dest);
    -            events.emit('verbose', 'Copying icon from ' + src + ' to ' + dest);
    -            shell.cp('-f', src, dest);
    -        }
    -    });
    -
    -    // Update splashscreen
    -    // Image size for Windows 8 should be 620 x 300 px
    -    // See http://msdn.microsoft.com/en-us/library/windows/apps/hh465338.aspx for reference
    -    var splash = config.getSplashScreens('windows8').getBySize(620, 300);
    -    if (splash){
    -        var src = path.join(appRoot, splash.src),
    -            dest = path.join(platformRoot, 'images/splashscreen.png');
    -        events.emit('verbose', 'Copying icon from ' + src + ' to ' + dest);
    -        shell.cp('-f', src, dest);
    -    }
    +    // If there is platform-defined prepare script, require and exec it
    --- End diff --
    
    Please update the comment accordingly, as now the platform _must_ contain `prepare` script


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


[GitHub] cordova-lib pull request: CB-10482 Remove references to windows8 f...

Posted by daserge <gi...@git.apache.org>.
Github user daserge commented on the pull request:

    https://github.com/apache/cordova-lib/pull/378#issuecomment-180425340
  
    @nikhilkh, @stevengill could you please take a look and confirm if [this](https://github.com/apache/cordova-lib/pull/378/files#diff-5c531bb2bcb2db936999aa744a3f2a3cR256) is the correct logic for a custom engine tag (this might occur as we are removing `cordova-windows8` from the default engines)?


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