Package vektah.rust.ide.runner

Examples of vektah.rust.ide.runner.RustConfiguration


    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();

    return new OSProcessHandler(process, null, mySystemCharset) {
      @Override
View Full Code Here

TOP

Related Classes of vektah.rust.ide.runner.RustConfiguration

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.