mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Ignore folders used by source code control software (subversino, git...) #1619
This commit is contained in:
@ -235,7 +235,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
File objectFile = new File(objectPath);
|
File objectFile = new File(objectPath);
|
||||||
File dependFile = new File(dependPath);
|
File dependFile = new File(dependPath);
|
||||||
objectPaths.add(objectFile);
|
objectPaths.add(objectFile);
|
||||||
if (is_already_compiled(file, objectFile, dependFile, prefs))
|
if (isAlreadyCompiled(file, objectFile, dependFile, prefs))
|
||||||
continue;
|
continue;
|
||||||
String[] cmd = getCommandCompilerC(includePaths, file.getAbsolutePath(),
|
String[] cmd = getCommandCompilerC(includePaths, file.getAbsolutePath(),
|
||||||
objectPath);
|
objectPath);
|
||||||
@ -248,7 +248,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
File objectFile = new File(objectPath);
|
File objectFile = new File(objectPath);
|
||||||
File dependFile = new File(dependPath);
|
File dependFile = new File(dependPath);
|
||||||
objectPaths.add(objectFile);
|
objectPaths.add(objectFile);
|
||||||
if (is_already_compiled(file, objectFile, dependFile, prefs))
|
if (isAlreadyCompiled(file, objectFile, dependFile, prefs))
|
||||||
continue;
|
continue;
|
||||||
String[] cmd = getCommandCompilerCPP(includePaths,
|
String[] cmd = getCommandCompilerCPP(includePaths,
|
||||||
file.getAbsolutePath(), objectPath);
|
file.getAbsolutePath(), objectPath);
|
||||||
@ -258,10 +258,10 @@ public class Compiler implements MessageConsumer {
|
|||||||
return objectPaths;
|
return objectPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean is_already_compiled(File src, File obj, File dep, Map<String, String> prefs) {
|
private boolean isAlreadyCompiled(File src, File obj, File dep, Map<String, String> prefs) {
|
||||||
boolean ret=true;
|
boolean ret=true;
|
||||||
try {
|
try {
|
||||||
//System.out.println("\n is_already_compiled: begin checks: " + obj.getPath());
|
//System.out.println("\n isAlreadyCompiled: begin checks: " + obj.getPath());
|
||||||
if (!obj.exists()) return false; // object file (.o) does not exist
|
if (!obj.exists()) return false; // object file (.o) does not exist
|
||||||
if (!dep.exists()) return false; // dep file (.d) does not exist
|
if (!dep.exists()) return false; // dep file (.d) does not exist
|
||||||
long src_modified = src.lastModified();
|
long src_modified = src.lastModified();
|
||||||
@ -284,8 +284,8 @@ public class Compiler implements MessageConsumer {
|
|||||||
String objpath = obj.getCanonicalPath();
|
String objpath = obj.getCanonicalPath();
|
||||||
File linefile = new File(line);
|
File linefile = new File(line);
|
||||||
String linepath = linefile.getCanonicalPath();
|
String linepath = linefile.getCanonicalPath();
|
||||||
//System.out.println(" is_already_compiled: obj = " + objpath);
|
//System.out.println(" isAlreadyCompiled: obj = " + objpath);
|
||||||
//System.out.println(" is_already_compiled: line = " + linepath);
|
//System.out.println(" isAlreadyCompiled: line = " + linepath);
|
||||||
if (objpath.compareTo(linepath) == 0) {
|
if (objpath.compareTo(linepath) == 0) {
|
||||||
need_obj_parse = false;
|
need_obj_parse = false;
|
||||||
continue;
|
continue;
|
||||||
@ -308,7 +308,7 @@ public class Compiler implements MessageConsumer {
|
|||||||
ret = false; // prerequisite modified since object was compiled
|
ret = false; // prerequisite modified since object was compiled
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//System.out.println(" is_already_compiled: prerequisite ok");
|
//System.out.println(" isAlreadyCompiled: prerequisite ok");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reader.close();
|
reader.close();
|
||||||
@ -575,6 +575,10 @@ public class Compiler implements MessageConsumer {
|
|||||||
boolean recurse) {
|
boolean recurse) {
|
||||||
List<File> files = new ArrayList<File>();
|
List<File> files = new ArrayList<File>();
|
||||||
|
|
||||||
|
if (Library.SOURCE_CONTROL_FOLDERS.contains(folder.getName())) {
|
||||||
|
return files;
|
||||||
|
}
|
||||||
|
|
||||||
if (folder.listFiles() == null)
|
if (folder.listFiles() == null)
|
||||||
return files;
|
return files;
|
||||||
|
|
||||||
|
@ -35,6 +35,8 @@ public class Library {
|
|||||||
private static final List<String> OPTIONAL_FILES = Arrays
|
private static final List<String> OPTIONAL_FILES = Arrays
|
||||||
.asList(new String[] { "keywords.txt", "library.properties" });
|
.asList(new String[] { "keywords.txt", "library.properties" });
|
||||||
|
|
||||||
|
public static final List<String> SOURCE_CONTROL_FOLDERS = Arrays.asList(new String[]{"CSV", "RCS", ".git", ".svn", ".hq", ".bzr"});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scans inside a folder and create a Library object out of it. Automatically
|
* Scans inside a folder and create a Library object out of it. Automatically
|
||||||
* detects pre-1.5 libraries. Automatically fills metadata from
|
* detects pre-1.5 libraries. Automatically fills metadata from
|
||||||
@ -75,7 +77,7 @@ public class Library {
|
|||||||
// 3. check if root folder contains prohibited stuff
|
// 3. check if root folder contains prohibited stuff
|
||||||
for (File file : libFolder.listFiles()) {
|
for (File file : libFolder.listFiles()) {
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
if (!OPTIONAL_FOLDERS.contains(file.getName()))
|
if (!SOURCE_CONTROL_FOLDERS.contains(file.getName()) && !OPTIONAL_FOLDERS.contains(file.getName()))
|
||||||
throw new IOException("Invalid folder '" + file.getName() + "'.");
|
throw new IOException("Invalid folder '" + file.getName() + "'.");
|
||||||
} else {
|
} else {
|
||||||
if (!OPTIONAL_FILES.contains(file.getName()))
|
if (!OPTIONAL_FILES.contains(file.getName()))
|
||||||
|
Reference in New Issue
Block a user