Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pde-dev] "Find unused dependenceis" from command line?

Hi Christian,

I discovered that the "Find unused dependencies" functionality indeed sometimes proposes to remove dependencies that are needed at compile time (the algorithm evidently is not bullet proof) and of course there can be runtime dependencies that can never be statically determined. 

One could make a scheme where you can flag dependencies as 'forced' because they can not be deduced. I currently do this by putting an unused method in my code that references some class of the dependent plugin. This way the "Find unused dependencies" functionality will stop suggesting to remove the plugin. 

What I would like to do next is to run this "Find unused dependencies" in our build process and fail (with a senseble message) the build when unused dependencies are found. That way the developers are forced to keep unused things from the list and to put un-calculable dependencies in that magic method to make them hard dependencies.

((ok, I realize that debris can build up in that magic method; there is a limit to everything...))

But to make that work I need to run the "Find unused dependencies" from the command line.

BTW: I already do an equivalent thing for generated code: we have a fixed formatter settings file and after code generation the build machine formats all code and then checks if there is a difference with the checked in code. If there is the build fails and the developer needs to generate/format correctly to make the build succeed again. This traps "oops, forgot to generate that" as well as "oops, forgot the 'generated not'" kind of errors. Works pretty neat.

-Tom

On Fri, Apr 29, 2011 at 22:31, Bourgeois, Christian <Christian.Bourgeois@xxxxxxxxxxxxx> wrote:

Hi Tom.

It would be great to automate the tasks as you described but that would be difficult to make it work in general.

Most OSGi development is done on top of some kind of dependency injection framework (DS, Spring DM / Gemini). If you automate the process to remove the unused dependencies, you will come across the case that you have removed a dependency that was declared in one of the DI configuration file.

Regards,

Christian

To: pde-dev@xxxxxxxxxxx
Subject: [pde-dev] "Find unused dependenceis" from command line?

Hi List,

I hope I am talking up the right list, if not, maybe someone can point me to the right list.

I would like to call the "Find unused dependencies" functionality of the "Plug-in Manifest Editor" from the command line. Does anybody know if and how?

We have about 50 projects and 10 developers. Experience has proven that the developers will not think of erasing unused dependencies in the heat of the battle. Going through all manifest files and erasing the unused dependencies is a tedious job I would happily like our CI build machine to do. Hence my question.

I am also curious why this is not the default thing during a build. What is the use of pulling in stuff that will never be used? I could imagine removing unused dependencies before packaging and maybe a flag if you realy-realy want unused stuff in the resulting plugin. That would be a lot handier, right? But this is a bit besides the point of my question above.

Thanks,

Tom


 

Le contenu de ce courriel s'adresse au destinataire seulement. Il contient de l'information pouvant être confidentielle. Vous ne devez ni le copier ni l'utiliser ni le divulguer à qui que ce soit à moins que vous soyez le destinataire ou une personne désignée autorisée. Si vous le receviez par erreur, veuillez nous aviser immédiatement et le détruire.

 

The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.
 


_______________________________________________
pde-dev mailing list
pde-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/pde-dev



Back to the top