Skip to content

Library compile routine tries to compile hidden (dot) files [imported] #209

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cmaglie opened this issue Nov 15, 2012 · 0 comments
Closed

Comments

@cmaglie
Copy link
Member

cmaglie commented Nov 15, 2012

This is Issue 209 moved from a Google Code project.
Added by 2010-02-24T00:56:10.000Z by Matt.M...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).

Original labels: Type-Defect, Priority-Medium, Milestone-0019, Component-IDE

Original description

Using Arduino 18 on a machine running Ubuntu Karmic, I noticed that the
library complier picks up . files with an extension of .cpp (e.g.
.test.cpp) and tries to compile them. By convention, these sorts of file
are used as temporary buffers for file editors, and I've seen them included
in libraries created by OS X users (who apparently didn't have this issue).
I would expect these files to be ignored.

To reproduce the issue, put a file called .test.cpp in a user library
directory, with the words "test file" in it, then try to compile a sketch
with the library included.

One solution would be to modify the findFilesInFolder() function in
Compiler.java:

Compiler.java
584c584
< if (file.getName().equals(".") || file.getName().equals(".."))

continue;

  if (file.getName().startsWith(".")) continue;

So that it looks like this:

static public ArrayList findFilesInFolder(File folder, String
extension,
boolean recurse) {
ArrayList files = new ArrayList();

if (folder.listFiles() == null) return files;

for (File file : folder.listFiles()) {
  if (file.getName().startsWith(".")) continue;

  if (file.getName().endsWith("." + extension))
    files.add(file);

  if (recurse && file.isDirectory()) {
    files.addAll(findFilesInFolder(file, extension, true));
  }
}

return files;

}

@cmaglie cmaglie closed this as completed Nov 15, 2012
tbowmo pushed a commit to tbowmo/Arduino that referenced this issue Jul 14, 2016
Added preprocessor definitions to MySensors AVR boards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant