Login  Register

Re: Organizing plugins, utility classes and jars

Posted by BenTupper on Aug 27, 2009; 1:21pm
URL: http://imagej.273.s1.nabble.com/Organizing-plugins-utility-classes-and-jars-tp3691373p3691376.html

Thanks to you each for the answers.

I would like to keep the source files in place if I can.  Ours is a  
very small shop - so to speak - and it feels better to keep all of the  
important papers in the same shoebox (with regular backups to another  
shoebox of course!)  But it occurs to me that when making a jar I  
should perhaps do it in two steps...

(1) jar cvfM BenUtility.jar *.class

(2) rm *.class

I can then leave the jar and the source code (along with special test  
images, the html api, etc)  in the subdirectory.  Then when I need to  
distribute plugins/utilities to my lab-mates I can simply send the jar  
- with reduced risk from moving things in-and-out.  If I can just  
remember to not do "rm *.java"...

Cheers,
Ben



On Aug 27, 2009, at 6:16 AM, Michael Schmid wrote:

> Hi Ben,
>
> two remarks:
>
> In your approach, there is no need to remove the .java files from  
> the plugins subdirectories; it is enough to remove the .class files  
> that are now in a .jar
> ImageJ won't compile .java files unless they are needed for  
> 'Compile&Run'
>
> --
> My usual approach for editing a larger package is copying the  
> directory with the sources as a whole into the plugins folder,  
> moving the jar somewhere else (actually, I name it .zip; ImageJ  
> accepts also .zip in place of .jar; the advantage is that one can  
> more easily add/replace files in a .zip, at least under Windows).
> Then I do the changes until everything works; and I copy the  
> new .class files into the zip (jar) and I move the new sources back  
> to my home directory. Finally, I delete the remaining class files  
> and put the zip (jar) file back into place.
>
> You can have a plugins.config file in the jar to specify which  
> plugins should appear in the menu and where.
>  http://rsb.info.nih.gov/ij/plugins/jar-demo.html
>
> I have this plugins.config file together with the sources, so I can  
> also create a new zip from the whole subdirectory of the plugins  
> (and remove the sources afterwards if desired)
> I have a flat folder, no hierarchy, however; possibly this won't  
> work with subfolders.


On Aug 27, 2009, at 7:50 AM, Johannes Schindelin wrote:
>
> Leaving the .java files in plugins/ if you do not need/want them  
> would be
> sloppy anyway.
>



Ben Tupper