Class MojoUtils

java.lang.Object
org.antlr.mojo.antlr4.MojoUtils

class MojoUtils extends Object
  • Constructor Details

    • MojoUtils

      MojoUtils()
  • Method Details

    • checksum

      public static byte[] checksum(File file) throws IOException
      Creates the MD5 checksum for the given file.
      Parameters:
      file - the file.
      Returns:
      the checksum.
      Throws:
      IOException
    • findSourceSubdir

      public static String findSourceSubdir(File sourceDirectory, File grammarFile)
      Given the source directory File object and the full PATH to a grammar, produce the path to the named grammar file in relative terms to the sourceDirectory. This will then allow ANTLR to produce output relative to the base of the output directory and reflect the input organization of the grammar files.
      Parameters:
      sourceDirectory - The source directory File object
      grammarFile - The full path to the input grammar file
      Returns:
      The path to the grammar file relative to the source directory