package com.intellij.jps.cache.hashing;

import java.io.File;
import java.nio.file.Paths;

class RelativeToDirectoryRelativizer implements PathRelativizer {
  private final String rootPath;

  RelativeToDirectoryRelativizer(String rootModulePath) {
    this.rootPath = rootModulePath;
  }

  @Override
  public String relativize(File target) {
    return Paths.get(rootPath).relativize(Paths.get(target.getPath())).toString();
  }
}


@@ -45,20 +45,96 @@
 ort 
-java.io.File
+com.intellij.openapi.util.io.FileUtilRt;%0A%0Aimport java.io.File;%0Aimport java.nio.file.Path
 ;%0Aim
@@ -242,22 +242,20 @@
 e final 
-String
+Path
  rootPat
@@ -336,16 +336,26 @@
 tPath = 
+Paths.get(
 rootModu
@@ -360,16 +360,17 @@
 dulePath
+)
 ;%0A  %7D%0A%0A 
@@ -433,25 +433,50 @@
  return 
-Paths.get
+FileUtilRt.toSystemIndependentName
 (rootPat
@@ -476,17 +476,16 @@
 rootPath
-)
 .relativ
@@ -527,16 +527,17 @@
 String()
+)
 ;%0A  %7D%0A%7D%0A

Make RelativeToDirectoryRelativizer platform independent