Search in sources :

Example 6 with JpsJavaExtensionService

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

the class ElixirBuilder method getBuildOutputDirectory.

/*** doBuildWithElixirc releated private methods */
@NotNull
private static File getBuildOutputDirectory(@NotNull JpsModule module, boolean forTests, @NotNull CompileContext context) throws ProjectBuildException {
    JpsJavaExtensionService instance = JpsJavaExtensionService.getInstance();
    File outputDirectory = instance.getOutputDirectory(module, forTests);
    if (outputDirectory == null) {
        String errorMessage = "No output directory for module " + module.getName();
        context.processMessage(new CompilerMessage(ElIXIRC_NAME, BuildMessage.Kind.ERROR, errorMessage));
        throw new ProjectBuildException(errorMessage);
    }
    if (!outputDirectory.exists()) {
        FileUtil.createDirectory(outputDirectory);
    }
    return outputDirectory;
}
Also used : ProjectBuildException(org.jetbrains.jps.incremental.ProjectBuildException) JpsJavaExtensionService(org.jetbrains.jps.model.java.JpsJavaExtensionService) CompilerMessage(org.jetbrains.jps.incremental.messages.CompilerMessage) File(java.io.File) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

JpsJavaExtensionService (org.jetbrains.jps.model.java.JpsJavaExtensionService)6 File (java.io.File)4 NotNull (org.jetbrains.annotations.NotNull)4 CompilerMessage (org.jetbrains.jps.incremental.messages.CompilerMessage)4 JpsModule (org.jetbrains.jps.model.module.JpsModule)3 IOException (java.io.IOException)2 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 JavaDependentSdkType (com.intellij.openapi.projectRoots.impl.JavaDependentSdkType)1 AnnotationOrderRootType (com.intellij.openapi.roots.AnnotationOrderRootType)1 JavadocOrderRootType (com.intellij.openapi.roots.JavadocOrderRootType)1 OrderRootType (com.intellij.openapi.roots.OrderRootType)1 Messages (com.intellij.openapi.ui.Messages)1 InvalidDataException (com.intellij.openapi.util.InvalidDataException)1 SystemInfo (com.intellij.openapi.util.SystemInfo)1