package com.twitter.intellij.pants.service.project.wizard;

import com.intellij.openapi.externalSystem.service.project.wizard.AbstractExternalProjectImportProvider;
import com.intellij.openapi.vfs.VirtualFile;
import com.twitter.intellij.pants.util.PantsConstants;
import com.twitter.intellij.pants.util.PantsUtil;
import org.jetbrains.annotations.Nullable;

public class PantsProjectImportProvider extends AbstractExternalProjectImportProvider {
  public PantsProjectImportProvider(PantsProjectImportBuilder builder) {
    super(builder, PantsConstants.SYSTEM_ID);
  }

  @Override
  protected boolean canImportFromFile(VirtualFile file) {
    return PantsUtil.isBUILDFileName(file.getName());
  }

  @Nullable
  @Override
  public String getFileSample() {
    return "<b>Pants</b> build file (BUILD.*)";
  }
}

@@ -53,16 +53,194 @@
 izard;%0A%0A
+import com.intellij.ide.util.projectWizard.ModuleWizardStep;%0Aimport com.intellij.ide.util.projectWizard.ProjectJdkStep;%0Aimport com.intellij.ide.util.projectWizard.WizardContext;%0A
 import c
@@ -381,16 +381,52 @@
 alFile;%0A
+import com.intellij.util.ArrayUtil;%0A
 import c
@@ -1016,11 +1016,179 @@
 *)%22;%0A  %7D
+%0A%0A  @Override%0A  public ModuleWizardStep%5B%5D createSteps(WizardContext context) %7B%0A    return ArrayUtil.append(super.createSteps(context), new ProjectJdkStep(context));%0A  %7D
 %0A%7D%0A

Configure JDK while importing a project