Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Recursive compilation #116

Closed
wants to merge 1 commit into
from

Conversation

5 participants

With this patch, the special case of the "utility" folder in compilation is removed.
In fact now the IDE will be compliant to standard, and will copy recursively all file to compiled keeping the folder structure.
Also changed all library #include to be compliant with the standard.

Now you can import and export complex library and give a logical organization of your code's file.

TODO: The source in the sketch sub-folder will remain inaccessible from the IDE, I'll fix that soon with another patch

@lestofante lestofante commented on the diff Nov 8, 2012

app/src/processing/app/debug/Compiler.java
@@ -137,6 +137,12 @@ public boolean compile(Sketch sketch,
// 2. compile the libraries, outputting .o files to: <buildPath>/<library>/
sketch.setCompilingProgress(40);
+
+ for (File libraryFolder : sketch.getImportedLibraries()) {
+ copyRecursively(avrBasePath, libraryFolder, buildPath, objectFiles, includePaths, boardPreferences);
+ }
+
+ /*
@lestofante

lestofante Nov 8, 2012

zombie code, can be safety removed

Owner

cmaglie commented Nov 19, 2012

lestofante,

how does this patch impact on old libraries?
They should change #inlcude <something.h> to #include <utility/something.h>?
The old libraries must work without modifications, we can't pull a patch that brokes a lot of libraries out there.
Maybe we can keep including just the "utility" folder in the build path?

may you port this patch to 1.5?

yes, they should change #include <something.h> to #include
<utility/something.h>, but it is already done in this patch, because the
include witch have to be changed are INSIDE the library and will not affect
user's sketch or other library.
I've compiled all test example without any modification as test, and
everything just work.

i'll take a look to port the code.

2012/11/19 Cristian Maglie notifications@github.com

lestofante,

how does this patch impact on old libraries?
They should change #inlcude <something.h> to #include
<utility/something.h>?
The old libraries must work without modifications, we can't pull a patch
that brokes a lot of libraries out there.
Maybe we can keep including just the "utility" folder in the build path?

may you port this patch to 1.5?


Reply to this email directly or view it on GitHubhttps://github.com/arduino/Arduino/pull/116#issuecomment-10511168.

Owner

cmaglie commented Nov 19, 2012

I was talking about 3rd party libraries, many authors have found their way to circumvent this limitation, and I see that frequently they put some extra folders with documentation, diagrams etc.

For example:

https://github.com/billroy/bitlash

What happens if you try to compile this one?

looking at their code it is strange it can compile without this patch!
as you can see here
https://github.com/billroy/bitlash/blob/master/bitlash.cpp
it import src/*.c but with current IDE it should be only *.c and all src
file should be moved in the same folder of bitlash.cpp...

2012/11/19 Cristian Maglie notifications@github.com

I was talking about 3rd party libraries, many authors have found their way
to circumvent this limitation, and I see that frequently they put some
extra folders with documentation, diagrams etc.

For example:

https://github.com/billroy/bitlash

What happens if you try to compile this one?


Reply to this email directly or view it on GitHubhttps://github.com/arduino/Arduino/pull/116#issuecomment-10512620.

billroy commented Nov 19, 2012

It may be strange, but it has been compiling successfully since 2008, and it would be a shame to break such a long run.

Best regards,

-br

On Nov 19, 2012, at 6:23 AM, lestofante wrote:

looking at their code it is strange it can compile without this patch!
as you can see here
https://github.com/billroy/bitlash/blob/master/bitlash.cpp
it import src/*.c but with current IDE it should be only *.c and all src
file should be moved in the same folder of bitlash.cpp...

2012/11/19 Cristian Maglie notifications@github.com

I was talking about 3rd party libraries, many authors have found their way
to circumvent this limitation, and I see that frequently they put some
extra folders with documentation, diagrams etc.

For example:

https://github.com/billroy/bitlash

What happens if you try to compile this one?


Reply to this email directly or view it on GitHubhttps://github.com/arduino/Arduino/pull/116#issuecomment-10512620.


Reply to this email directly or view it on GitHub.

I'll try when i'll back home later

2012/11/19 Bill Roy notifications@github.com

It may be strange, but it has been compiling successfully since 2008, and
it would be a shame to break such a long run.

Best regards,

-br

On Nov 19, 2012, at 6:23 AM, lestofante wrote:

looking at their code it is strange it can compile without this patch!
as you can see here
https://github.com/billroy/bitlash/blob/master/bitlash.cpp
it import src/*.c but with current IDE it should be only *.c and all src
file should be moved in the same folder of bitlash.cpp...

2012/11/19 Cristian Maglie notifications@github.com

I was talking about 3rd party libraries, many authors have found their
way
to circumvent this limitation, and I see that frequently they put some
extra folders with documentation, diagrams etc.

For example:

https://github.com/billroy/bitlash

What happens if you try to compile this one?


Reply to this email directly or view it on GitHub<
https://github.com/arduino/Arduino/pull/116#issuecomment-10512620>.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com/arduino/Arduino/pull/116#issuecomment-10516682.

Owner

damellis commented Nov 20, 2012

I agree with Cristian that it's important to keep the special case for the
utility folder to maintain compatibility with existing libraries.

On Mon, Nov 19, 2012 at 10:24 AM, lestofante notifications@github.comwrote:

I'll try when i'll back home later

2012/11/19 Bill Roy notifications@github.com

It may be strange, but it has been compiling successfully since 2008,
and
it would be a shame to break such a long run.

Best regards,

-br

On Nov 19, 2012, at 6:23 AM, lestofante wrote:

looking at their code it is strange it can compile without this patch!
as you can see here
https://github.com/billroy/bitlash/blob/master/bitlash.cpp
it import src/*.c but with current IDE it should be only *.c and all
src
file should be moved in the same folder of bitlash.cpp...

2012/11/19 Cristian Maglie notifications@github.com

I was talking about 3rd party libraries, many authors have found
their
way
to circumvent this limitation, and I see that frequently they put
some
extra folders with documentation, diagrams etc.

For example:

https://github.com/billroy/bitlash

What happens if you try to compile this one?


Reply to this email directly or view it on GitHub<
https://github.com/arduino/Arduino/pull/116#issuecomment-10512620>.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub<
https://github.com/arduino/Arduino/pull/116#issuecomment-10516682>.


Reply to this email directly or view it on GitHubhttps://github.com/arduino/Arduino/pull/116#issuecomment-10517388.

Contributor

ffissore commented Jan 28, 2013

feature added in #1152

@ffissore ffissore closed this Jan 28, 2013

tbowmo pushed a commit to tbowmo/Arduino that referenced this pull request Jul 14, 2016

Merge pull request #116 from kluszczyn/master
Update PressureSensor.ino
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment