Skip to content

Commit

Permalink
Fix error that prevented incremental compilation for previews that le…
Browse files Browse the repository at this point in the history
…verage custom annotations (#383)

* Fix error that prevented incremental compilation

* Revert test data
  • Loading branch information
vinaygaba authored May 21, 2024
1 parent 65314e6 commit c310896
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.airbnb.android.showkase.processor.writer
import androidx.room.compiler.processing.XElement
import androidx.room.compiler.processing.XFiler
import androidx.room.compiler.processing.XProcessingEnv
import androidx.room.compiler.processing.addOriginatingElement
import androidx.room.compiler.processing.get
import androidx.room.compiler.processing.isTypeElement
import androidx.room.compiler.processing.writeTo
Expand Down Expand Up @@ -192,7 +193,10 @@ internal class ShowkaseBrowserWriter(private val environment: XProcessingEnv) {
}

fileBuilder.addType(
TypeSpec.classBuilder(generatedClassName).addFunctions(functions).build()
with(TypeSpec.classBuilder(generatedClassName).addFunctions(functions)) {
addOriginatingElement(element)
build()
}
).addFileComment("This is an auto-generated file. Please do not edit/modify this file.")
fileBuilder.build().writeTo(environment.filer, mode = XFiler.Mode.Aggregating)
}
Expand Down

0 comments on commit c310896

Please sign in to comment.