Package com.intellij.openapi.projectRoots

Examples of com.intellij.openapi.projectRoots.Sdk


  public final void setCodePath(GeneralCommandLine commandLine) throws ExecutionException {
    commandLine.addParameters(getCodePath());
  }

  public final void setExePath(GeneralCommandLine commandLine) throws ExecutionException {
    Sdk sdk = ModuleRootManager.getInstance(myModule).getSdk();
    String homePath = sdk != null ? sdk.getHomePath() : null;
    if (homePath == null) {
      throw new ExecutionException("Invalid module SDK.");
    }
    String erl = FileUtil.toSystemDependentName(ErlangSdkType.getTopLevelExecutable(homePath).getAbsolutePath());
    commandLine.setExePath(erl);
View Full Code Here


  @Override
  protected LightProjectDescriptor getProjectDescriptor() {
    return new DefaultLightProjectDescriptor() {
      @Override
      public Sdk getSdk() {
        Sdk mockSdk = ErlangSdkType.createMockSdk("testData/mockSdk-R15B02/");
        // Set local SDK documentation path
        SdkModificator sdkModificator = mockSdk.getSdkModificator();
        VirtualFile localDocDir = LocalFileSystem.getInstance().findFileByPath("testData/mockSdk-R15B02/");
        sdkModificator.addRoot(localDocDir, JavadocOrderRootType.getInstance());
        sdkModificator.commitChanges();
        return mockSdk;
      }
View Full Code Here

    assertNotNull(facet);
    assertSameElements(facet.getConfiguration().getParseTransforms(), "lager_transform");
  }

  private static void createMockSdk() {
    final Sdk mockSdk = ErlangSdkType.createMockSdk(MOCK_SDK_DIR);
    ApplicationManager.getApplication().runWriteAction(new Runnable() {
      @Override
      public void run() {
        ProjectJdkTable.getInstance().addJdk(mockSdk);
      }
View Full Code Here

    params.setMainClass(getMainReplClass(module));
    params.setWorkingDirectory(new File(workingDir));

    final GeneralCommandLine line = CommandLineBuilder.createFromJavaParameters(params, PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext()), true);

    final Sdk sdk = params.getJdk();
    assert sdk != null;
    final SdkType type = (SdkType) sdk.getSdkType();
    final String executablePath = ((JavaSdkType) type).getVMExecutablePath(sdk);

    final ArrayList<String> cmd = new ArrayList<String>();
    cmd.add(executablePath);
    cmd.addAll(getJvmClojureOptions(module));
View Full Code Here

    params.setMainClass(getMainReplClass(module));
    params.setWorkingDirectory(new File(workingDir));

    final GeneralCommandLine line = CommandLineBuilder.createFromJavaParameters(params, PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext()), true);

    final Sdk sdk = params.getJdk();
    assert sdk != null;
    final SdkType type = (SdkType) sdk.getSdkType();
    final String executablePath = ((JavaSdkType) type).getVMExecutablePath(sdk);

    //final ArrayList<String> cmd = new ArrayList<String>();
    //cmd.add(executablePath);
View Full Code Here

    if (module == null) {
      throw new ExecutionException("Module is not specified");
    }

    final ModuleRootManager rootManager = ModuleRootManager.getInstance(module);
    final Sdk sdk = rootManager.getSdk();
    if (sdk == null || !(sdk.getSdkType() instanceof JavaSdkType)) {
      throw CantRunException.noJdkForModule(getModule());
    }

    final Project project = module.getProject();
    if (!org.jetbrains.plugins.clojure.config.ClojureConfigUtil.isClojureConfigured(module)) {
View Full Code Here

      params.setMainClass(ClojureUtils.CLOJURE_MAIN);
      params.setWorkingDirectory(path);

      final GeneralCommandLine line = CommandLineBuilder.createFromJavaParameters(params, PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext()), true);

      final Sdk sdk = params.getJdk();
      assert sdk != null;
      final SdkType type = (SdkType) sdk.getSdkType();
      final String executablePath = ((JavaSdkType) type).getVMExecutablePath(sdk);

      final ArrayList<String> env = new ArrayList<String>();
      final ArrayList<String> cmd = new ArrayList<String>();
      cmd.add(executablePath);
View Full Code Here

  }

  @NotNull
  @Override
  protected ProcessHandler startProcess() throws ExecutionException {
    final Sdk sdk = RustSdkUtil.getSdk(project);
    if ( sdk == null ) {
      throw new CantRunException("No Rust sdk defined for this project");
    }

    final RustSdkData sdkData = (RustSdkData)sdk.getSdkAdditionalData();
    if ( sdkData == null ) {
      throw new CantRunException("No Rust sdk defined for this project");
    }

    String projectDir = project.getBasePath();
View Full Code Here

        return result;
  }

  public static Sdk getSdk(Project project) {
    Sdk sdk = ProjectRootManager.getInstance(project).getProjectSdk();

    if (sdk != null && sdk.getSdkType() == RustSdkType.getInstance()) {
      return sdk;
    }

    return null;
  }
View Full Code Here

  public void runCommand(Runnable command) {
    myRequestsProcessor.submit(command);
  }

  private OSProcessHandler launchBuildProcess(Project project, UUID sessionId, CompileScope scope) throws ExecutionException {
    final Sdk defaultSdk = ProjectRootManager.getInstance(project).getProjectSdk();
    if (defaultSdk == null) {
      throw new ExecutionException("No SDK configured for this project.");
    }
    if (!(defaultSdk.getSdkType() instanceof RustSdkType)) {
      throw new ExecutionException("This project doesn't have a Rust SDK configured.");
    }
    final GeneralCommandLine cmdLine = new GeneralCommandLine();

    final RunConfiguration runConfig = scope.getUserData(CompileStepBeforeRun.RUN_CONFIGURATION);
    if (runConfig == null) {
      throw new ExecutionException("'Run Configuration' not found. If you're trying to compile without running, that's not yet supported");
    }
    final RustConfiguration rustConfiguration = (RustConfiguration) runConfig;
    final CompilerModuleExtension compilerModuleExtension = CompilerModuleExtension.getInstance(rustConfiguration.getModules()[0]);
    if (compilerModuleExtension == null) {
      throw new ExecutionException("Cannot find compiler module extension from module");
    }

        final String outputPathUrl = CompilerPaths.getModuleOutputPath(rustConfiguration.getModules()[0], false);

    File outputPathFile = new File(outputPathUrl);
    if (!outputPathFile.exists()) {
      if (!outputPathFile.mkdirs()) {
        throw new ExecutionException("Cannot create output path '" + outputPathUrl + "'");
      }
    }

    cmdLine.setWorkDirectory(new File(project.getBasePath()));
    cmdLine.setExePath(RustSdkUtil.testRustSdk(defaultSdk.getHomePath()).pathRustc);
    cmdLine.addParameter(rustConfiguration.mainFile);
    cmdLine.addParameters("-o", outputPathUrl.concat("/").concat(rustConfiguration.getName()));

    final Process process = cmdLine.createProcess();
View Full Code Here

TOP

Related Classes of com.intellij.openapi.projectRoots.Sdk

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.