My Second NetBeans Plug-in: Project Packager



During my vacation next to lots of biking and having fun with friends I also worked on my second plug-in called Project Packager. Unlike my previous Googlefight plug-in this one is almost useful. It can be used to export projects as zip packages, send them by e-mail and to unpack them for opening. Here's a screenshot of the export dialog:


Exporting of projects and sending by e-mail

I've found out that exploring NetBeans APIs can be quite fun and will share some of the experiences during my next posts, especially all those tricky things. It happened to me several times that I was trying to solve some problem and then after few hours smashed my head when finding the answer, you know how it goes... exploring something new is both challenging and fun.

Here you can download the nbm of my plug-in and it's sources. If anyone thinks this plug-in is a good idea I may also commit the sources to CVS. The project needs to be opened in a recent 4.2 daily build. Note that the project contains 2 external libraries to be able to send MIME attachments. Comments are welcome and appreciated.

Update: I've commited the project into CVS, the latest version of sources will always be in contrib/projectpackager.
Comments:

Neat. Does it exclude the nbproject/private directory?

Posted by Rich Unger on srpen 06, 2005 at 06:26 odp. CEST #

Hi nice to see you back from vacation how was it?

Oh yeah, this is a nice one, I was thinking about doing something similar as my first NB plugin project.

My original idea was more ambitious try to use GCJ to compile Native applications, and then do the installation part, unfortunately Native compilation this way is very limited by SWING, so I will try to only automate installation. I think that automated deployment is a must have NB plugin.

I will give a look at your code, and try to extend your plugin, to create an automated deployment process, using a download page like the own found in (http://azureus.sourceforge.net/download.php), and try to interact with the IzPack Installer, also building a SFX EXE would be very nice.

Great Work it would be a really nice project to have in java.net, do you want to start one? I was going to call mine Spit!Deployer :) But if you start one i will simply join your efforts

Posted by Daniel MD on srpen 06, 2005 at 07:12 odp. CEST #

It appears to be working but i get this message wend i try to use it.

java.lang.NullPointerException at org.netbeans.modules.apisupport.project.queries.GlobalJavadocForBinaryImpl.findJavadoc(GlobalJavadocForBinaryImpl.java:51) at org.netbeans.api.java.queries.JavadocForBinaryQuery.findJavadoc(JavadocForBinaryQuery.java:60) at org.netbeans.modules.javadoc.search.JavadocRegistry.readRoots(JavadocRegistry.java:142) at org.netbeans.modules.javadoc.search.JavadocRegistry.getDocRoots(JavadocRegistry.java:97) at org.netbeans.modules.javadoc.search.IndexBuilder.refreshIndex(IndexBuilder.java:167) at org.netbeans.modules.javadoc.search.IndexBuilder.run(IndexBuilder.java:95) at org.openide.util.Task.run(Task.java:207) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:469) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:870)

What am i doing wrong?

Posted by Daniel MD on srpen 06, 2005 at 08:09 odp. CEST #

Rich: Yes, it excludes nbproject/private/\*\*, build/\*\* and dist/\*\*. I will probably add an option to exclude the external directory in the future. The plug-in is very simple and I will extend it if people will find it useful.

Daniel: Which build do you use? I've crossed this exception as well, see this issue. Try upgrading to a newer 4.2 build and let me know if that helped.

Concerning the project at java.net, I wanted to commit the plug-in to contrib.netbeans.org. The plug-in will require some rewriting if you want it to do more than just what it does - I kept things simple, my goals were small (I'm still learning). Take a look at it and you'll see how much you can reuse...but I would code it different if I had bigger ambitions :-) My vacation was fine btw, thanks for asking.

Posted by Roman Strobl on srpen 07, 2005 at 01:41 dop. CEST #

It's a great plugin.

I'm coming here from Planet NetBeans. but, Roumen, could you tell me how to get the archived articles on the Netbeans planet?

thanks.

Posted by guest on srpen 07, 2005 at 01:58 dop. CEST #

As far as I know no archives are maintained for Planet NetBeans. You can click on individual feeds listed on the right side of Planet NetBeans and browse the individual blogs... but yes, it would be nice if we would make archives of the Planet.

Posted by Roman Strobl on srpen 07, 2005 at 02:06 dop. CEST #

I am using the latest Q-Build. Will try with daily build see if it goes away.

About the project I will write some design specs, and see if there is already people doing something similar, if not i will start a java.net project.

Posted by Daniel MD on srpen 07, 2005 at 01:21 odp. CEST #

The NPE was fixed during the q-build cycle in trunk, so it should not be thrown in dailies. Let me know if it would occur, I would reopen the issue. Looking forward to the design specs :-)

Posted by Roman Strobl on srpen 07, 2005 at 01:35 odp. CEST #

Re. excluding <code>nbproject/private/</code>, <code>build/</code>, and <code>dist/</code>: the correct way to do this is to use <code>SharabilityQuery</code> to ask the project which directories should be excluded from the ZIP. That will work correctly in project types with different structures.

Also it is not clear that this export facility will work correctly when you have an external source root...?

Posted by Jesse Glick on srpen 08, 2005 at 11:17 dop. CEST #

Thanks Jesse, I'll use the SharabilityQuery (that's exactly what I was looking for...). It probably won't work for external source roots. I'll test it on various project configurations and see what all needs to be done.

Posted by Roman Strobl on srpen 08, 2005 at 11:27 dop. CEST #

button -> button + text field

Posted by Tim Boudreau on srpen 08, 2005 at 01:17 odp. CEST #

I have commited the sources to contrib/projectpackager at cvs.netbeans.org - I will continue the development here.

Posted by Roman Strobl on srpen 10, 2005 at 03:56 odp. CEST #

Hi Roumen, are you still developing this module? If yes, a really useful extension would be that the project packager would: .) Export any project so it would be runnable from the ant build system, without netbeans, so the project can be shared easier. .) All libs must be included that are added in nb to compile/build/run/test the project as it does within netbeans. Currently it seems that Projectrelations are not resolved (project-properties/Libraries/Add Project), as well as nebeans libraries (project-properties/Libraries/Add Libraries)

Posted by Thomas Zillinger on září 28, 2006 at 06:57 dop. CEST #

When I checked out the source and tried to open the project in nb5.5b2 following Exception was thrown
java.io.IOException: netbeans.org-type module not in a complete netbeans.org source root: NbModuleProject[MasterFileObject@858616[D:/develop/Projects/other Projects/Netbeans/contrib/contrib/projectpackager]]

Posted by Thomas Zillinger on září 28, 2006 at 07:17 dop. CEST #

Hi Thomas, that would be a nice feature but I'm afraid I won't have time for something like that... you can contribute if you want. I'll try to open projectpackager in 5.5b2.

Posted by Roumen on září 29, 2006 at 09:44 dop. CEST #

I was able to checkout and build projectpackager without problems. Did you check out the whole netbeans source and build it? I think it's not possible to build it without it... because it's a contrib module.

Posted by Roumen on září 29, 2006 at 09:48 dop. CEST #

Post a Comment:
Comments are closed for this entry.
About

Roman Strobl

Search

Archives
« duben 2014
PoÚtStČtSoNe
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today