Maybe because that's easier? :) ...
Anyway, if you ever tried to use the autoupdate of NetBeans you have probably noticed that one of the crucial things for it to work is that you need to increment the module specification version by updating your module's Manifest.mf file from this:
...
OpenIDE-Module-Specification-Version: 1.96
...
to this:
...
OpenIDE-Module-Specification-Version: 1.97
...
This has to be be done manually, for each of the modules in your application that has changed. While not a big deal when you only work with a single module, it may get quite tedious and error-prone when more than a handful of modules change.
Why not automate this somehow?
Besides being easier that way, figuring out if the module has changed "enough" is not trivial. One has to consider not only if any change has been made, but whether it makes any exported interface binary incompatible. And of course, instead of interface one can change the functionality in a way that still makes it a candidate for update. And there's the ability of a module to export services through META-INF ...
Today, I was on my way to start hacking up a tool that tries to account for all that and automate the process when laziness overpowered me :)
I realized that a blunter yet simpler instrument might do just as well:
...
#!/bin/sh
find . -name manifest.mf | xargs sed -i.bak "s/OpenIDE-Module-Specification-Version:.*$/OpenIDE-Module-Specification-Version: $1/g"
...
That's it! Simply put this little script in your PATH, change to the modules folder and ...:
...
$ ~/bin/update-module-specification-version.sh 1.97
...
... will modify all manifest.mf files it finds, setting OpenIDE-Module-Specification-Version to 1.97.
Still quite dumb, but beats having to edit almost all 29 of my manifests by hand.
No comments:
Post a Comment