org.codehaus.groovy.tools

## Class FileSystemCompiler

- java.lang.Object
- - org.codehaus.groovy.tools.FileSystemCompiler

-     public class FileSystemCompiler
      extends Object

  Command-line compiler (aka. `groovyc`).

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FileSystemCompiler.CompilationOptions`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileSystemCompiler(CompilerConfiguration configuration)`
    `FileSystemCompiler(CompilerConfiguration configuration, CompilationUnit cu)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `checkFiles(String[] filenames)`
    `static void` | `commandLineCompile(String[] args)` Same as main(args) except that exceptions are thrown out instead of causing the VM to exit.
    `static void` | `commandLineCompile(String[] args, boolean lookupUnnamedFiles)` Same as main(args) except that exceptions are thrown out instead of causing the VM to exit and the lookup for .groovy files can be controlled
    `static void` | `commandLineCompileWithErrorHandling(String[] args, boolean lookupUnnamedFiles)` Primary entry point for compiling from the command line (using the groovyc script).
    `void` | `compile(File[] files)`
    `void` | `compile(String[] paths)`
    `static picocli.CommandLine` | `configureParser(FileSystemCompiler.CompilationOptions options)`
    `static Options` | `createCompilationOptions()` Deprecated.
    `static File` | `createTempDir()` Deprecated. Use `DefaultGroovyStaticMethods.createTempDir(java.io.File, String, String)` instead.
    `static void` | `deleteRecursive(File file)`
    `static void` | `displayHelp()` Prints the usage help message for `FileSystemCompiler.CompilationOptions` to stderr.
    `static void` | `displayHelp(Options options)` Deprecated. use `displayHelp(PrintWriter)` instead
    `static void` | `displayHelp(PrintWriter writer)` Prints the usage help message for the `FileSystemCompiler.CompilationOptions` to the specified PrintWriter.
    `static void` | `displayVersion()` Prints version information to stderr.
    `static void` | `displayVersion(PrintWriter writer)` Prints version information to the specified PrintWriter.
    `static void` | `doCompilation(CompilerConfiguration configuration, CompilationUnit unit, String[] filenames)`
    `static void` | `doCompilation(CompilerConfiguration configuration, CompilationUnit unit, String[] filenames, boolean lookupUnnamedFiles)`
    `static CompilerConfiguration` | `generateCompilerConfigurationFromOptions(CommandLine cli)` Deprecated.
    `static String[]` | `generateFileNamesFromOptions(CommandLine cli)` Deprecated.
    `static void` | `main(String[] args)` Primary entry point for compiling from the command line (using the groovyc script).
    `static boolean` | `validateFiles(String[] filenames)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FileSystemCompiler

          public FileSystemCompiler(CompilerConfiguration configuration)
                             throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### FileSystemCompiler

          public FileSystemCompiler(CompilerConfiguration configuration,
                                    CompilationUnit cu)
                             throws ConfigurationException

      Throws:
        `ConfigurationException`

  - ### Method Detail

    - #### displayHelp

          public static void displayHelp()

      Prints the usage help message for `FileSystemCompiler.CompilationOptions` to stderr.
      Since:
        2.5
      See Also:
        `displayHelp(PrintWriter)`

    - #### displayHelp

          public static void displayHelp(PrintWriter writer)

      Prints the usage help message for the `FileSystemCompiler.CompilationOptions` to the specified PrintWriter.
      Since:
        2.5

    - #### displayVersion

          public static void displayVersion()

      Prints version information to stderr.
      See Also:
        `displayVersion(PrintWriter)`

    - #### displayVersion

          public static void displayVersion(PrintWriter writer)

      Prints version information to the specified PrintWriter.
      Since:
        2.5

    - #### checkFiles

          public static int checkFiles(String[] filenames)

    - #### validateFiles

          public static boolean validateFiles(String[] filenames)

    - #### commandLineCompile

          public static void commandLineCompile(String[] args)
                                         throws Exception

      Same as main(args) except that exceptions are thrown out instead of causing the VM to exit.
      Throws:
        `Exception`

    - #### commandLineCompile

          public static void commandLineCompile(String[] args,
                                                boolean lookupUnnamedFiles)
                                         throws Exception

      Same as main(args) except that exceptions are thrown out instead of causing the VM to exit and the lookup for .groovy files can be controlled
      Throws:
        `Exception`

    - #### configureParser

          public static picocli.CommandLine configureParser(FileSystemCompiler.CompilationOptions options)

    - #### main

          public static void main(String[] args)

      Primary entry point for compiling from the command line (using the groovyc script).

      If calling inside a process and you don't want the JVM to exit on an error call commandLineCompile(String[]), which this method simply wraps

      Parameters:
        `args` - command line arguments

    - #### commandLineCompileWithErrorHandling

          public static void commandLineCompileWithErrorHandling(String[] args,
                                                                 boolean lookupUnnamedFiles)

      Primary entry point for compiling from the command line (using the groovyc script).

      If calling inside a process and you don't want the JVM to exit on an error call commandLineCompile(String[]), which this method simply wraps

      Parameters:
        `args` - command line arguments
        `lookupUnnamedFiles` - do a lookup for .groovy files not part of the given list of files to compile

    - #### doCompilation

          public static void doCompilation(CompilerConfiguration configuration,
                                           CompilationUnit unit,
                                           String[] filenames)
                                    throws Exception

      Throws:
        `Exception`

    - #### doCompilation

          public static void doCompilation(CompilerConfiguration configuration,
                                           CompilationUnit unit,
                                           String[] filenames,
                                           boolean lookupUnnamedFiles)
                                    throws Exception

      Throws:
        `Exception`

    - #### deleteRecursive

          public static void deleteRecursive(File file)

    - #### compile

          public void compile(String[] paths)
                       throws Exception

      Throws:
        `Exception`

    - #### compile

          public void compile(File[] files)
                       throws Exception

      Throws:
        `Exception`

    - #### displayHelp

          @Deprecated
          public static void displayHelp(Options options)

      Deprecated. use `displayHelp(PrintWriter)` instead

    - #### generateCompilerConfigurationFromOptions

          @Deprecated
          public static CompilerConfiguration generateCompilerConfigurationFromOptions(CommandLine cli)

      Deprecated.

    - #### generateFileNamesFromOptions

          @Deprecated
          public static String[] generateFileNamesFromOptions(CommandLine cli)

      Deprecated.

    - #### createCompilationOptions

          @Deprecated
          public static Options createCompilationOptions()

      Deprecated.

    - #### createTempDir

          @Deprecated
          public static File createTempDir()
                                                 throws IOException

      Deprecated. Use `DefaultGroovyStaticMethods.createTempDir(java.io.File, String, String)` instead.
      Creates a temporary directory in the default temporary directory (as specified by the system property java.io.tmpdir.
      Throws:
        `IOException`