Search in sources :

Example 6 with ExpandMacroToPathMap

use of com.intellij.openapi.components.ExpandMacroToPathMap in project intellij-community by JetBrains.

the class ModuleRootsExternalizationTest method testExpandMacro2.

public void testExpandMacro2() {
    final ExpandMacroToPathMap map = new ExpandMacroToPathMap();
    map.addMacroExpand("MACRO", "forms_rt.jar!/");
    final String expanded = map.substitute("jar://C:/idea/lib/$MACRO$", false);
    assertEquals("jar://C:/idea/lib/forms_rt.jar!/", expanded);
}
Also used : ExpandMacroToPathMap(com.intellij.openapi.components.ExpandMacroToPathMap)

Example 7 with ExpandMacroToPathMap

use of com.intellij.openapi.components.ExpandMacroToPathMap in project intellij-community by JetBrains.

the class ModuleRootsExternalizationTest method testExpandMacroNoExpand.

public void testExpandMacroNoExpand() {
    final ExpandMacroToPathMap map = new ExpandMacroToPathMap();
    map.addMacroExpand("MACRO", "C:/idea");
    final String expanded = map.substitute("jar://C:/idea$/lib/forms_rt.jar!/", false);
    assertEquals("jar://C:/idea$/lib/forms_rt.jar!/", expanded);
}
Also used : ExpandMacroToPathMap(com.intellij.openapi.components.ExpandMacroToPathMap)

Example 8 with ExpandMacroToPathMap

use of com.intellij.openapi.components.ExpandMacroToPathMap in project intellij-community by JetBrains.

the class ModuleRootsExternalizationTest method testExpandMacroNoExpand2.

public void testExpandMacroNoExpand2() {
    final ExpandMacroToPathMap map = new ExpandMacroToPathMap();
    map.addMacroExpand("MACRO", "C:/idea");
    final String expanded = map.substitute("jar://C:/idea/lib/forms_rt.jar!/$", false);
    assertEquals("jar://C:/idea/lib/forms_rt.jar!/$", expanded);
}
Also used : ExpandMacroToPathMap(com.intellij.openapi.components.ExpandMacroToPathMap)

Example 9 with ExpandMacroToPathMap

use of com.intellij.openapi.components.ExpandMacroToPathMap in project intellij-community by JetBrains.

the class ConversionContextImpl method createExpandMacroMap.

private ExpandMacroToPathMap createExpandMacroMap(@Nullable ModuleSettingsImpl moduleSettings) {
    final ExpandMacroToPathMap map = createExpandMacroMap();
    if (moduleSettings != null) {
        final String modulePath = FileUtil.toSystemIndependentName(moduleSettings.getModuleFile().getParentFile().getAbsolutePath());
        map.addMacroExpand(PathMacroUtil.MODULE_DIR_MACRO_NAME, modulePath);
    }
    return map;
}
Also used : ExpandMacroToPathMap(com.intellij.openapi.components.ExpandMacroToPathMap)

Example 10 with ExpandMacroToPathMap

use of com.intellij.openapi.components.ExpandMacroToPathMap in project intellij-community by JetBrains.

the class ConversionContextImpl method createExpandMacroMap.

private ExpandMacroToPathMap createExpandMacroMap() {
    final ExpandMacroToPathMap macros = new ExpandMacroToPathMap();
    final String projectDir = FileUtil.toSystemIndependentName(myProjectBaseDir.getAbsolutePath());
    macros.addMacroExpand(PathMacroUtil.PROJECT_DIR_MACRO_NAME, projectDir);
    PathMacrosImpl.getInstanceEx().addMacroExpands(macros);
    return macros;
}
Also used : ExpandMacroToPathMap(com.intellij.openapi.components.ExpandMacroToPathMap)

Aggregations

ExpandMacroToPathMap (com.intellij.openapi.components.ExpandMacroToPathMap)16 Element (org.jdom.Element)4 NotNull (org.jetbrains.annotations.NotNull)4 File (java.io.File)3 ReplacePathToMacroMap (com.intellij.application.options.ReplacePathToMacroMap)1 Logger (com.intellij.openapi.diagnostic.Logger)1 SystemInfo (com.intellij.openapi.util.SystemInfo)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 HashSet (com.intellij.util.containers.HashSet)1 FilenameFilter (java.io.FilenameFilter)1 IOException (java.io.IOException)1 java.util (java.util)1 Map (java.util.Map)1 TimeoutException (java.util.concurrent.TimeoutException)1 Nullable (org.jetbrains.annotations.Nullable)1 org.jetbrains.idea.eclipse (org.jetbrains.idea.eclipse)1 JpsElementFactory (org.jetbrains.jps.model.JpsElementFactory)1 org.jetbrains.jps.model.java (org.jetbrains.jps.model.java)1 JpsLibrary (org.jetbrains.jps.model.library.JpsLibrary)1 JpsLibraryReference (org.jetbrains.jps.model.library.JpsLibraryReference)1