There are many ways to organize projects and workflows, and I would say Eclipse is flexible enough for everything. As I have been asked recently how I organize my projects, I’ll share it here.
Eclipse has the concept of a ‘workspace’: This is what you select at starting the IDE.
Basically a ‘workspace’ is a ‘collection of projects and settings’.
A workspace folder contains the .metadata folder:
This hidden folder is used to store the workspace settings including the list of projects.
An Eclipse project is a folder with a .project file in it:
That file for example specifies the name of the project. Depending on the project type there can be other setting files like .cproject which is for a C/C++ project.
Default Project Location
During project creation the default location is the current workspace folder, but you are free to use any folder location you want:
So how do I organize projects, especially in combination with a version control system like git?
Separating Workspace and Projects
What has worked best for me is to separate the ‘workspace’ folder from the project folders. The workspace folder is *specific* to an Eclipse version and never should be shared or ‘re-used’ between different Eclipse IDEs. So my workspace folder is IDE specific. I only place ‘scratch’ projects in the workspace folder (e.g. trying out an SDK example) which I delete afterwards (‘kill-me projects’).
The ‘real’ or ‘valuable’ projects I put under version control like git. A git repository is basically a collection of files and folders, cloned on my disk somewhere.
So all the valuable projects are outside the workspace folder, but they are still listed in the ‘Project Explorer’ view because I have ‘linked‘ them.
Using Drag&Drop a project folder to the MCUXpresso IDE, I can choose to link it:
Using the File > Import > Existing projects I do not copy them:
Version Control Projects
The reason for this: I have many projects in my workspace, from many different git repositories. Putting the workspace folder under version control is problematic as I have to make sure the .metadata folder is *not* put under version control (.ignore it). Having projects organized in individual git repositories I have the freedom how I want to organize them, and what I want in my workspace.
Below is an an example of my projects and where they are in a git repository:
It is really up to you how you organize things, but I hope it gives you some ideas how things can be done. I prefer to use the Eclipse Workspace folder as a scratch area and store my git projects in separate folders.
Happy EclipseGiting 🙂