Class FileSystemCompiler


  • public class FileSystemCompiler
    extends java.lang.Object
    Command-line compiler (aka. groovyc).
    • Method Detail

      • displayHelp

        public static void displayHelp​(java.io.PrintWriter writer)
        Prints the usage help message for the FileSystemCompiler.CompilationOptions to the specified PrintWriter.
        Since:
        2.5
      • displayVersion

        public static void displayVersion​(java.io.PrintWriter writer)
        Prints version information to the specified PrintWriter.
        Since:
        2.5
      • checkFiles

        public static int checkFiles​(java.lang.String[] filenames)
      • validateFiles

        public static boolean validateFiles​(java.lang.String[] filenames)
      • commandLineCompile

        public static void commandLineCompile​(java.lang.String[] args)
                                       throws java.lang.Exception
        Same as main(args) except that exceptions are thrown out instead of causing the VM to exit.
        Throws:
        java.lang.Exception
      • commandLineCompile

        public static void commandLineCompile​(java.lang.String[] args,
                                              boolean lookupUnnamedFiles)
                                       throws java.lang.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:
        java.lang.Exception
      • main

        public static void main​(java.lang.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​(java.lang.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,
                                         java.lang.String[] filenames)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • doCompilation

        public static void doCompilation​(CompilerConfiguration configuration,
                                         CompilationUnit unit,
                                         java.lang.String[] filenames,
                                         boolean lookupUnnamedFiles)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • deleteRecursive

        public static void deleteRecursive​(java.io.File file)
      • compile

        public void compile​(java.lang.String[] paths)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • compile

        public void compile​(java.io.File[] files)
                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • generateCompilerConfigurationFromOptions

        @Deprecated
        public static CompilerConfiguration generateCompilerConfigurationFromOptions​(CommandLine cli)
        Deprecated.
      • generateFileNamesFromOptions

        @Deprecated
        public static java.lang.String[] generateFileNamesFromOptions​(CommandLine cli)
        Deprecated.
      • createCompilationOptions

        @Deprecated
        public static Options createCompilationOptions()
        Deprecated.