Skip to content

Commit c0a0e49

Browse files
author
Federico Fissore
committed
Ignore folders used by source code control software (subversino, git...) #1619
1 parent e548f31 commit c0a0e49

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

app/src/processing/app/debug/Compiler.java

+11-7
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ private List<File> compileFiles(String outputPath, File sourcePath,
235235
File objectFile = new File(objectPath);
236236
File dependFile = new File(dependPath);
237237
objectPaths.add(objectFile);
238-
if (is_already_compiled(file, objectFile, dependFile, prefs))
238+
if (isAlreadyCompiled(file, objectFile, dependFile, prefs))
239239
continue;
240240
String[] cmd = getCommandCompilerC(includePaths, file.getAbsolutePath(),
241241
objectPath);
@@ -248,7 +248,7 @@ private List<File> compileFiles(String outputPath, File sourcePath,
248248
File objectFile = new File(objectPath);
249249
File dependFile = new File(dependPath);
250250
objectPaths.add(objectFile);
251-
if (is_already_compiled(file, objectFile, dependFile, prefs))
251+
if (isAlreadyCompiled(file, objectFile, dependFile, prefs))
252252
continue;
253253
String[] cmd = getCommandCompilerCPP(includePaths,
254254
file.getAbsolutePath(), objectPath);
@@ -258,10 +258,10 @@ private List<File> compileFiles(String outputPath, File sourcePath,
258258
return objectPaths;
259259
}
260260

261-
private boolean is_already_compiled(File src, File obj, File dep, Map<String, String> prefs) {
261+
private boolean isAlreadyCompiled(File src, File obj, File dep, Map<String, String> prefs) {
262262
boolean ret=true;
263263
try {
264-
//System.out.println("\n is_already_compiled: begin checks: " + obj.getPath());
264+
//System.out.println("\n isAlreadyCompiled: begin checks: " + obj.getPath());
265265
if (!obj.exists()) return false; // object file (.o) does not exist
266266
if (!dep.exists()) return false; // dep file (.d) does not exist
267267
long src_modified = src.lastModified();
@@ -284,8 +284,8 @@ private boolean is_already_compiled(File src, File obj, File dep, Map<String, St
284284
String objpath = obj.getCanonicalPath();
285285
File linefile = new File(line);
286286
String linepath = linefile.getCanonicalPath();
287-
//System.out.println(" is_already_compiled: obj = " + objpath);
288-
//System.out.println(" is_already_compiled: line = " + linepath);
287+
//System.out.println(" isAlreadyCompiled: obj = " + objpath);
288+
//System.out.println(" isAlreadyCompiled: line = " + linepath);
289289
if (objpath.compareTo(linepath) == 0) {
290290
need_obj_parse = false;
291291
continue;
@@ -308,7 +308,7 @@ private boolean is_already_compiled(File src, File obj, File dep, Map<String, St
308308
ret = false; // prerequisite modified since object was compiled
309309
break;
310310
}
311-
//System.out.println(" is_already_compiled: prerequisite ok");
311+
//System.out.println(" isAlreadyCompiled: prerequisite ok");
312312
}
313313
}
314314
reader.close();
@@ -575,6 +575,10 @@ static public List<File> findFilesInFolder(File folder, String extension,
575575
boolean recurse) {
576576
List<File> files = new ArrayList<File>();
577577

578+
if (Library.SOURCE_CONTROL_FOLDERS.contains(folder.getName())) {
579+
return files;
580+
}
581+
578582
if (folder.listFiles() == null)
579583
return files;
580584

app/src/processing/app/packages/Library.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public class Library {
3535
private static final List<String> OPTIONAL_FILES = Arrays
3636
.asList(new String[] { "keywords.txt", "library.properties" });
3737

38+
public static final List<String> SOURCE_CONTROL_FOLDERS = Arrays.asList(new String[]{"CSV", "RCS", ".git", ".svn", ".hq", ".bzr"});
39+
3840
/**
3941
* Scans inside a folder and create a Library object out of it. Automatically
4042
* detects pre-1.5 libraries. Automatically fills metadata from
@@ -75,7 +77,7 @@ private static Library createLibrary(File libFolder) throws IOException {
7577
// 3. check if root folder contains prohibited stuff
7678
for (File file : libFolder.listFiles()) {
7779
if (file.isDirectory()) {
78-
if (!OPTIONAL_FOLDERS.contains(file.getName()))
80+
if (!SOURCE_CONTROL_FOLDERS.contains(file.getName()) && !OPTIONAL_FOLDERS.contains(file.getName()))
7981
throw new IOException("Invalid folder '" + file.getName() + "'.");
8082
} else {
8183
if (!OPTIONAL_FILES.contains(file.getName()))

0 commit comments

Comments
 (0)