// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.gradle.execution.build.output;

import com.intellij.build.output.BuildOutputParser;
import com.intellij.build.output.JavacOutputParser;
import com.intellij.build.output.KotlincOutputParser;
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTask;
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType;
import com.intellij.openapi.externalSystem.service.execution.ExternalSystemOutputParserProvider;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.plugins.gradle.util.GradleConstants;

import java.util.Collections;
import java.util.List;

/**
 * @author Vladislav.Soroka
 */
public class GradleJavaOutputParserProvider implements ExternalSystemOutputParserProvider {
  @Override
  public ProjectSystemId getExternalSystemId() {
    return GradleConstants.SYSTEM_ID;
  }

  @Override
  public List<BuildOutputParser> getBuildOutputParsers(ExternalSystemTask task) {
    if (task.getId().getType().equals(ExternalSystemTaskType.EXECUTE_TASK)) {
      return ContainerUtil.list(new JavacOutputParser(), new KotlincOutputParser());
    }
    else {
      return Collections.emptyList();
    }
  }
}

@@ -498,86 +498,8 @@
 sk;%0A
-import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskType;%0A
 impo
@@ -587,24 +587,24 @@
 erProvider;%0A
+
 import com.i
@@ -705,38 +705,8 @@
 s;%0A%0A
-import java.util.Collections;%0A
 impo
@@ -1059,84 +1059,117 @@
     
-if (task.getId().getType().equals(ExternalSystemTaskType.EXECUTE_TASK)) %7B%0A  
+// use javac, kotlinc output parsers for the sync to handle the compilation output of the 'buildSrc' sources%0A
     
@@ -1251,69 +1251,8 @@
 ));%0A
-    %7D%0A    else %7B%0A      return Collections.emptyList();%0A    %7D%0A
   %7D%0A

use javac, kotlinc output parsers for the sync to handle the compilation output of the 'buildSrc' sources