@NotNull
private static File getBuildOutputDirectory(@NotNull JpsModule module,
boolean forTests,
@NotNull CompileContext context) throws ProjectBuildException {
JpsJavaExtensionService instance = JpsJavaExtensionService.getInstance();
File outputDirectory = instance.getOutputDirectory(module, forTests);
if (outputDirectory == null) {
String errorMessage = "No output dir for module " + module.getName();
context.processMessage(new CompilerMessage(NAME, BuildMessage.Kind.ERROR, errorMessage));
throw new ProjectBuildException(errorMessage);
}