Package com.squareup.anvil.compiler.api

Types

AnvilCompilationException
Link copied to clipboard
class AnvilCompilationException(message: String, cause: Throwable?, element: PsiElement?) : CompilationException

AnvilCompilationException is thrown when Anvil specific code can't be processed or an error occurs while generating code.

AnvilContext
Link copied to clipboard
interface AnvilContext

Contains context about the given Anvil compiler invocation. Considered a read-only API.

CodeGenerator
Link copied to clipboard
interface CodeGenerator

This interface allows for easy extension of Anvil's core compiler functionality for cases where you need to generate extra code during compilation.

GeneratedFile
Link copied to clipboard
data class GeneratedFile(file: File, content: String)

Represents a generated file that Anvil should eventually write.

Functions

createGeneratedFile
Link copied to clipboard
fun CodeGenerator.createGeneratedFile(codeGenDir: File, packageName: String, fileName: String, content: String): GeneratedFile

Write content into a new file for the given packageName and fileName. fileName usually refers to the class name.