Skip to content

Plugin Guide: Notes for --link option #1416

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GitToTheHub
Copy link
Contributor

Added notice, that the linking only works, when the plugin is added after a platform was added and that the linking will be lost if a platform is re-added

Platforms affected

Motivation and Context

Description

Testing

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

Added notice, that the linking only works, when the plugin is added after a platform was added and that the linking will be lost if a platform is re-added
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.

I would recommend adding this to the dev directory as well to ensure that it will exist in future snapshots

@@ -194,7 +194,7 @@ cordova plugin add ../path/to/my/plugin/relative/to/project --link
```

This creates a symbolic link instead of copying the plugin files, which enables you
to work on your plugin and then simply rebuild the app to use your changes.
to work on your plugin and then simply rebuild the app to use your changes. You have to add the plugin after you added the platform, otherwise the link will not work. The link will also be lost, if you re-add a platform. If you do this you have to re-add the plugin.
Copy link
Member

@erisu erisu Apr 7, 2025

Choose a reason for hiding this comment

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

Suggested change
to work on your plugin and then simply rebuild the app to use your changes. You have to add the plugin after you added the platform, otherwise the link will not work. The link will also be lost, if you re-add a platform. If you do this you have to re-add the plugin.
to work on your plugin and then simply rebuild the app to use your changes. The plugin should be added after the platform, or the link will not work. The link will also be lost if you re-add the platform or restore the project. In that case, you'll need to re-add the plugin to restore the link.

How does the above sound?

Copy link
Contributor Author

@GitToTheHub GitToTheHub Apr 7, 2025

Choose a reason for hiding this comment

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

Why did you add a ; in the sentence, can‘t this be a ,? How can you restore a project, what does this mean?

Copy link
Member

@erisu erisu Apr 7, 2025

Choose a reason for hiding this comment

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

I used a ";" because they both could be stand-alone sentences.
Update: Decided to replaced ; otherwise with , or.

Example of Restoring a Project

  1. git clone project....
  2. npm install
  3. cordova prepare

The prepare step will restore the project based on the platforms and plugins that were previously added and stored in package.json and config.xml.

Same applies if your working with an existing project and just running.

  1. rm -rf platforms plugins
  2. cordova prepare

Copy link
Member

Choose a reason for hiding this comment

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

The concept of restoring is documented here: Apache Cordova - Version Management

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.

2 participants