293 // If there is any change in the source files, taint packages 294 // and mark the database in need of saving. 295 javac_state.checkSourceStatus(false); 296 297 // Find all existing artifacts. Their timestamp will match the last modified timestamps stored 298 // in javac_state, simply because loading of the JavacState will clean out all artifacts 299 // that do not match the javac_state database. 300 javac_state.findAllArtifacts(); 301 302 // Remove unidentified artifacts from the bin, gensrc and header dirs. 303 // (Unless we allow them to be there.) 304 // I.e. artifacts that are not known according to the build database (javac_state). 305 // For examples, files that have been manually copied into these dirs. 306 // Artifacts with bad timestamps (ie the on disk timestamp does not match the timestamp 307 // in javac_state) have already been removed when the javac_state was loaded. 308 if (!options.isUnidentifiedArtifactPermitted()) { 309 javac_state.removeUnidentifiedArtifacts(); 310 } 311 // Go through all sources and taint all packages that miss artifacts. 312 javac_state.taintPackagesThatMissArtifacts(); 313 314 // Now clean out all known artifacts belonging to tainted packages. 315 javac_state.deleteClassArtifactsInTaintedPackages(); 316 // Copy files, for example property files, images files, xml files etc etc. 317 javac_state.performCopying(Util.pathToFile(options.getDestDir()), suffixRules); 318 // Translate files, for example compile properties or compile idls. 319 javac_state.performTranslation(Util.pathToFile(gensrc), suffixRules); 320 // Add any potentially generated java sources to the tobe compiled list. 321 // (Generated sources must always have a package.) 322 Map<String,Source> generated_sources = new HashMap<>(); 323 324 try { 325 326 Source.scanRoot(Util.pathToFile(options.getGenSrcDir()), Util.set(".java"), null, null, null, null, 327 generated_sources, modules, current_module, false, true, false); 328 javac_state.now().flattenPackagesSourcesAndArtifacts(modules); 329 // Recheck the the source files and their timestamps again. 330 javac_state.checkSourceStatus(true); 331 332 // Now do a safety check that the list of source files is identical | 293 // If there is any change in the source files, taint packages 294 // and mark the database in need of saving. 295 javac_state.checkSourceStatus(false); 296 297 // Find all existing artifacts. Their timestamp will match the last modified timestamps stored 298 // in javac_state, simply because loading of the JavacState will clean out all artifacts 299 // that do not match the javac_state database. 300 javac_state.findAllArtifacts(); 301 302 // Remove unidentified artifacts from the bin, gensrc and header dirs. 303 // (Unless we allow them to be there.) 304 // I.e. artifacts that are not known according to the build database (javac_state). 305 // For examples, files that have been manually copied into these dirs. 306 // Artifacts with bad timestamps (ie the on disk timestamp does not match the timestamp 307 // in javac_state) have already been removed when the javac_state was loaded. 308 if (!options.isUnidentifiedArtifactPermitted()) { 309 javac_state.removeUnidentifiedArtifacts(); 310 } 311 // Go through all sources and taint all packages that miss artifacts. 312 javac_state.taintPackagesThatMissArtifacts(); 313 // Check recorded classpath public apis. Taint packages that depend on 314 // classpath classes whose public apis have changed. 315 javac_state.taintPackagesDependingOnChangedClasspathPackages(); 316 317 // Now clean out all known artifacts belonging to tainted packages. 318 javac_state.deleteClassArtifactsInTaintedPackages(); 319 // Copy files, for example property files, images files, xml files etc etc. 320 javac_state.performCopying(Util.pathToFile(options.getDestDir()), suffixRules); 321 // Translate files, for example compile properties or compile idls. 322 javac_state.performTranslation(Util.pathToFile(gensrc), suffixRules); 323 // Add any potentially generated java sources to the tobe compiled list. 324 // (Generated sources must always have a package.) 325 Map<String,Source> generated_sources = new HashMap<>(); 326 327 try { 328 329 Source.scanRoot(Util.pathToFile(options.getGenSrcDir()), Util.set(".java"), null, null, null, null, 330 generated_sources, modules, current_module, false, true, false); 331 javac_state.now().flattenPackagesSourcesAndArtifacts(modules); 332 // Recheck the the source files and their timestamps again. 333 javac_state.checkSourceStatus(true); 334 335 // Now do a safety check that the list of source files is identical |