@@ -868,7 +868,10 @@ boolean getIndexDownArgs(String dir, File sourceRoot, IndexDownArgs args) throws
868
868
if (historyBased ) {
869
869
indexDownUsingHistory (env .getSourceRootFile (), args );
870
870
} else {
871
- indexDown (sourceRoot , dir , args );
871
+ String logSuffix = project != null ? " for project " + project : String .format (" for directory '%s'" , dir );
872
+ try (Progress progress = new Progress (LOGGER , String .format ("file collection%s" , logSuffix ))) {
873
+ indexDown (sourceRoot , dir , args , progress );
874
+ }
872
875
}
873
876
874
877
elapsed .report (LOGGER , String .format ("Done file collection for directory '%s'" , dir ),
@@ -890,9 +893,13 @@ void indexDownUsingHistory(File sourceRoot, IndexDownArgs args) throws IOExcepti
890
893
891
894
FileCollector fileCollector = RuntimeEnvironment .getInstance ().getFileCollector (project .getName ());
892
895
893
- for (String path : fileCollector .getFiles ()) {
894
- File file = new File (sourceRoot , path );
895
- processFileIncremental (args , file , path );
896
+ try (Progress progress = new Progress (LOGGER , String .format ("collecting files for %s" , project ),
897
+ fileCollector .getFiles ().size ())) {
898
+ for (String path : fileCollector .getFiles ()) {
899
+ File file = new File (sourceRoot , path );
900
+ processFileIncremental (args , file , path );
901
+ progress .increment ();
902
+ }
896
903
}
897
904
}
898
905
@@ -1561,10 +1568,11 @@ private void handleSymlink(String path, AcceptSymlinkRet ret) {
1561
1568
* @param dir the root indexDirectory to generate indexes for
1562
1569
* @param parent path to parent directory
1563
1570
* @param args arguments to control execution and for collecting a list of
1571
+ * @param progress {@link Progress} instance
1564
1572
* files for indexing
1565
1573
*/
1566
1574
@ VisibleForTesting
1567
- void indexDown (File dir , String parent , IndexDownArgs args ) throws IOException {
1575
+ void indexDown (File dir , String parent , IndexDownArgs args , Progress progress ) throws IOException {
1568
1576
1569
1577
if (isInterrupted ()) {
1570
1578
return ;
@@ -1590,9 +1598,10 @@ void indexDown(File dir, String parent, IndexDownArgs args) throws IOException {
1590
1598
handleSymlink (path , ret );
1591
1599
} else {
1592
1600
if (file .isDirectory ()) {
1593
- indexDown (file , path , args );
1601
+ indexDown (file , path , args , progress );
1594
1602
} else {
1595
1603
processFile (args , file , path );
1604
+ progress .increment ();
1596
1605
}
1597
1606
}
1598
1607
}
0 commit comments