diff --git a/jps/src/org/jetbrains/jps/PathUtil.groovy b/jps/src/org/jetbrains/jps/PathUtil.groovy new file mode 100644 index 000000000000..eb50aa913e18 --- /dev/null +++ b/jps/src/org/jetbrains/jps/PathUtil.groovy @@ -0,0 +1,10 @@ +package org.jetbrains.jps + +/** + * @author nik + */ +class PathUtil { + static String toSystemIndependentPath(String path) { + return path.replace('\\', '/') + } +} diff --git a/jps/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy b/jps/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy index e16eb5045491..085e735359a3 100644 --- a/jps/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy +++ b/jps/src/org/jetbrains/jps/idea/IdeaProjectLoader.groovy @@ -367,8 +367,8 @@ public class IdeaProjectLoader { if (projectOutputPath == null) { project.error("Module '$currentModuleName' uses output path inherited from project but project output path is not specified") } - currentModule.outputPath = new File(new File(projectOutputPath, "production"), currentModuleName).absolutePath - currentModule.testOutputPath = new File(new File(projectOutputPath, "test"), currentModuleName).absolutePath + currentModule.outputPath = PathUtil.toSystemIndependentPath(new File(new File(projectOutputPath, "production"), currentModuleName).absolutePath) + currentModule.testOutputPath = PathUtil.toSystemIndependentPath(new File(new File(projectOutputPath, "test"), currentModuleName).absolutePath) } else { currentModule.outputPath = moduleMacroExpander.expandMacros(IdeaProjectLoadingUtil.pathFromUrl(componentTag.output[0]?.@url)) diff --git a/jps/src/org/jetbrains/jps/idea/ProjectMacroExpander.groovy b/jps/src/org/jetbrains/jps/idea/ProjectMacroExpander.groovy index 380f79393468..5d8a68c9e524 100644 --- a/jps/src/org/jetbrains/jps/idea/ProjectMacroExpander.groovy +++ b/jps/src/org/jetbrains/jps/idea/ProjectMacroExpander.groovy @@ -1,6 +1,7 @@ package org.jetbrains.jps.idea import org.jetbrains.jps.MacroExpander +import org.jetbrains.jps.PathUtil /** * @author nik @@ -11,7 +12,7 @@ public class ProjectMacroExpander implements MacroExpander { ProjectMacroExpander(Map pathVariables, String projectBasePath) { this.pathVariables = pathVariables - this.projectBasePath = projectBasePath + this.projectBasePath = PathUtil.toSystemIndependentPath(projectBasePath) } @Override diff --git a/jps/testSrc/org/jetbrains/jps/AntPrePostStepsInArtifactsTest.groovy b/jps/testSrc/org/jetbrains/jps/AntPrePostStepsInArtifactsTest.groovy index 1fc24ca7a073..ccd3de3d740b 100644 --- a/jps/testSrc/org/jetbrains/jps/AntPrePostStepsInArtifactsTest.groovy +++ b/jps/testSrc/org/jetbrains/jps/AntPrePostStepsInArtifactsTest.groovy @@ -18,7 +18,7 @@ class AntPrePostStepsInArtifactsTest extends JpsBuildTestCase { file("file.txt") } file("prestep.txt", "pre1") - file("poststep.txt", "$outDir.absolutePath/artifacts/main") + file("poststep.txt", "${PathUtil.toSystemIndependentPath(outDir.absolutePath)}/artifacts/main") } } }