Go Down

Topic: [mod]recursive compilation (Read 3047 times) previous topic - next topic

lesto

ever wandered to organize your sketch code into a folder structure?
ever wandered to import complex project from and to other IDE witch use folder organization without have to modify every single include?

if you are lost in your sketch's file, then this the MOD for you! It enable the IDE to copy libraries and sketch sub-folder to be copied in the temporary library where the real compilation happen! everything else is worked out by default by compiler!

Now you can have in your sketch a sub-folder witch contains modded-ad-hoc libraries, sub-folder for every sensor's code, and so on!

And this is actually a pull request, so support this post to see this mod became the standard of the next IDE version!! (https://github.com/arduino/Arduino/pull/116)

NOTE:
sub-folder's code is not displayed in the IDE, I'll fix this when I'll have some more free time.
also some libraries support and use "utility" sub-folder, but the include is not path standard.
so you have to change
Code: [Select]
#include "BALABL.h" into
Code: [Select]
#include "utility/BALABL.h" use "/" as path separator, because it is compatible with all system, while "\" path separator work only with Windows. IDE's library has been already patched
sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

pYro_65

I'm all for it. However does it address the problem of non .h and .cpp files being skipped ( #include "MyPinSet.pins" ), I think it is more important than sub-folders. But together would move the IDE far closer to being a standard conforming system.

I hope this mod gets implemented either way. Breaking the current utility folder functionality is a small price to pay, ( 0023 to 1.0 had more severe changes ).

lesto

#2
Sep 25, 2012, 10:38 am Last Edit: Sep 25, 2012, 10:41 am by lesto Reason: 1
All file are copied into compilation folder, it was and it still is like this. (uhmm bad English but i don't know a better way to say it)
I think your problem derive from the way arduino actually modify the .pde: it translate it in a .cpp before the compilation, but doing so have to move the include, and maybe it will auto-forget about what it thinks to be invalid include. But including your MyPinSet.pins into aother .c or .cpp should work. Can you make a test (i'm at work actually)...
[some time later]
found out, from arduino/app/src/processing/app/preproc/PdePreprocessor.java:
Code: [Select]
String importRegexp = "^\\s*#include\\s*[<\"](\\S+)[\">]";

so your problem isn't there.
maybe is with the fact that it compiles onlu .S, .c and .cpp? i don't know, please post your error and let's see what i can get out.

Quote
Breaking the current utility folder functionality is a small price to pay

i agree that the price to pay is small, very small because many external library doesn't use the utility folder.
sei nuovo? non sai da dove partire? leggi qui: http://playground.arduino.cc/Italiano/Newbie

Go Up