cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-11019) Cordova ios handles project rename incorrectly
Date Wed, 06 Apr 2016 11:10:25 GMT

    [ https://issues.apache.org/jira/browse/CB-11019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15228111#comment-15228111
] 

ASF GitHub Bot commented on CB-11019:
-------------------------------------

GitHub user vladimir-kotikov opened a pull request:

    https://github.com/apache/cordova-ios/pull/213

    CB-11019 Handle app name change more accurately

    This PR fixes potential bug in 'prepare' functionality, when changing application name
(which assumes renaming of some folders inside of platform directory) does not update project's
directories locations properly. Also, the `projectFile` cache needs to be invalidated because
it could contain instance that refers the old paths.
    
    See [CB-11019](https://issues.apache.org/jira/browse/CB-11019) for more details

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

    $ git pull https://github.com/MSOpenTech/cordova-ios CB-11019

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

    https://github.com/apache/cordova-ios/pull/213.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 #213
    
----
commit 070ef3b0dd145780d639a16dfca21ce0a503706a
Author: Vladimir Kotikov <v-vlkoti@microsoft.com>
Date:   2016-04-05T14:41:10Z

    CB-11019 Handle changes of app name gracefully

commit f71dbc3726b6ddabaa7330e61f56e766d7f5aa22
Author: Vladimir Kotikov <v-vlkoti@microsoft.com>
Date:   2016-04-06T10:28:39Z

    CB-11019 Update tests to validate project name updates

----


> Cordova ios handles project rename incorrectly
> ----------------------------------------------
>
>                 Key: CB-11019
>                 URL: https://issues.apache.org/jira/browse/CB-11019
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 4.1.0
>            Reporter: Vladimir Kotikov
>            Assignee: Vladimir Kotikov
>              Labels: ios, prepare
>             Fix For: 4.1.2
>
>
> When application name is changed in `config.xml`, following call to `prepare` changes
the ios project structure within {{platforms/ios}} directory. Though some internal properties
of ios platformApi are not changed and still point to old paths. This causes the following
`plugn add` call to fail.
> Notice that the bug can be reproduced only if {{prepare}} and {{plugin add}} bot h called
within one node process, i.e. programmatically.
> Here is a snippet that can help reproduce the problem (run {{npm install cordova@6.1.0}}
first):
> {code}
> var Q = require('q');
> var tmp = require('tmp');
> var path = require('path');
> var shell = require('shelljs');
> var events = require('cordova-lib').events;
> var cordova = require('cordova-lib').cordova;
> events.on('log', console.log).on('warn', console.warn);
> var CORDOVA = path.resolve('./node_modules/cordova/bin/cordova');
> // This is a repro for issue, similar to CB-10961 but it does repro even with the
> // fix for CB-10965 (https://issues.apache.org/jira/browse/CB-10965) checked in
> var case2 = Q(tmp.dirSync().name)
> .then(function (tempDir) {
>     shell.exec(CORDOVA + ' create ' + tempDir + ' com.app1 app1 -d');
>     shell.pushd(tempDir);
> })
> .then(function () {
>     return cordova.raw.platform('add', ['d:/cordova/cordova-ios']);
> })
> .then(function () {
>     shell.sed('-i', '<name>app1</name>', '<name>app2</name>',
'config.xml');
>     return cordova.raw.prepare([PLATFORM]);
> })
> .then(function () {
>     return cordova.raw.plugin('add', ['cordova-plugin-camera'], {save: true});
> });
> {code}
> The snippet above will throw the following error (similar to what described in CB-10961)
> {noformat}
> Failed to install 'cordova-plugin-camera':Error: ENOENT: no such file or directory, open
'C:\Users\VLADIM~1.KOT\AppData\Local\Temp\tmp-13756pWNNAgPv8e9b\platforms\ios\app1.xcodeproj\project.pbxproj'
>     at Error (native)
>     at Object.fs.openSync (fs.js:584:18)
>     at Object.fs.writeFileSync (fs.js:1224:33)
>     at Object.cachedProjectFiles.(anonymous function).write (C:\Users\VLADIM~1.KOT\AppData\Local\Temp\tmp-13756pWNNAgPv8e9b\platforms\ios\cordova\lib\projectFile.js:73:16)
>     at C:\Users\VLADIM~1.KOT\AppData\Local\Temp\tmp-13756pWNNAgPv8e9b\platforms\ios\cordova\lib\plugman\Plugman.js:84:21
>     at _fulfilled (C:\Users\VLADIM~1.KOT\AppData\Local\Temp\tmp-13756pWNNAgPv8e9b\platforms\ios\cordova\node_modules\q\q.js:834:54)
>     at self.promiseDispatch.done (C:\Users\VLADIM~1.KOT\AppData\Local\Temp\tmp-13756pWNNAgPv8e9b\platforms\ios\cordova\node_modules\q\q.js:863:30)
>     at Promise.promise.promiseDispatch (C:\Users\VLADIM~1.KOT\AppData\Local\Temp\tmp-13756pWNNAgPv8e9b\platforms\ios\cordova\node_modules\q\q.js:796:13)
>     at C:\Users\VLADIM~1.KOT\AppData\Local\Temp\tmp-13756pWNNAgPv8e9b\platforms\ios\cordova\node_modules\q\q.js:857:14
>     at runSingle (C:\Users\VLADIM~1.KOT\AppData\Local\Temp\tmp-13756pWNNAgPv8e9b\platforms\ios\cordova\node_modules\q\q.js:137:13)
> {noformat}
> even after fix for CB-10965 applied (checked in cordova-common with patch for CB-10965
merged in)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message