Zipping A Suite's NBM Files for Distribution

One of the many nice people I met at JavaOne was Mark Stephens, from IDR Solutions. Mark and a colleague did a very interesting BOF about how they created their JPedal viewer plugin for each of the main IDEs (i.e., IntelliJ, NetBeans IDE, and Eclipse). He highlighted various things that were cool and not so cool about creating plugins for each of the IDEs. One of the things he told me was that the "Build ZIP Distribution" menu item on the project node of module suite projects is confusing. He had expected to be able to choose that menu item and then get a ZIP file containing all the NBMs in the suite. Instead, the menu item resulted in an application being created, i.e., including a launcher and a bin folder and so on.

However, Mark's usecase was different: his suite contained a number of different modules which he wanted to upload to the Plugin Portal. However, one can only upload one file to a new Plugin Portal entry. Either one uploads one NBM file or one ZIP file. Mark, having multiple NBM files in his plugin, thus chose "Build ZIP Distribution" on the suite project and was disappointed/confused to discover that he was then prompted to make the suite an application after which he still didn't get his NBMs zipped up into a suite. As pointed out above, the purpose of that menu item is different to what Mark had expected. Therefore, I created a plugin today that provides this functionality:

Get it here:

http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=9296

I think everything is explained on that page. The menu item is only shown for module suite projects. The ZIP file is created via an Ant script that is created in the tmp directory and then removed after the target has completed. The Ant target simply runs the "nbms" target, which every module suite project has, thus creating all the NBM files into the build/updates folder and then picks up all the NBM files in that folder and ZIPs them up. (The only problem is that I can't put the menu item higher in the contextual menu, because ideally it would appear right beneath the existing "Build ZIP Distribution" item, but currently that's not possible.) If you are a NetBeans module developer and are interested in how all this is done, click here and you will get the Action's source file. (Click here to see the related layer file.) Comments/critiques/feedback on this functionality is/are welcome.

Today on NetBeans Zone. Two NetBeans Keyboard Shortcuts That Will Change Your Life (Forever)

Comments:

It works really nicely. Thanks for implementing it.

Posted by mark stephens on May 19, 2008 at 03:47 AM PDT #

Great module Geertjan! It's something that most people would like to use.
A really useful module, should be included in Netbeans IDE.

Only a suggestion: when I package mine for distribution in a zip I use to include 3 txt files that are a readme, a install note and the license.

It would be perfect that in a future version some files many be included like this when one packages the nbms.

Posted by Jordi R Cardona on May 20, 2008 at 03:38 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
24
25
26
27
28
29
30
   
       
Today