mictaege / spoon-gradle-plugin

Gradle Plugin for the Java analysis and transformation framework Spoon.
Apache License 2.0
0 stars 1 forks source link

Also add spoon task for empty sourceSets #32

Open skiedrowski opened 1 year ago

skiedrowski commented 1 year ago

SpoonPlugin#apply skips adding spoon tasks if source.empty. If the source set is populated after configuration phase by some sort of code generation, this might not be what we want.

Example

As a workaround, the build needs to make sure that the sourceSet is not empty during configuration phase.

mictaege commented 1 year ago

The idea of skipping "empty" sourcesets was to avoid unnecessary work during the build. In practice, this optimization should bring little or no performance at all.

So in this regard, we can confidently do without it.

The only thing we have to keep in mind is that the source code transformation with Spoon will not fail if it is a really empty sourceset, where no source code exists and no generation take place.