tags:

views:

63

answers:

4

I have the following problem. I have something like 300 Eclipse Plugins. Now, as part of an ant script I want to read all MANIFEST.MF files and then look for the execution environment string.

Bundle-RequiredExecutionEnvironment: J2SE-1.4

Now, this string has several possible values. I want to create a report that lists the execution environment for each plug-in. That part is not really a problem as I can use some kind of regexp to obtain it.

My problem is that I want also to create some kind of summary for tracking changes at a glance, something like:

  • JS2E-1.4: 50 Plugins
  • JS2E-1.5: 150 Plugins
  • JS2E-1.6: 74 Plugins

Anyone has some suggestions on how could I go around this?

EDIT: Reason for using ANT is that I want to integrate it with a nightly build script

+1  A: 

If i were to do it myself, i probably would just write a perl script.

If it has to be done from Ant, i would write an Ant Task to do it.

Christoffer Hammarström
+1  A: 

I would suggest just printing each executable environment on System.out and then post process with "|sort| uniq -c".

Thorbjørn Ravn Andersen
+1  A: 

You can use the math task from the ant-contrib project

I had to do it, I'd probably go for some shell script or custom code

David Rabinowitz
+1  A: 

I would definitively go for hard-coded Ant task and decompose the problem in two tasks:

  1. the first task takes a jar file and outputs a plugin-info.xml file that contains various infos, like the environment
  2. the second task parses all these xml files and creates an XML summary report

This will of course generate (n+1) XML files for n plugins and some will find this way too much.

The nice end effect with that approach is that you can generate either detail or aggregated reports very easily (with some XSLT magic.) or even graphs.

Vladimir
Getting a dump with the MANIFEST.MF location and the string is not difficult. I think I will go with the hard-coded ant task for the grouping
Mario Ortegón