Event when all is analyzed. Possible?

Hello,

We’re currently working SonarQube custom plugin for android project (Java/Xml rules).
We’d like to know if a specific event is fired once the overall project was analyzed (e.g. afterCheckedProject() method) like the SubscriptionVisitor#leaveFile method for a single file?

Regards.

Hi @Justin_snapp
The Compute Engine PostProjectAnalysisTask extension point should allow you to trigger your post analysis task.
Let me know if this helps.
Best rezgards

Hi @Sylvain_Combe ,
Thank you for your reply,
I implemented your solution,
however, I didn’t manage to make it work.
I implemented PostProjectAnalysisTask, in one of my Rules(IssuableSubscriptionVisitor).
But I’m not passing into the finished method.
Can an IssuableSubscriptionVisitor implements PostProjectAnalysisTask

You need to create separate component for that task

Hi @nixel2007,
thanks for the reply,
What do you mean by separate component?
How can I manage to do that ?

Create another class, not a Rule class. And implement that interface.
AFAIR you should add new class to getExtensions() method of your plugin class also (because PostProjectAnalysisTask is an extension point).

I added a PostProjectAnalysisTask which implements org.sonar.api.ce.posttask.PostProjectAnalysisTask

However,
How can I catch the end of the analysis in my Rules ?
Will it be possible to report an issue in the PostProjectAnalysis Callback?

The idea between my questions is that I want to be notified when i leave the project to know if something(MethodInvocation for example) is not called in the all project structure.

Hi @Justin_snapp
your PostProjectAnalysisTask implementation will get called at the end of the analysis background task running in SonarQube Compute Engine, it has access to the analyzed project and branch (in finished method implementation), and through them to all the data you need for your notification use case I think.