Top Description Inners Fields Constructors Methods
org.codehaus.groovy.tools

public Class FileSystemCompiler

extends Object
Class Inheritance
Imports
groovy.lang.GroovySystem, org.codehaus.groovy.control.CompilationUnit, .CompilerConfiguration, .ConfigurationException, org.codehaus.groovy.control.messages.WarningMessage, org.codehaus.groovy.runtime.DefaultGroovyStaticMethods, .StringGroovyMethods, org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit, picocli.CommandLine, .CommandLine.Command, .CommandLine.IVersionProvider, .CommandLine.Option, .CommandLine.Parameters, .CommandLine.ParseResult, java.io.BufferedReader, .File, .FileReader, .IOException, .PrintWriter, java.net.URL, java.util.ArrayList, .HashMap, .List, .Map

Command-line compiler (aka. groovyc).

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Field Summary

Modifier and TypeField and Description
private static boolean
private final CompilationUnit

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public static int
checkFiles(String[] filenames)

public static void
commandLineCompile(String[] args)

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

public 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

public static void
commandLineCompileWithErrorHandling(String[]
command line arguments
args
,
boolean
do a lookup for .groovy files not part of the given list of files to compile
lookupUnnamedFiles
)

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

public void
compile(String[] paths)

public void
compile(File[] files)

public static CommandLine
public static void
public static void
displayHelp()

Prints the usage help message for CompilationOptions to stderr.

public static void
displayHelp(PrintWriter writer)

Prints the usage help message for the CompilationOptions to the specified PrintWriter.

public static void
displayVersion()

Prints version information to stderr.

public static void
displayVersion(PrintWriter writer)

Prints version information to the specified PrintWriter.

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

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

private static String[]
public static void
main(String[]
command line arguments
args
)

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

public static boolean
validateFiles(String[] filenames)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

displayStackTraceOnErrorback to summary
private static boolean displayStackTraceOnError
unitback to summary
private final CompilationUnit unit

Constructor Detail

FileSystemCompilerback to summary
public FileSystemCompiler(CompilerConfiguration configuration) throws ConfigurationException
FileSystemCompilerback to summary
public FileSystemCompiler(CompilerConfiguration configuration, CompilationUnit cu) throws ConfigurationException

Method Detail

checkFilesback to summary
public static int checkFiles(String[] filenames)
commandLineCompileback to summary
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.

commandLineCompileback to summary
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

commandLineCompileWithErrorHandlingback to summary
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:String[]

command line arguments

lookupUnnamedFiles:boolean

do a lookup for .groovy files not part of the given list of files to compile

compileback to summary
public void compile(String[] paths) throws Exception
compileback to summary
public void compile(File[] files) throws Exception
configureParserback to summary
public static CommandLine configureParser(FileSystemCompiler.CompilationOptions options)
deleteRecursiveback to summary
public static void deleteRecursive(File file)
displayHelpback to summary
public static void displayHelp()

Prints the usage help message for CompilationOptions to stderr.

Since
2.5
See Also
displayHelp(PrintWriter)
displayHelpback to summary
public static void displayHelp(PrintWriter writer)

Prints the usage help message for the CompilationOptions to the specified PrintWriter.

Since
2.5
displayVersionback to summary
public static void displayVersion()

Prints version information to stderr.

See Also
displayVersion(PrintWriter)
displayVersionback to summary
public static void displayVersion(PrintWriter writer)

Prints version information to the specified PrintWriter.

Since
2.5
doCompilationback to summary
public static void doCompilation(CompilerConfiguration configuration, CompilationUnit unit, String[] filenames) throws Exception
doCompilationback to summary
public static void doCompilation(CompilerConfiguration configuration, CompilationUnit unit, String[] filenames, boolean lookupUnnamedFiles) throws Exception
generateFileNamesFromOptionsback to summary
private static String[] generateFileNamesFromOptions(List<String> filenames)
mainback to summary
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:String[]

command line arguments

validateFilesback to summary
public static boolean validateFiles(String[] filenames)
org.codehaus.groovy.tools back to summary

public Class FileSystemCompiler.CompilationOptions

extends Object
Class Inheritance
  • java.lang.Object
  • org.codehaus.groovy.tools.FileSystemCompiler.CompilationOptions
Annotations
@Command
name:groovyc
customSynopsis:groovyc [options]
sortOptions:false
versionProvider:VersionProvider

Since
2.5

Field Summary

Modifier and TypeField and Description
private String
private boolean
private String
private boolean
private String
private List<String>
private List<String>
private boolean
private boolean
private Map<String, String>
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private String
private File
private String
private File
private File
private int
private boolean
private boolean
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String[]
private String[]
private String[]
public CompilerConfiguration
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classpathback to summary
private String classpath
Annotations
@Option
names:-cp, -classpath, --classpath
paramLabel:
description:Specify where to find the class files - must be first argument
compileStaticback to summary
private boolean compileStatic
Annotations
@Option
names:--compile-static
description:Use CompileStatic
configScriptback to summary
private String configScript
Annotations
@Option
names:-cf, --configscript
paramLabel: