Skip to content

Recursive compilation [imported] #529

@cmaglie

Description

@cmaglie

This is Issue 529 moved from a Google Code project.
Added by 2011-04-29T19:52:48.000Z by [email protected].
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Enhancement, Priority-Medium

Original description

What change would like to see?
For big or complex project, is very comfortable move some home made classes/libraries in sub folder. But arduino IDE doesn't do that

Why?
Well arduino IDE support that, but in the Compiler.java class you'll see that cursiveness is activated only for internal classes, not for the libraries folder neither for sketch folder.

Solution?
Here my solution: change all "findFilesInFolder(libraryFolder, "S", false)" to "findFilesInFolder(libraryFolder, "S", true)" so it will be recursive.
Delete the code in the part "// 2. compile the libraries, outputting .o files to: //" that handle the utils folder. in particular remove:
includePaths.add(utilityFolder.getAbsolutePath());
[...]
outputFolder = new File(outputFolder, "utility");
createFolder(outputFolder);
objectFiles.addAll(
compileFiles(avrBasePath, outputFolder.getAbsolutePath(), includePaths,
findFilesInFolder(utilityFolder, "S", true),
findFilesInFolder(utilityFolder, "c", true),
findFilesInFolder(utilityFolder, "cpp", true),
boardPreferences));
// other libraries should not see this library's utility/ folder
//includePaths.remove(includePaths.size() - 1);

Now we have to deal with the libraries that was using utils folder... only Wire, so in Wire.cpp change #include "twi.h" to #include "utility/twi.h"

Would this cause any incompatibilities with previous versions? If so, how
can these be mitigated?
It potentially can create some incompatibility, if some code was using directly twi.h (but just update the path and everything should work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions