From 2ad53cd6a6f0ba2f0453ca61ad2b6df8dd1718c8 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 7 Jul 2016 21:18:42 +0300 Subject: [PATCH] build scripts redesign: use system-independent paths for consistency --- .../jetbrains/intellij/build/BuildContext.groovy | 3 +++ .../intellij/build/impl/BuildContextImpl.groovy | 16 ++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/build/groovy/org/jetbrains/intellij/build/BuildContext.groovy b/build/groovy/org/jetbrains/intellij/build/BuildContext.groovy index 9e0bdb540a4d..1ee57ba15df5 100644 --- a/build/groovy/org/jetbrains/intellij/build/BuildContext.groovy +++ b/build/groovy/org/jetbrains/intellij/build/BuildContext.groovy @@ -83,6 +83,9 @@ abstract class BuildContext { } } +/** + * All paths are absolute and use '/' as a separator + */ abstract class BuildPaths { /** * Path to a directory where idea/community Git repository is checked out diff --git a/build/groovy/org/jetbrains/intellij/build/impl/BuildContextImpl.groovy b/build/groovy/org/jetbrains/intellij/build/impl/BuildContextImpl.groovy index ec92f520d85a..a9a531ea338c 100644 --- a/build/groovy/org/jetbrains/intellij/build/impl/BuildContextImpl.groovy +++ b/build/groovy/org/jetbrains/intellij/build/impl/BuildContextImpl.groovy @@ -214,12 +214,16 @@ class BuildContextImpl extends BuildContext { class BuildPathsImpl extends BuildPaths { BuildPathsImpl(String communityHome, String projectHome, String buildOutputRoot, String jdkHome) { - this.communityHome = new File(communityHome).canonicalPath - this.projectHome = new File(projectHome).canonicalPath - this.buildOutputRoot = new File(buildOutputRoot).canonicalPath - this.jdkHome = new File(jdkHome).canonicalPath + this.communityHome = toCanonicalPath(communityHome) + this.projectHome = toCanonicalPath(projectHome) + this.buildOutputRoot = toCanonicalPath(buildOutputRoot) + this.jdkHome = toCanonicalPath(jdkHome) artifacts = "${this.buildOutputRoot}/artifacts" - distAll = "$buildOutputRoot/dist.all" - temp = "$buildOutputRoot/temp" + distAll = "${this.buildOutputRoot}/dist.all" + temp = "${this.buildOutputRoot}/temp" + } + + private static String toCanonicalPath(String communityHome) { + FileUtil.toSystemIndependentName(new File(communityHome).canonicalPath) } }