You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by vladimir-kotikov <gi...@git.apache.org> on 2016/04/29 13:45:26 UTC

[GitHub] cordova-lib pull request: CB-11174 Resolve symlinked path before g...

GitHub user vladimir-kotikov opened a pull request:

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

    CB-11174 Resolve symlinked path before getting PlatformApi instance

    This PR the issue when `getPlatformApi` method in cordova-lib returns a different instances for two paths pointing to the same destination, This also fixes 'npm test' failures on OS X.
    
    See JIRA [CB-11174](https://issues.apache.org/jira/browse/CB-11174) for background and details.

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

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

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

    https://github.com/apache/cordova-lib/pull/433.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 #433
    
----
commit e2380dc0bb370980311a0001a738654046f36630
Author: Vladimir Kotikov <v-...@microsoft.com>
Date:   2016-04-29T09:23:29Z

    CB-11174 Resolve symlinked path before getting PlatformApi instance

----


---
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-11174 Resolve symlinked path before g...

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

    https://github.com/apache/cordova-lib/pull/433#issuecomment-215922979
  
    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-11174 Resolve symlinked path before g...

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

    https://github.com/apache/cordova-lib/pull/433#discussion_r61653369
  
    --- Diff: cordova-lib/spec-cordova/platforms/platforms.spec.js ---
    @@ -17,19 +17,25 @@
         under the License.
     */
     
    +var fs = require('fs');
    +var os = require('os');
     var path = require('path');
     var rewire = require('rewire');
    +var shell = require('shelljs');
     
     var util = require('../../src/cordova/util');
     var platforms = rewire('../../src/platforms/platforms');
     
     var CORDOVA_ROOT = path.join(__dirname, '../fixtures/projects/platformApi');
     var PLATFORM_WITH_API = path.join(CORDOVA_ROOT, 'platforms/windows');
     var PLATFORM_WOUT_API = path.join(CORDOVA_ROOT, 'platforms/android');
    +var PLATFORM_SYMLINK = path.join(os.tmpdir(), 'cordova_windows_symlink');
     
    -var MockPlatformApi = require(path.join(PLATFORM_WITH_API, 'cordova', 'Api'));
    +var MockPlatformApi = require(fs.realpathSync(path.join(PLATFORM_WITH_API, 'cordova/Api.js')));
     var PlatformApiPoly = require('../../src/platforms/PlatformApiPoly');
     
    +shell.ln('-sf', PLATFORM_WITH_API, PLATFORM_SYMLINK);
    +
    --- End diff --
    
    Have you tested on Windows? (I see the bug is just about OS X.)


---
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-11174 Resolve symlinked path before g...

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

    https://github.com/apache/cordova-lib/pull/433#issuecomment-215898416
  
    :+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-11174 Resolve symlinked path before g...

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/433#discussion_r61655336
  
    --- Diff: cordova-lib/spec-cordova/platforms/platforms.spec.js ---
    @@ -17,19 +17,25 @@
         under the License.
     */
     
    +var fs = require('fs');
    +var os = require('os');
     var path = require('path');
     var rewire = require('rewire');
    +var shell = require('shelljs');
     
     var util = require('../../src/cordova/util');
     var platforms = rewire('../../src/platforms/platforms');
     
     var CORDOVA_ROOT = path.join(__dirname, '../fixtures/projects/platformApi');
     var PLATFORM_WITH_API = path.join(CORDOVA_ROOT, 'platforms/windows');
     var PLATFORM_WOUT_API = path.join(CORDOVA_ROOT, 'platforms/android');
    +var PLATFORM_SYMLINK = path.join(os.tmpdir(), 'cordova_windows_symlink');
     
    -var MockPlatformApi = require(path.join(PLATFORM_WITH_API, 'cordova', 'Api'));
    +var MockPlatformApi = require(fs.realpathSync(path.join(PLATFORM_WITH_API, 'cordova/Api.js')));
     var PlatformApiPoly = require('../../src/platforms/PlatformApiPoly');
     
    +shell.ln('-sf', PLATFORM_WITH_API, PLATFORM_SYMLINK);
    +
    --- End diff --
    
    I've tested this on both OS X and Windows. Tests are passing in both cases.


---
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-11174 Resolve symlinked path before g...

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

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


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