Class Compilation
java.lang.Object
com.google.testing.compile.Compilation
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncompiler()The compiler.com.google.common.collect.ImmutableList<Diagnostic<? extends JavaFileObject>> All diagnostics reported during compilation.com.google.common.collect.ImmutableList<Diagnostic<? extends JavaFileObject>> errors()Errors reported during compilation.generatedFile(JavaFileManager.Location location, String path) Returns the file atpathif one was generated.generatedFile(JavaFileManager.Location location, String packageName, String fileName) Returns the file with namefileNamein packagepackageNameif one was generated.com.google.common.collect.ImmutableList<JavaFileObject> Files generated during compilation.generatedSourceFile(String qualifiedName) Returns the source file for the type with a given qualified name (no ".java" extension) if one was generated.com.google.common.collect.ImmutableList<JavaFileObject> Source files generated during compilation.com.google.common.collect.ImmutableList<Diagnostic<? extends JavaFileObject>> notes()Notes reported during compilation.com.google.common.collect.ImmutableList<JavaFileObject> The source files compiled.status()The status of the compilation.toString()com.google.common.collect.ImmutableList<Diagnostic<? extends JavaFileObject>> warnings()Warnings (including mandatory warnings) reported during compilation.
-
Method Details
-
compiler
The compiler. -
sourceFiles
The source files compiled. -
status
The status of the compilation. -
diagnostics
All diagnostics reported during compilation. The order of the returned list is unspecified.- See Also:
-
errors
Errors reported during compilation. -
warnings
Warnings (including mandatory warnings) reported during compilation. -
notes
Notes reported during compilation. -
generatedFiles
Files generated during compilation.- Throws:
IllegalStateException- for failed compilations, since the state of the generated files is undefined in that case
-
generatedSourceFiles
Source files generated during compilation.- Throws:
IllegalStateException- for failed compilations, since the state of the generated files is undefined in that case
-
generatedFile
Returns the file atpathif one was generated.For example:
Optional<JavaFileObject>fooClassFile = compilation.generatedFile(CLASS_OUTPUT, "com/google/myapp/Foo.class");- Throws:
IllegalStateException- for failed compilations, since the state of the generated files is undefined in that case
-
generatedFile
public Optional<JavaFileObject> generatedFile(JavaFileManager.Location location, String packageName, String fileName) Returns the file with namefileNamein packagepackageNameif one was generated.For example:
Optional<JavaFileObject>fooClassFile = compilation.generatedFile(CLASS_OUTPUT, "com.google.myapp", "Foo.class");- Throws:
IllegalStateException- for failed compilations, since the state of the generated files is undefined in that case
-
generatedSourceFile
Returns the source file for the type with a given qualified name (no ".java" extension) if one was generated.For example:
Optional<JavaFileObject>fooSourceFile = compilation.generatedSourceFile("com.google.myapp.Foo");- Throws:
IllegalStateException- for failed compilations, since the state of the generated files is undefined in that case
-
toString
-