Skip to content

Commit

Permalink
Use the Util to get the SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
opticyclic committed May 4, 2014
1 parent 8038bef commit 9c7cfe9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/com/handyedit/ant/run/AntRunConfigurationProducer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.handyedit.ant.run;

import com.handyedit.ant.util.AntUtil;
import com.handyedit.ant.util.IdeaConfigUtil;
import com.intellij.execution.Location;
import com.intellij.execution.actions.ConfigurationContext;
import com.intellij.execution.actions.ConfigurationFromContext;
Expand All @@ -23,15 +24,12 @@ protected boolean setupConfigurationFromContext(AntRunConfiguration configuratio
Location location = context.getLocation();
PsiElement psiLocation = context.getPsiLocation();

AntDomElement antDomElement = (AntDomElement) AntDomReferenceBase.toDomElement(psiLocation);
AntDomProject antDomProject = antDomElement.getAntProject();

String target = AntUtil.getTarget(psiLocation);

configuration.setName(target);
configuration.setTargetName(target);
configuration.setBuildFile(location.getVirtualFile());
Sdk targetJdk = antDomProject.getTargetJdk();
Sdk targetJdk = IdeaConfigUtil.getJdk(location.getModule(), location.getProject());
if (targetJdk != null) {
configuration.setJdkName(targetJdk.getName());
}
Expand Down

0 comments on commit 9c7cfe9

Please sign in to comment.