Package randoop.compile
Class FileCompiler
- java.lang.Object
-
- randoop.compile.FileCompiler
-
public class FileCompiler extends Object
Compiler for Java source code files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileCompiler.FileCompilerException
Exception for errors during compilation usingFileCompiler
.
-
Field Summary
Fields Modifier and Type Field Description private JavaCompiler
compiler
The compiler object.private List<String>
options
The command-line options for running this compiler.
-
Constructor Summary
Constructors Constructor Description FileCompiler()
Creates aFileCompiler
with no command-line options.FileCompiler(List<String> options)
Creates aFileCompiler
with the given command-line options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
compile(Path sourceFile, Path destinationDir)
Compile the given source file, writing resulting class files to the destination directory.void
compile(List<File> sourceFiles, Path destinationDir)
Compile the given source files, writing resulting class files to the destination directory.
-
-
-
Field Detail
-
compiler
private final JavaCompiler compiler
The compiler object.
-
-
Constructor Detail
-
FileCompiler
public FileCompiler()
Creates aFileCompiler
with no command-line options.
-
FileCompiler
public FileCompiler(List<String> options)
Creates aFileCompiler
with the given command-line options.- Parameters:
options
- the command-line arguments for theJavaCompiler
-
-
Method Detail
-
compile
public void compile(List<File> sourceFiles, Path destinationDir) throws FileCompiler.FileCompilerException
Compile the given source files, writing resulting class files to the destination directory.- Parameters:
sourceFiles
- the Java source filesdestinationDir
- the destination directory for class files- Throws:
FileCompiler.FileCompilerException
- if the compilation fails
-
compile
public void compile(Path sourceFile, Path destinationDir) throws FileCompiler.FileCompilerException
Compile the given source file, writing resulting class files to the destination directory.- Parameters:
sourceFile
- the Java source filedestinationDir
- the destination directory for class files- Throws:
FileCompiler.FileCompilerException
- if the compilation fails
-
-