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

cordova plugin add --link ../plugin/ does not provide a cohesive local plugin workflow #497

Open
3 tasks done
shamilovtim opened this issue Dec 23, 2019 · 5 comments
Open
3 tasks done

Comments

@shamilovtim
Copy link

shamilovtim commented Dec 23, 2019

Bug Report

Problem

Currently to re-compile the *.js of a local plugin the following chain of commands needs to performed:

cordova plugin rm cordova-plugin-name && cordova plugin add --link ../plugin

It seems that while the native files are symlinked properly, there is a compilation step to the plugin *.js code that doesn't occur with neither build or prepare or compile. This requires repeatedly adding and removing plugins when changes are made to *.js code.

What is expected to happen?

Symlinking plus compilation (build) should provide an all in one solution for local plugin development.

What does actually happen?

When .js files are changed the changes do not reflect in an *.xcworkspace project. To make the *.js changes reflect, the plugin needs to be rm and then add -link /plugin/ again.

Information

My particular plugin uses Cordova-iOS 5, CocoaPods and xCode .xcworkspace workflow.

Environment, Platform, Device

CLI
xCode 11.2
iPhone X Emulator

Version information

"cordova-ios": "^5.1.1"
"cordova-lib":@9.0.1
xCode 11.2
iPhone X Emulator

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@shamilovtim
Copy link
Author

shamilovtim commented Dec 23, 2019

with regard to #347 my symlinks seem to look and work fine so that's not what's at issue here. the main issue is that whatever happens in the plugin *.js does not reflect after a build without adding and removing the plugin. the question is, why isn't build performing the proper compilation steps and moving the plugin's *.js wherever it needs to go?

@shamilovtim
Copy link
Author

in addition to what i've described, java symlinks break Gradle.

there's no (functioning) --force option so removing and adding a plugin is necessary

@p-m-j
Copy link

p-m-j commented Jun 17, 2020

doesn't seem to bother building copying changes for platform specific plugin code either

e.g. I update .java file in symlinked plugin dir, do a build but code in ./platform/android/etc is unchanged

Using ionic so the following works for me as a workaround.

$  rm -rf platforms/ && ionic cordova build android

@zmoshansky
Copy link

Still a problem using "cordova-android": "~9.0.0".

While it may just have been yarn & Cordova (npm) fighting it out, but I found it was even better to avoid cordova plugin add --link ../new_plugin and just do ln -s ../new_plugin plugins/new_plugin overtop of anything there.

Then every change I make (So tedious), follow @rustybox #497 (comment)

@Skyedra
Copy link

Skyedra commented Aug 24, 2023

Same issue where --link didn't work for me. I did it manually as described above and that helped. As I'm not using ionic, this is my current workflow for each change:

cordova platform remove android && cordova platform add android && cordova build

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

No branches or pull requests

4 participants