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: inject cordova files if a cordova plugin is present #7363

Merged
merged 1 commit into from
Mar 21, 2024
Merged

Conversation

jcesarmobile
Copy link
Member

@jcesarmobile jcesarmobile commented Mar 21, 2024

The Cordova plugins javascript injection is not working because the plugins are now being read from the list that the CLI generates, and the CLI doesn't generate Cordova plugin classes.

Since trying to figure out all the Cordova plugin classes is very complex and the classes are not really needed for injecting the javascript code, I've just edited the CLI to add a generic CDVPlugin class to the plugin list if there are cordova plugins installed, and instead of checking the superClass I just check if there is a CDVPlugin class in the list, and if there is one, inject the cordova files.

@markemer
Copy link
Contributor

markemer commented Mar 21, 2024

Does this need to be backported to 5.x as well? I can't remember if we made this 6.x only.

Edit: Looks like we did not backport this to 5.x.

@markemer
Copy link
Contributor

Yeah, the checker picks up a Cordova plugin but only if they're swift. Which explains how this sometimes worked.

Copy link
Member

@Steven0351 Steven0351 left a comment

Choose a reason for hiding this comment

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

LGTM

@markemer markemer merged commit ce9d505 into main Mar 21, 2024
7 checks passed
@markemer markemer deleted the fix-cordova branch March 21, 2024 18:40
@jcesarmobile
Copy link
Member Author

I've tested and it was not working with Cordova Swift plugins neither, generateIOSPackageJSON is only receiving Capacitor plugins, and even if it received Cordova plugins, the regex on findPluginClasses only searches for Capacitor plugin classes.

@markemer
Copy link
Contributor

Good catch. Maybe I should add one sorta small Cordova plugin to the test app just to make sure we don't break things - especially since I'm currently looking into our Cordova layers.

@Steven0351
Copy link
Member

Steven0351 commented Mar 21, 2024

You could probably just check the filesystem to see if there are any source files in the cordova plugins project. Unless the plugin file generation happens before that part :D Don't mind me, I have no clue what I was talking about

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