use of com.intellij.ide.macro.MacroManager in project intellij-community by JetBrains.
the class AntBuildFileImpl method getExternalProperties.
@NotNull
public Map<String, String> getExternalProperties() {
Map<String, String> result = myCachedExternalProperties;
if (result == null) {
synchronized (myOptionsLock) {
result = myCachedExternalProperties;
if (result == null) {
result = new HashMap<>();
final DataContext context = SimpleDataContext.getProjectContext(myProject);
final MacroManager macroManager = MacroManager.getInstance();
Iterator<BuildFileProperty> properties = ANT_PROPERTIES.getIterator(myAllOptions);
while (properties.hasNext()) {
BuildFileProperty property = properties.next();
try {
String value = property.getPropertyValue();
value = macroManager.expandSilentMarcos(value, true, context);
value = macroManager.expandSilentMarcos(value, false, context);
result.put(property.getPropertyName(), value);
} catch (Macro.ExecutionCancelledException e) {
LOG.debug(e);
}
}
myCachedExternalProperties = result;
}
}
}
return result;
}
use of com.intellij.ide.macro.MacroManager in project intellij-community by JetBrains.
the class AntCommandLineBuilder method expandProperty.
private void expandProperty(DataContext dataContext, Project project, BuildFileProperty property) throws Macro.ExecutionCancelledException {
String value = property.getPropertyValue();
final MacroManager macroManager = GlobalAntConfiguration.getMacroManager();
value = macroManager.expandMacrosInString(value, true, dataContext);
value = macroManager.expandMacrosInString(value, false, dataContext);
value = PathMacroManager.getInstance(project).expandPath(value);
myExpandedProperties.add("-D" + property.getPropertyName() + "=" + value);
}
Aggregations