public static void mergeReports ( File reportOverall , File ... reports ) { SessionInfoStore infoStore = new SessionInfoStore ( ) ; ExecutionDataStore dataStore = new ExecutionDataStore ( ) ; boolean isCurrentVersionFormat = loadSourceFiles ( infoStore , dataStore , reports ) ; try ( BufferedOutputStream outputStream = new BufferedOutputStream ( new FileOutputStream ( reportOverall ) ) ) { Object visitor ; if ( isCurrentVersionFormat ) { visitor = new ExecutionDataWriter ( outputStream ) ; } else { visitor = new org . jacoco . previous . core . data . ExecutionDataWriter ( outputStream ) ; } infoStore . accept ( ( ISessionInfoVisitor ) visitor ) ; dataStore . accept ( ( IExecutionDataVisitor ) visitor ) ; } catch ( IOException e ) { throw new IllegalStateException ( String . format ( "Unable to write overall coverage report %s" , reportOverall . getAbsolutePath ( ) ) , e ) ; } }
Merge all reports in reportOverall .