3838import processing .app .Preferences ;
3939import processing .app .Sketch ;
4040import processing .app .SketchCode ;
41+ import processing .app .helpers .FileUtils ;
4142import processing .app .helpers .PreferencesMap ;
4243import processing .app .helpers .ProcessUtils ;
4344import processing .app .helpers .StringReplacer ;
@@ -235,7 +236,7 @@ private List<File> compileFiles(String outputPath, File sourcePath,
235236 File objectFile = new File (objectPath );
236237 File dependFile = new File (dependPath );
237238 objectPaths .add (objectFile );
238- if (is_already_compiled (file , objectFile , dependFile , prefs ))
239+ if (isAlreadyCompiled (file , objectFile , dependFile , prefs ))
239240 continue ;
240241 String [] cmd = getCommandCompilerC (includePaths , file .getAbsolutePath (),
241242 objectPath );
@@ -248,7 +249,7 @@ private List<File> compileFiles(String outputPath, File sourcePath,
248249 File objectFile = new File (objectPath );
249250 File dependFile = new File (dependPath );
250251 objectPaths .add (objectFile );
251- if (is_already_compiled (file , objectFile , dependFile , prefs ))
252+ if (isAlreadyCompiled (file , objectFile , dependFile , prefs ))
252253 continue ;
253254 String [] cmd = getCommandCompilerCPP (includePaths ,
254255 file .getAbsolutePath (), objectPath );
@@ -258,10 +259,10 @@ private List<File> compileFiles(String outputPath, File sourcePath,
258259 return objectPaths ;
259260 }
260261
261- private boolean is_already_compiled (File src , File obj , File dep , Map <String , String > prefs ) {
262+ private boolean isAlreadyCompiled (File src , File obj , File dep , Map <String , String > prefs ) {
262263 boolean ret =true ;
263264 try {
264- //System.out.println("\n is_already_compiled : begin checks: " + obj.getPath());
265+ //System.out.println("\n isAlreadyCompiled : begin checks: " + obj.getPath());
265266 if (!obj .exists ()) return false ; // object file (.o) does not exist
266267 if (!dep .exists ()) return false ; // dep file (.d) does not exist
267268 long src_modified = src .lastModified ();
@@ -284,8 +285,8 @@ private boolean is_already_compiled(File src, File obj, File dep, Map<String, St
284285 String objpath = obj .getCanonicalPath ();
285286 File linefile = new File (line );
286287 String linepath = linefile .getCanonicalPath ();
287- //System.out.println(" is_already_compiled : obj = " + objpath);
288- //System.out.println(" is_already_compiled : line = " + linepath);
288+ //System.out.println(" isAlreadyCompiled : obj = " + objpath);
289+ //System.out.println(" isAlreadyCompiled : line = " + linepath);
289290 if (objpath .compareTo (linepath ) == 0 ) {
290291 need_obj_parse = false ;
291292 continue ;
@@ -308,7 +309,7 @@ private boolean is_already_compiled(File src, File obj, File dep, Map<String, St
308309 ret = false ; // prerequisite modified since object was compiled
309310 break ;
310311 }
311- //System.out.println(" is_already_compiled : prerequisite ok");
312+ //System.out.println(" isAlreadyCompiled : prerequisite ok");
312313 }
313314 }
314315 reader .close ();
@@ -575,12 +576,19 @@ static public List<File> findFilesInFolder(File folder, String extension,
575576 boolean recurse ) {
576577 List <File > files = new ArrayList <File >();
577578
578- if (folder . listFiles () == null )
579+ if (FileUtils . isSCCSOrHiddenFile ( folder )) {
579580 return files ;
581+ }
580582
581- for (File file : folder .listFiles ()) {
582- if (file .getName ().startsWith ("." ))
583+ File [] listFiles = folder .listFiles ();
584+ if (listFiles == null ) {
585+ return files ;
586+ }
587+
588+ for (File file : listFiles ) {
589+ if (FileUtils .isSCCSOrHiddenFile (file )) {
583590 continue ; // skip hidden files
591+ }
584592
585593 if (file .getName ().endsWith ("." + extension ))
586594 files .add (file );
0 commit comments