Search in sources :

Example 11 with JpsDummyElement

use of org.jetbrains.jps.model.JpsDummyElement in project intellij-elixir by KronicDeth.

the class ElixirBuilder method doBuildWithMix.

private static void doBuildWithMix(ElixirTarget target, CompileContext context, JpsModule module, ElixirCompilerOptions compilerOptions) throws ProjectBuildException, IOException {
    String mixPath = getMixExecutablePath(module.getProject());
    if (mixPath == null) {
        String errorMessage = "Mix path is not set.";
        context.processMessage(new CompilerMessage(MIX_NAME, BuildMessage.Kind.ERROR, errorMessage));
        throw new ProjectBuildException(errorMessage);
    }
    JpsSdk<JpsDummyElement> sdk = ElixirTargetBuilderUtil.getSdk(context, module);
    String elixirPath = JpsElixirSdkType.getScriptInterpreterExecutable(sdk.getHomePath()).getAbsolutePath();
    for (String contentRootUrl : module.getContentRootsList().getUrls()) {
        String contentRootPath = new URL(contentRootUrl).getPath();
        File contentRootDir = new File(contentRootPath);
        File mixConfigFile = new File(contentRootDir, MIX_CONFIG_FILE_NAME);
        if (!mixConfigFile.exists())
            continue;
        runMix(target, elixirPath, mixPath, contentRootPath, compilerOptions, context);
    }
}
Also used : ProjectBuildException(org.jetbrains.jps.incremental.ProjectBuildException) CompilerMessage(org.jetbrains.jps.incremental.messages.CompilerMessage) JpsDummyElement(org.jetbrains.jps.model.JpsDummyElement) File(java.io.File) URL(java.net.URL)

Aggregations

JpsDummyElement (org.jetbrains.jps.model.JpsDummyElement)11 File (java.io.File)7 NotNull (org.jetbrains.annotations.NotNull)4 CompilerMessage (org.jetbrains.jps.incremental.messages.CompilerMessage)4 JpsModule (org.jetbrains.jps.model.module.JpsModule)4 ProjectBuildException (org.jetbrains.jps.incremental.ProjectBuildException)3 ProgressMessage (org.jetbrains.jps.incremental.messages.ProgressMessage)3 InstrumentationClassFinder (com.intellij.compiler.instrumentation.InstrumentationClassFinder)2 THashSet (gnu.trove.THashSet)2 IOException (java.io.IOException)2 ProjectBuilderLogger (org.jetbrains.jps.builders.logging.ProjectBuilderLogger)2 JpsProject (org.jetbrains.jps.model.JpsProject)2 EnhancerRunner (com.intellij.appengine.rt.EnhancerRunner)1 ApplicationStarter (com.intellij.openapi.application.ApplicationStarter)1 PathManager (com.intellij.openapi.application.PathManager)1 Logger (com.intellij.openapi.diagnostic.Logger)1 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 ProgressManager (com.intellij.openapi.progress.ProgressManager)1 com.intellij.openapi.projectRoots (com.intellij.openapi.projectRoots)1