use of com.intellij.lang.ant.config.impl.AntBuildFileImpl in project intellij-community by JetBrains.
the class AntDomProject method getClassLoader.
@NotNull
public final ClassLoader getClassLoader() {
ClassLoader loader = myClassLoader;
if (loader == null) {
final XmlTag tag = getXmlTag();
final PsiFile containingFile = tag.getContainingFile();
final AntBuildFileImpl buildFile = (AntBuildFileImpl) AntConfigurationBase.getInstance(containingFile.getProject()).getAntBuildFile(containingFile);
if (buildFile != null) {
loader = buildFile.getClassLoader();
} else {
AntInstallation antInstallation = getAntInstallation();
loader = antInstallation.getClassLoader();
}
myClassLoader = loader;
}
return loader;
}
use of com.intellij.lang.ant.config.impl.AntBuildFileImpl in project intellij-community by JetBrains.
the class AntDomProject method getProperties.
private Map<String, String> getProperties() {
Map<String, String> properties = myProperties;
if (properties == null) {
final ReflectedProject reflected = ReflectedProject.getProject(getClassLoader());
Map<String, String> externals = Collections.emptyMap();
final PsiFile containingFile = getXmlTag().getContainingFile();
if (containingFile != null) {
final AntBuildFileImpl buildFile = (AntBuildFileImpl) AntConfigurationBase.getInstance(containingFile.getProject()).getAntBuildFile(containingFile);
if (buildFile != null) {
externals = buildFile.getExternalProperties();
}
}
myProperties = (properties = loadPredefinedProperties(reflected.getProperties(), externals));
}
return properties;
}
use of com.intellij.lang.ant.config.impl.AntBuildFileImpl in project intellij-community by JetBrains.
the class AntDomProject method getTargetJdk.
@Nullable
public final Sdk getTargetJdk() {
final XmlTag tag = getXmlTag();
final PsiFile containingFile = tag.getContainingFile();
final AntBuildFileImpl buildFile = (AntBuildFileImpl) AntConfigurationBase.getInstance(containingFile.getProject()).getAntBuildFile(containingFile);
if (buildFile != null) {
String jdkName = AntBuildFileImpl.CUSTOM_JDK_NAME.get(buildFile.getAllOptions());
if (StringUtil.isEmptyOrSpaces(jdkName)) {
jdkName = AntConfigurationImpl.DEFAULT_JDK_NAME.get(buildFile.getAllOptions());
}
if (!StringUtil.isEmptyOrSpaces(jdkName)) {
return ProjectJdkTable.getInstance().findJdk(jdkName);
}
}
return ProjectRootManager.getInstance(tag.getProject()).getProjectSdk();
}
Aggregations