How to use symlinks to include an Eclipse project within another Eclipse project (link a project to another project)
I like to just symlink (symbolically link) the other project into the current project at the file-system/Operating System level. This makes your file system think the other project's files are part of the current project's files, which makes Eclipse think the other project's files are part of the current project's files.
For example, in Linux (or I think MacOS too):
cd path/to/current_project
ln -si path/to/other_project .
(The above sym-linking is possible in Windows too, but the command would be different.)
Now, right-click the current Eclipse project in your "Project Explorer" in Eclipse, and go to "Refresh".
The folder you just symlinked into the current project from the other project will now show up. You'll see a file structure like:
current_project/other_project
...with all of the other project's files inside this current_project/other_project
directory.
I do this trick all the time in Eclipse to get Eclipse to index and bring in the Arduino core source code into my current Arduino project so that I can easily Ctrl + Click and navigate all around the Arduino core for better understanding of everything as I work on my library or project.
Here's a readme I wrote where I fully document these instructions: https://github.com/ElectricRCAircraftGuy/AmboVent/blob/master/3-Software/Arduino/arduino_core/readme.md.
Inside this folder should be a symbolic link to your arduino installation folder. This way, an Eclipse project, for instance, can have full access to all of the Arduino source code to allow jumping to the core implementations of Arduino functions and definitions while exploring the code.
References:
- How to make symbolic links in Windows:
https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/
How to make the symbolic link to the core Arduino source code:
1) To create a symbolic link on Mac or Linux, the command looks like this. This will create a symbolic link folder called "arduino" right here:
ln -s "/path/to/arduino_installation_folder" arduino
Example:
cd /path/to/here
ln -s "/home/gabriel/Downloads/Install_files/Arduino/arduino-1.8.8" arduino
2) To create a symbolic link on Windows, the command looks like this:
mklink /D arduino "C:\Users\gabriel\Downloads\Install_files\Arduino\arduino-1.8.8"
Keywords: eclipse import another project; symlink eclipse project; symlink Arduino core into project in Eclipse; eclipse link project to another project c/c++