use of org.jetbrains.jps.model.library.sdk.JpsSdk in project intellij-community by JetBrains.
the class JavaBuilderUtil method ensureModuleHasJdk.
@NotNull
public static JpsSdk<JpsDummyElement> ensureModuleHasJdk(JpsModule module, CompileContext context, final String compilerName) throws ProjectBuildException {
JpsSdkReference<JpsDummyElement> reference = module.getSdkReference(JpsJavaSdkType.INSTANCE);
if (reference == null) {
context.processMessage(new CompilerMessage(compilerName, BuildMessage.Kind.ERROR, "JDK isn't specified for module '" + module.getName() + "'"));
throw new StopBuildException();
}
JpsTypedLibrary<JpsSdk<JpsDummyElement>> sdkLibrary = reference.resolve();
if (sdkLibrary == null) {
context.processMessage(new CompilerMessage(compilerName, BuildMessage.Kind.ERROR, "Cannot find JDK '" + reference.getSdkName() + "' for module '" + module.getName() + "'"));
throw new StopBuildException();
}
return sdkLibrary.getProperties();
}
Aggregations