package jetbrains.mps.baseLanguage.actions;

/*Generated by MPS */

import org.jetbrains.mps.openapi.module.SModule;
import jetbrains.mps.project.AbstractModule;
import org.jetbrains.mps.openapi.persistence.PersistenceFacade;
import org.jetbrains.mps.openapi.model.SModel;
import jetbrains.mps.smodel.SModelInternal;
import org.jetbrains.mps.openapi.language.SLanguage;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;

public class ModuleDependencyUtils {
  public static void addDependencyOnJDKIfMissing(SModule currentModule) {
    if (currentModule instanceof AbstractModule) {
      ((AbstractModule) currentModule).addDependency(PersistenceFacade.getInstance().createModuleReference("6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)"), false);
    }
  }
  public static void addDependencyOnJavaDocIfMissing(SModel currentModel) {
    SModelInternal model = (SModelInternal) currentModel;
    SLanguage javadocLang = MetaAdapterFactory.getLanguage(0xf280165065d5424eL, 0xbb1b463a8781b786L, "jetbrains.mps.baseLanguage.javadoc");
    if (!(model.importedLanguageIds().contains(javadocLang))) {
      model.addLanguage(javadocLang);
    }
  }
  public static void addDependencyOnCoreIfMissing(SModel currentModel) {
    if (!(currentModel instanceof SModelInternal)) {
      return;
    }
    SModelInternal model = (SModelInternal) currentModel;
    SLanguage langCoreLang = MetaAdapterFactory.getLanguage(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, "jetbrains.mps.lang.core");
    if (!(model.importedLanguageIds().contains(langCoreLang))) {
      model.addLanguage(langCoreLang);
    }
  }
}
