Package org.antlr.mojo.antlr4
Class MojoUtils
- java.lang.Object
-
- org.antlr.mojo.antlr4.MojoUtils
-
class MojoUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MojoUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
checksum(java.io.File file)
Creates the MD5 checksum for the given file.static java.lang.String
findSourceSubdir(java.io.File sourceDirectory, java.io.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 thesourceDirectory
.
-
-
-
Method Detail
-
checksum
public static byte[] checksum(java.io.File file) throws java.io.IOException
Creates the MD5 checksum for the given file.- Parameters:
file
- the file.- Returns:
- the checksum.
- Throws:
java.io.IOException
-
findSourceSubdir
public static java.lang.String findSourceSubdir(java.io.File sourceDirectory, java.io.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 thesourceDirectory
. 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 directoryFile
objectgrammarFileName
- The full path to the input grammar file- Returns:
- The path to the grammar file relative to the source directory
-
-