project subfolders and submodules

Hello everybody!

Im trying to split my project into several subcomponents, so i can debug and update each component separately.

Now, the file structure looks something like this:

MainProject/
MainProject.ino
Module1/
Module1.h
Module1.cpp
Module1.ino

the Module1.ino is the test-enviroment specific to Module1 and should not be included in the MainProject.ino

The MainProject.ino contains:
#include "Module1/Module1.h"

The Module1.ino contains
#include "Module1.h"

and the Module1.cpp contains
#include "Module1.h"

Now, the Module1 compiles with no errors, but the MainProject.ino will not compile, blaming "undefined reference Module1::method()

Is this supposed to work?
Am i doing something wrong?

Is there another way to keep my modules separate, but included in my MainProject folder?

I understand that i should be able to do this using a standard library, moving th Module1/ to /Libraries/Module1

but am i allowed to have a .ino file inside the library folder?
..I really want to have a submodule test enviroment where i can test out the isolated submodule..

My biggest complaint with the Arduino IDE is that it does not work with relative references to folders. It does work if you give the full path name in #include but that is very inconvenient if you wish to make another copy of a whole project before making changes.

Also, I don't like the IDE's program editor and I use Geany for all my programming.

For myself I solved the problem of relative references to folders by writing this Python Compile and Upload program that uses the Arduino command-line to do the compiling and uploading. The Python program converts relative references to full path names before submitting the program to the Arduino command-line. I have things arranged so the Python program is called from a menu within Geany but it can also be used without Geany.

...R