docs: @SuppressWarnings({"checkstyle:npathcomplexity", "checkstyle:cyclomaticcomplexity",
  		"checkstyle:returncount", "checkstyle:magicnumber"})
  	public boolean compile(IProgressMonitor progress) {
  		final IProgressMonitor monitor = progress == null ? new NullProgressMonitor() : progress;
  		try {
  			monitor.beginTask(Messages.SarlBatchCompiler_42, 18);
  			if (!checkConfiguration(monitor)) {
  				return false;
  			}
  			monitor.worked(1);
  			final ResourceSet resourceSet = this.resourceSetProvider.get();
  			configureExtraLanguageGenerators();
  			if (!configureWorkspace(resourceSet, monitor)) {
  				return false;
  			}
  			if (getLogger().isDebugEnabled()) {
  				getLogger().debug(Utils.dump(getGeneratorConfig(), false));
  			}
  			monitor.worked(2);
  			monitor.subTask(Messages.SarlBatchCompiler_43);
  			if (this.generatorConfigProvider instanceof GeneratorConfigProvider) {
  				((GeneratorConfigProvider) this.generatorConfigProvider).install(resourceSet, getGeneratorConfig());
  			}
  			if (monitor.isCanceled()) {
  				return false;
  			}
  			if (this.generatorConfigProvider2 instanceof GeneratorConfigProvider2) {
  				((GeneratorConfigProvider2) this.generatorConfigProvider2).install(resourceSet, getGeneratorConfig2());
  			}
  			if (getLogger().isDebugEnabled()) {
  				getLogger().debug(Utils.dump(getGeneratorConfig2(), false));
  			}
  			if (monitor.isCanceled()) {
  				return false;
  			}
  			monitor.worked(3);
  			monitor.subTask(Messages.SarlBatchCompiler_44);
  			final File stubClassDirectory = createTempDir(BINCLASS_FOLDER_PREFIX);
  			if (monitor.isCanceled()) {
  				return false;
  			}
  			monitor.worked(4);
  			try {
  				monitor.subTask(Messages.SarlBatchCompiler_45);
  				this.compilerPhases.setIndexing(resourceSet, true);
  				if (monitor.isCanceled()) {
  					return false;
  				}
  				monitor.worked(5);
  				// install a type provider without index lookup for the first phase
  				installJvmTypeProvider(resourceSet, stubClassDirectory, true, monitor);
  				if (monitor.isCanceled()) {
  					return false;
  				}
  				monitor.worked(6);
  				loadSARLFiles(resourceSet, monitor);
  				if (monitor.isCanceled()) {
  					return false;
  				}
  				monitor.worked(7);
  				final File stubSourceDirectory = createStubs(resourceSet, monitor);
  				if (monitor.isCanceled()) {
  					return false;
  				}
  				monitor.worked(8);
  				if (!preCompileStubs(stubSourceDirectory, stubClassDirectory, monitor)) {
  					if (monitor.isCanceled()) {
  						return false;
  					}
  					reportInternalWarning(Messages.SarlBatchCompiler_2);
  				}
  				monitor.worked(9);
  				if (!preCompileJava(stubSourceDirectory, stubClassDirectory, monitor)) {
  					if (monitor.isCanceled()) {
  						return false;
  					}
  					if (getLogger().isDebugEnabled()) {
  						getLogger().debug(Messages.SarlBatchCompiler_3);
  					}
  				}
  				monitor.worked(10);
  			} finally {
  				monitor.subTask(Messages.SarlBatchCompiler_46);
  				this.compilerPhases.setIndexing(resourceSet, false);
  				if (monitor.isCanceled()) {
  					return false;
  				}
  			}
  			monitor.worked(11);
  			// install a fresh type provider for the second phase, so we clear all previously cached classes and misses.
  			installJvmTypeProvider(resourceSet, stubClassDirectory, false, monitor);
  			if (monitor.isCanceled()) {
  				return false;
  			}
  			monitor.worked(12);
  			generateJvmElements(resourceSet, monitor);
  			if (monitor.isCanceled()) {
  				return false;
  			}
  			monitor.worked(13);
  			final List<Resource> validatedResources = new ArrayList<>();
  			final List<Issue> issues = validate(resourceSet, validatedResources, monitor);
  			if (monitor.isCanceled()) {
  				return false;
  			}
  			if (!issues.isEmpty()) {
  				if (reportCompilationIssues(issues)) {
  					return false;
  				}
  			}
  			monitor.worked(14);
  			overrideXtextInternalLoggers();
  			generateJavaFiles(validatedResources, monitor);
  			if (monitor.isCanceled()) {
  				return false;
  			}
  			monitor.worked(15);
  			if (isJavaPostCompilationEnable()) {
  				postCompileJava(monitor);
  				if (monitor.isCanceled()) {
  					return false;
  				}
  			}
  			monitor.worked(16);
  		} finally {
  			monitor.subTask(Messages.SarlBatchCompiler_47);
  			destroyClassLoader(this.jvmTypesClassLoader);
  			destroyClassLoader(this.annotationProcessingClassLoader);
  			if (isDeleteTempDirectory()) {
  				monitor.subTask(Messages.SarlBatchCompiler_48);
  				for (final File file : this.tempFolders) {
  					cleanFolder(file, ACCEPT_ALL_FILTER, true, true);
  				}
  			}
  			unconfigureExtraLanguageGenerators();
  			monitor.done();
  		}
  		return true;
  	}