Class DebugPathSanitizer

    • Constructor Detail

      • DebugPathSanitizer

        public DebugPathSanitizer​(boolean useUnixPathSeparator)
        Parameters:
        useUnixPathSeparator - use unix path separator in paths.
      • DebugPathSanitizer

        public DebugPathSanitizer()
    • Method Detail

      • getPaddedDir

        public static String getPaddedDir​(String path,
                                          int size,
                                          char pad)
        Returns:
        the given path as a string, expanded using separator to fulfill the required pathSize.
      • getCompilationEnvironment

        public abstract com.google.common.collect.ImmutableMap<String,​String> getCompilationEnvironment​(Path workingDir,
                                                                                                              boolean shouldSanitize)
      • getCompilationFlags

        public com.google.common.collect.ImmutableList<String> getCompilationFlags​(Compiler compiler,
                                                                                   Path workingDir,
                                                                                   com.google.common.collect.ImmutableMap<Path,​Path> prefixMap)
      • getCompilationDirectory

        public abstract String getCompilationDirectory()
      • sanitizer

        public java.util.function.Function<String,​String> sanitizer​(Optional<Path> workingDir)
        Return a Function to perform sanitization of string. Applying this function to a string will return a version of it with paths replaced by their sanitized version.

        When sanitizing multiple values, it is much more efficient to get the sanitizer once and sanitize multiple values with it.

      • sanitizeFlags

        public com.google.common.collect.ImmutableList<String> sanitizeFlags​(Iterable<String> flags)
        Sanitizes a list of flags.
      • restoreCompilationDirectory

        public abstract void restoreCompilationDirectory​(Path path,
                                                         Path workingDir)