build scripts redesign: use system-independent paths for consistency

This commit is contained in:
nik
2016-07-12 10:53:01 +03:00
parent fedcae5510
commit 2ad53cd6a6
2 changed files with 13 additions and 6 deletions
@@ -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
@@ -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)
}
}