addAnnotation

fun addAnnotation(annotationSpec: AnnotationSpec): FileSpec.Builder

Add an annotation to the file.

The annotation must either have a file use-site target or not have a use-site target specified (in which case it will be changed to file).

fun addAnnotation(annotation: ClassName): FileSpec.Builder
fun addAnnotation(annotation: Class<*>): FileSpec.Builder
fun addAnnotation(annotation: KClass<*>): FileSpec.Builder