cancel
Showing results for 
Search instead for 
Did you mean: 

Empty folder required to keep project structure

DUgbo.1
Associate II

On a dual core project created with the configuration tool(STM32CubeIDE Version: 1.6.0) in the IDE project explorer there is a folder with

path: /LedFlash1_CM7/Drivers

Location: C:\folderA\flolderb\LedFlash1\CM7\Drivers

This IDE folder only contains Linked files (as set up with MX)

There is an empty folder also created on the system "C:\folderA\flolderB\LedFlash1\CM7\Drivers" If the empty "Drivers" folder is deleted STM32CubeIDE will not be able to open the linked files and can no longer build the project.

The project is under version control(git) and git does not version control folders so the folder can be deleted (eg when clean is called). It seems strange that an IDE stores its project settings using windows folders(empty).

Can the project be configured to not rely on empty folders?

1 ACCEPTED SOLUTION

Accepted Solutions

In addition to reply of Cartu38 - if you don't succeed to build without these empty folders, check them into version control.

Just create a file named .gitkeep in empty folders. That's the least evil.

--pa

View solution in original post

4 REPLIES 4
Cartu38 OpenDev
Lead II

Here you're facing some common Eclipse behavior.

Eclipse is forcing to get each link resource parents (parent(s) <=> folder(s) hosting link) as a physical existing resource on the file system.

Get a try:

1) To remove your project (and nested projects) from your current worskpace (delete it without activating related file system components removal)

2) Based on your favorite file system explorer delete then empty folder(s)

3) Import back your project within your workspace (File > Open Existing Project From File System

=> You should see empty folder(s) back on file system ... Fact is Eclipse reading links directives (part of .project metadata) is creating such folders.

According my knowledge no way to skip such behavior.

Back to your source control concern as such empty folders are created live by Eclipse ... if missing them at a time is leading to no issue.

If you remove empty folders from Eclipse UI then links are lost as under the hood as expected folders are removed from file system but as addon Eclipse is flushing .project metadata in sync ... Here conclusion is you have to source control .project file (what's good practice in any case). So still no trouble foreseen here.

STM32CubeIDE itself is relying on Eclipse links usage. If multi core devices such is a way to not "duplicate" some common resources (like Drivers). Common resources are promoted to "top most" project then "sub projects" are linking to.

In addition to reply of Cartu38 - if you don't succeed to build without these empty folders, check them into version control.

Just create a file named .gitkeep in empty folders. That's the least evil.

--pa

Thanks for explaining the cause and suggesting a solution.

Might try the .gitkeep method if it continues to be and issue

Cartu38 OpenDev
Lead II

Please tag such post to answered as will help community to dig into valuable material more quickly. Thanks.