Kotlin/dataframe

Preprocessor Gradle plugin behavior

Jolanrensen opened this issue · 2 comments

As discussed in #616 and Jolanrensen/docProcessorGradlePlugin#40 (comment) the preprocessor plugin can sometimes behave a bit odd.

Currently, it's configured to run automatically on each commit and add all newly generated files to Git. This comes with a few downsides:

  • You cannot specify which generated files to commit without turning off the commit hook
  • The processor is run each time a Jar is created or something is committed, even when nothing has changed in the source/generated files

Actually, the generated files only need to be updated when:

  • the input has changed
  • the output has changed (if we make the output Read only, we only need to detect file deletions

And as for the SimpleGit auto-add, only the files that are added/have commits in the src folder should be added in the generated-sources folder.

In the IDEA there's similar thing: you can run analysis for commit. Now it would not block the commit itself, but only notify user afterwards when analysis is finished. We cannot create IDE notification, but anyway if preprocessor will run and generate new files it should be enough for author to notice and maybe amend commit themselves. So i propose to not block commit / run post-commit hook that only generates files (without automatically adding them)