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

(ios) Fix setting of target-device to handset in combination with plugins and resource files #546

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

skocks
Copy link

@skocks skocks commented Feb 22, 2019

Platforms affected

IOs

Motivation and Context

when:

  • setting the target device <preference name="target-device" value="handset" />
  • using (any) plugins
  • Adding a resource file <resource-file src="GoogleService-Info.plist" />

then:
TARGETED_DEVICE_FAMILY is reset to the default value of "1,2" while adding the resource file after handling the target device.

Description

Instead of creating a new instance of the xcode project via new xcode.project([...]) use the wrapped xcode project via projectFile.parse([...]).
This will reuse the cached xcode project, which is created when adding the plugins, and therefore maintain the changes when setting the target device.
The cached xcode project will then also be used when adding the resource file.

Testing

  • add plugins
  • set target-device to handheld
  • add a resource file

verify, that TARGETED_DEVICE_FAMILY = 1; is written to the project.pbxproj file.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • 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

@codecov-io
Copy link

Codecov Report

Merging #546 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #546      +/-   ##
==========================================
- Coverage   74.75%   74.72%   -0.03%     
==========================================
  Files          11       11              
  Lines        1822     1820       -2     
==========================================
- Hits         1362     1360       -2     
  Misses        460      460
Impacted Files Coverage Δ
bin/templates/scripts/cordova/lib/prepare.js 83.82% <100%> (-0.08%) ⬇️

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 5e688ca...07edc1b. Read the comment docs.

1 similar comment
@codecov-io
Copy link

codecov-io commented Feb 22, 2019

Codecov Report

Merging #546 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #546      +/-   ##
==========================================
- Coverage   74.75%   74.72%   -0.03%     
==========================================
  Files          11       11              
  Lines        1822     1820       -2     
==========================================
- Hits         1362     1360       -2     
  Misses        460      460
Impacted Files Coverage Δ
bin/templates/scripts/cordova/lib/prepare.js 83.82% <100%> (-0.08%) ⬇️

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 5e688ca...07edc1b. Read the comment docs.

@janpio
Copy link
Member

janpio commented Feb 22, 2019

What issue does this PR refer to? You checked that you "linked to the issue in the text above" but I couldn't find an issue ID.

@skocks
Copy link
Author

skocks commented Feb 22, 2019

What issue does this PR refer to? You checked that you "linked to the issue in the text above" but I couldn't find an issue ID.

That was a misunderstanding.
Since it reads "If this Pull Request resolves an issue, [...]" I checked it, because no issue is linked and therefore not referenced. - I can uncheck or delete the passage.

@dpogue dpogue added this to the 5.0.1 milestone Feb 25, 2019
@janpio janpio added the bug label Mar 1, 2019
Copy link
Member

@dpogue dpogue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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

Successfully merging this pull request may close these issues.

None yet

4 participants