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: CDV.h wasn't bringing in Cordova.h consistently #1482

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

dpogue
Copy link
Member

@dpogue dpogue commented Aug 28, 2024

Platforms affected

iOS

Motivation and Context

Plugins that included only <Cordova/CDV.h> were seeing issues around extending CDVPlugin.

Description

Make CDV.h consistently import Cordova.h to define the full module.

The fact that there's a circular dependency between the headers isn't actually a problem in Objective-C because it uses #import rather than #include and the compiler ensures each header is only included once.

Somehow that was also causing it to only evaluate the header once and not differentiate imports where the macro was defined vs not defined.

Testing

Compiled a test app whose plugins used #import <Cordova/CDV.h> and were broken before this change.

Checklist

  • I've run the tests to see all new and existing tests pass

The fact that there's a circular dependency between the headers isn't
actually a problem in Objective-C because it uses `#import` rather than
`#include` and the compiler ensures each header is only included once.

Somehow that was also causing it to only evaluate the header once and
not differentiate imports where the macro was defined vs not defined.
@dpogue dpogue requested a review from erisu August 28, 2024 08:13
@dpogue dpogue added this to the 8.0.0 milestone Aug 28, 2024
Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

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

LGTM - I have tested and confirmed that it resolved the issue.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.22%. Comparing base (458f5f3) to head (c629c0b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1482   +/-   ##
=======================================
  Coverage   80.22%   80.22%           
=======================================
  Files          16       16           
  Lines        1871     1871           
=======================================
  Hits         1501     1501           
  Misses        370      370           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpogue dpogue merged commit 4a4294c into apache:master Aug 28, 2024
10 checks passed
@dpogue dpogue deleted the CDV-header-fix branch August 28, 2024 08:46
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.

3 participants