private int getDependenciesFingerprint(@Nullable StringBuilder logBuilder, @NotNull PathRelativizerService relativizer) {
    int fingerprint = 0;

    if (!REBUILD_ON_DEPENDENCY_CHANGE) {
      return fingerprint;
    }

    final JpsModule module = getModule();
    JpsJavaDependenciesEnumerator enumerator = JpsJavaExtensionService.dependencies(module).compileOnly().recursivelyExportedOnly();
    if (!isTests()) {
      enumerator = enumerator.productionOnly();
    }
    if (ProjectStamps.PORTABLE_CACHES) {
      enumerator = enumerator.withoutSdk();
    }

    for (File file : enumerator.classes().getRoots()) {
      String path = relativizer.toRelative(file.getAbsolutePath());

      int contentHash = getContentHash(file);
      if (logBuilder != null) {
        logBuilder.append(path);
        if (contentHash != 0) {
          logBuilder.append(": ").append(contentHash);
        }
        logBuilder.append("\n");
      }
      fingerprint = 31 * fingerprint + pathHashCode(path) + contentHash;
    }
    return fingerprint;
  }
private int getDependenciesFingerprint(@Nullable StringBuilder logBuilder, @NotNull PathRelativizerService relativizer)