Remove usages of Delegates.lazy

This commit is contained in:
Ilya Gorbunov
2015-10-14 00:01:37 +03:00
parent c4ef4758d2
commit 2fba80168d
3 changed files with 6 additions and 6 deletions
@@ -48,7 +48,7 @@ public abstract class AnnotationProcessorWrapper(
val KAPT_ANNOTATION_OPTION = "kapt.annotations"
}
private val processor: Processor by Delegates.lazy {
private val processor: Processor by lazy {
try {
val instance = Class.forName(processorFqName).newInstance() as? Processor
instance ?: throw IllegalArgumentException("Instance has a wrong type: $processorFqName")
@@ -53,10 +53,10 @@ abstract class KotlinSourceSetProcessor<T : AbstractCompile>(
protected val sourceSetName: String = sourceSet.getName()
protected val sourceRootDir: String = "src/${sourceSetName}/kotlin"
protected val absoluteSourceRootDir: String = project.getProjectDir().getPath() + "/" + sourceRootDir
protected val kotlinSourceSet: KotlinSourceSet? by Delegates.lazy { createKotlinSourceSet() }
protected val kotlinDirSet: SourceDirectorySet? by Delegates.lazy { createKotlinDirSet() }
protected val kotlinTask: T by Delegates.lazy { createKotlinCompileTask() }
protected val kotlinTaskName: String by Delegates.lazy { kotlinTask.getName() }
protected val kotlinSourceSet: KotlinSourceSet? by lazy { createKotlinSourceSet() }
protected val kotlinDirSet: SourceDirectorySet? by lazy { createKotlinDirSet() }
protected val kotlinTask: T by lazy { createKotlinCompileTask() }
protected val kotlinTaskName: String by lazy { kotlinTask.getName() }
public fun run() {
if (kotlinSourceSet == null || kotlinDirSet == null) {
@@ -93,7 +93,7 @@ public abstract class AnnotationCollectorExtensionBase(val supportInheritedAnnot
annotationFilters = nullableAnnotations.filterNotNull()
}
private val classVisitor: ClassVisitor by Delegates.lazy {
private val classVisitor: ClassVisitor by lazy {
object : ClassVisitor(Opcodes.ASM5, super.getVisitor()) {
override fun visitAnnotation(desc: String, visible: Boolean): AnnotationVisitor? {
recordAnnotation(null, RecordTypes.ANNOTATED_CLASS, desc)