Open honourednihilist opened 7 years ago
This is expected. You have to run "./gradlew clean" to delete obsolete output.
Is this in line with the gradle behavior for standard java classes? If you remove a class, is the class-file not automatically purged from the build directory?
@agemocui are you sure?
Gradle incremental builds are supposed to work like builds from scratch, but faster. If I rename or remove a regular java class, then the corresponding class-files will be 'renamed' or removed.
Gradle achieves incremental builds for Java with deep integration. In this thrift plugin, the general incremental mechanism, which is only to track down to file level instead of "class" level, is used. And what I chose/decided is to rebuild everything when there's an input file deleted, not when a struct is deleted.
I worked on a gradle plugin using this one. It looks like I found a bug, but I didn't go deeper to investigate.
I'll use my example project gradle-kafka-deserializers-example to describe how to reproduce the bug.
Clone the repository and build the project:
Let's take a look at list of compiled classes:
Edit
your.thrift
and renameYourCompositeStruct
toRenameYourCompositeStruct
:Build the project and take a look at list of compiled classes again:
You can see that
YourCompositeStruct
still exists. But I'd expect that it doesn't.