Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve correct path to app info plist when multiple plist files are present (#144) #148

Merged
merged 1 commit into from Jun 12, 2020

Conversation

dpa99c
Copy link
Contributor

@dpa99c dpa99c commented Jun 12, 2020

Platforms affected

iOS

Motivation and Context

When multiple plist files exists in a cordova-ios project (e.g. due to a plugin containing <podspec>), ConfigFile was updated under CB-5989 to select the app plist as the target for changes destined for *-Info.plist.
However, the change made under CB-5989 incorrectly constructed the path to the app plist by omitting the project name subdirectory from the path, causing the fix to fail to work.

This bug is outlined in #144.

Description

This commit fixes this by correcting the constructed path to the app plist.

Testing

I've created a repo containing a test Cordova project which reproduces the various scenarios to illustrate the issue:
https://github.com/dpa99c/cordova-common-issue-144

Details of these scenarios can be found in this comment.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change N/A
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary N/A

erisu
erisu approved these changes Jun 12, 2020
Copy link
Member

@erisu erisu left a comment

Code wise LGTM 👍

@erisu
Copy link
Member

erisu commented Jun 12, 2020

Looks like a test file though might need to be updated.

This line specifically will need the change:

  const expectedPlistPath = `${projName}-Info.plist`;

@dpa99c
Copy link
Contributor Author

dpa99c commented Jun 12, 2020

Interesting that the ubuntu tests failed but windows & osx passed.
Is there some platform-specific difference between the paths on windows/osx vs ubuntu?
This may explain why CB-5989 failed to fix the issue on osx?

@erisu
Copy link
Member

erisu commented Jun 12, 2020

I don't see any passing tests.

Two test, ubuntu, had failed and caused GitHub Actions to trigger the cancel procedure of the other four remaining tests with out either starting or finishing.

@dpa99c
Copy link
Contributor Author

dpa99c commented Jun 12, 2020

I don't see any passing tests.

Two test, ubuntu, failed and caused GitHub Actions to cancelled the other 4 tests.

ah, yes, I misread the cancelled as passed (no big red X)

will run/fix the tests locally and update my branch.

… files are present (apache#144).

When multiple plist files exists in a cordova-ios project (e.g. due to a plugin containing `<podspec>`), ConfigFile was updated under CB-5989 to select the app plist as the target for changes destined for *-Info.plist.
However, the change made under CB-5989 incorrectly constructed the path to the app plist by omitting the project name subdirectory from the path, causing the fix to fail to work.

This commit fixes this by correcting the constructed path to the app plist.
@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2020

Codecov Report

Merging #148 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #148      +/-   ##
==========================================
+ Coverage   88.23%   88.24%   +0.01%     
==========================================
  Files          20       20              
  Lines        1173     1174       +1     
==========================================
+ Hits         1035     1036       +1     
  Misses        138      138              
Impacted Files Coverage Δ
src/ConfigChanges/ConfigFile.js 92.23% <100.00%> (+0.07%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5ba4db...a18bf0e. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants