I am trying to develop some plugin, which is a facet. It generates some file when user clicks "Build->Make Project". It has some facet setting options. I want the generated files being cleaned and regenerated if user changes the options and clicks "Build->Make Project".
Currently, I have added a CompileTask through compilerManager.addBeforeTask(), which has the logic of cleaning generated files if user clicks "Build -> Rebuild Project", which is detected by calling CompileContext.isRebuild().
Is there a way to figure out whether the settings have changed since the last build, given the CompileContext object, so that I can clean the generated file in the CompileTask#execute()?
Or if the above way is not the ideal way, what is the common practice for IntelliJ plugin to achieve similar goal?