diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/api/CompilerAPIConfiguration.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/api/CompilerAPIConfiguration.java index 4f7181776757..0784a676700e 100755 --- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/api/CompilerAPIConfiguration.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/api/CompilerAPIConfiguration.java @@ -20,6 +20,7 @@ import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.components.StoragePathMacros; import com.intellij.openapi.components.StorageScheme; +import com.intellij.openapi.project.Project; @State( name = "CompilerAPISettings", @@ -29,4 +30,7 @@ import com.intellij.openapi.components.StorageScheme; } ) public class CompilerAPIConfiguration extends JavacConfiguration { + public CompilerAPIConfiguration(Project project) { + super(project); + } } \ No newline at end of file diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacConfiguration.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacConfiguration.java index e36054c56392..8777add6bb67 100755 --- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacConfiguration.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/javac/JavacConfiguration.java @@ -30,10 +30,18 @@ import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions; ) public class JavacConfiguration implements PersistentStateComponent { private final JpsJavaCompilerOptions mySettings = new JpsJavaCompilerOptions(); + private final Project myProject; + + public JavacConfiguration(Project project) { + myProject = project; + } @NotNull public JpsJavaCompilerOptions getState() { - return mySettings; + JpsJavaCompilerOptions state = new JpsJavaCompilerOptions(); + XmlSerializerUtil.copyBean(mySettings, state); + state.ADDITIONAL_OPTIONS_STRING = PathMacroManager.getInstance(myProject).collapsePathsRecursively(state.ADDITIONAL_OPTIONS_STRING); + return state; } public void loadState(JpsJavaCompilerOptions state) { @@ -41,6 +49,6 @@ public class JavacConfiguration implements PersistentStateComponent aClass) { - return ServiceManager.getService(project, aClass).getState(); + return ServiceManager.getService(project, aClass).mySettings; } } \ No newline at end of file diff --git a/platform/projectModel-impl/src/com/intellij/openapi/components/PathMacroManager.java b/platform/projectModel-impl/src/com/intellij/openapi/components/PathMacroManager.java index b3f66965ab38..33f7312611b6 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/components/PathMacroManager.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/components/PathMacroManager.java @@ -31,5 +31,7 @@ public abstract class PathMacroManager implements PathMacroSubstitutor { public abstract void collapsePathsRecursively(Element element); + public abstract String collapsePathsRecursively(String text); + public abstract TrackingPathMacroSubstitutor createTrackingSubstitutor(); } diff --git a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java index 449a49523f8d..5a52773ba4c4 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/components/impl/BasePathMacroManager.java @@ -110,6 +110,11 @@ public class BasePathMacroManager extends PathMacroManager { getReplacePathMap().substitute(element, SystemInfo.isFileSystemCaseSensitive, true); } + @Override + public String collapsePathsRecursively(final String text) { + return getReplacePathMap().substituteRecursively(text, SystemInfo.isFileSystemCaseSensitive); + } + public void expandPaths(final Element element) { getExpandMacroMap().substitute(element, SystemInfo.isFileSystemCaseSensitive); }