Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error that prevented incremental compilation for previews that leverage custom annotations #383

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading