clear annotation processors' generated outputs on rebuild

This commit is contained in:
Eugene Zhuravlev
2012-05-30 22:10:39 +02:00
parent 99e928ec1e
commit d5fd6da2c4
4 changed files with 85 additions and 62 deletions
@@ -2364,21 +2364,23 @@ public class CompileDriver {
modulesWithoutOutputPathSpecified.add(module.getName());
}
}
if (config.getAnnotationProcessingConfiguration(module).isEnabled()) {
final String path = CompilerPaths.getAnnotationProcessorsGenerationPath(module);
if (path == null) {
final CompilerProjectExtension extension = CompilerProjectExtension.getInstance(module.getProject());
if (extension == null || extension.getCompilerOutputUrl() == null) {
isProjectCompilePathSpecified = false;
if (!useOutOfProcessBuild()) {
if (config.getAnnotationProcessingConfiguration(module).isEnabled()) {
final String path = CompilerPaths.getAnnotationProcessorsGenerationPath(module);
if (path == null) {
final CompilerProjectExtension extension = CompilerProjectExtension.getInstance(module.getProject());
if (extension == null || extension.getCompilerOutputUrl() == null) {
isProjectCompilePathSpecified = false;
}
else {
modulesWithoutOutputPathSpecified.add(module.getName());
}
}
else {
modulesWithoutOutputPathSpecified.add(module.getName());
}
}
else {
final File file = new File(path);
if (!file.exists()) {
nonExistingOutputPaths.add(file);
final File file = new File(path);
if (!file.exists()) {
nonExistingOutputPaths.add(file);
}
}
}
}
@@ -2456,12 +2458,10 @@ public class CompileDriver {
if (chunkModules.size() <= 1) {
continue; // no need to check one-module chunks
}
if (!useOutOfProcessBuild()) {
for (Module chunkModule : chunkModules) {
if (config.getAnnotationProcessingConfiguration(chunkModule).isEnabled()) {
showCyclesNotSupportedForAnnotationProcessors(chunkModules.toArray(new Module[chunkModules.size()]));
return false;
}
for (Module chunkModule : chunkModules) {
if (config.getAnnotationProcessingConfiguration(chunkModule).isEnabled()) {
showCyclesNotSupportedForAnnotationProcessors(chunkModules.toArray(new Module[chunkModules.size()]));
return false;
}
}
Sdk jdk = null;
@@ -115,7 +115,7 @@ public class ProcessorProfilePanel extends JPanel {
final JLabel warning = new JLabel("<html>WARNING!<br>" +
/*"All source files located in the generated sources output directory WILL BE EXCLUDED from annotation processing. " +*/
"If option 'Clear output directory on rebuild' is enabled, " +
"the entire contents of directories specified in the table below WILL BE CLEARED on rebuild.</html>");
"the entire contents of directories where generated sources are stored WILL BE CLEARED on rebuild.</html>");
warning.setFont(warning.getFont().deriveFont(Font.BOLD));
add(myCbEnableProcessing,