com.squareup.anvil.compiler.codegen.CheckOnlyCodeGenerator.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compiler Show documentation
Show all versions of compiler Show documentation
The core implementation module for Anvil, responsible for hooking into the Kotlin compiler and orchestrating code generation
package com.squareup.anvil.compiler.codegen
import com.squareup.anvil.compiler.api.FileWithContent
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.psi.KtFile
import java.io.File
/**
* A [PrivateCodeGenerator] that doesn't generate any code, but instead just performs checks.
*/
internal abstract class CheckOnlyCodeGenerator : PrivateCodeGenerator() {
final override fun generateCodePrivate(
codeGenDir: File,
module: ModuleDescriptor,
projectFiles: Collection,
): Collection {
checkCode(codeGenDir, module, projectFiles)
return emptyList()
}
protected abstract fun checkCode(
codeGenDir: File,
module: ModuleDescriptor,
projectFiles: Collection,
)
}