Generate Lexer Task
A Gradle task for generating a lexer using JFlex for the IntelliJ Platform. This task takes a Flex definition file as an input, generates the lexer, and saves it in the specified output directory. It also optionally purges old files and allows specifying a custom skeleton file.
Properties
The name of the package where the lexer shall be created. By default, the task tries to detect the package from the content of sourceFile. You may set the value to the empty string (""), if no subdirectory shall be created. The empty string represents the unnamed package.
The location of the generated lexer class, relative to targetRootOutputDir. When targetOutputDir is used, this path is resolved relative to targetOutputDir instead. Stale files are purged only from this path.
Purge the generated lexer class before generating the lexer. Purging requires pathToClass to be set, so that only the generated file is removed.
An optional path to the skeleton file to use for the generated lexer. The path will be provided as --skel option. By default, it uses the idea-flex.skeleton skeleton file.
Required. The source Flex file to generate the lexer from.
The output directory for the generated lexer. The Java file is created directly below the given directory. The value of packageName is ignored. Stale files in the given directory are not deleted during task execution, unless purgeOldFiles is explicitly set to true.
The output root directory for the generated lexer. The Java file for the lexer is created in a subdirectory matching the packageName.
Functions
The location of the lexer class computed from the targetOutputDir. Because the lexer class is defined in the flex file, it needs to be passed here too.