Re: Jar Target

Ondrej Rypacek <[email protected]> Fri, 05 Sep 2003 11:13:28 +0200
Newsgroups gmane.comp.java.netbeans.modules.projects.devel
Message-ID <[email protected]>
Hi Chris,
the first possibility to do that is as Vita correctly has guessed -- 
setup a filter each time manually by enumerating all files of the 
implementation and all files of the interface. This would probably have 
to be done upon each compilation , as the set of input files changes.

If there was some naming pattern, you could filter the files by a 
regular expression . That's simple though I won't go deeper for now, as 
I expect that it's not the case.

The most correct and robust solution , is to define the filter 
declaratively by using an implementation of JarContent.NameFilter that 
would pass / not-pass files based on the contents of the sources container.
JarContent.NameFilter which has just one method   *boolean 
contains(String) *
The meaning is obvious , I guess.

Such a filter is not readily implemented of course, as I couldn't have 
expected this requirement. But implementing it is a piece of cake. I can 
do it for you.

-Ondra

P.S. I'm back to jarpackager





Vitezslav Stejskal wrote:

> Hi Chris,
>
> I will try to answer your question since I am the new owner of 
> jarpackager module now :-(. Please keep in mind that I don't know much 
> about the module yet so my answer probably will not be really useful.
>
> Chris Webster wrote:
>
>>
>> Assume a user creates a java project where there should be two 
>> outputs one containing the implementation and the other containing 
>> the interfaces. Also, assume that the compiled classes build step 
>> must be preceeded by a build step which generates interfaces based on 
>> the implementation classes.
>>
>> com
>>   xyz
>>      Impl.class
>>      Interface.class (generated from Impl during build)
>>
>> Will the jar target support the ability to filter the single compiled 
>> classes to produce the jar files below (please describe how one would 
>> do this through the user interface and java interface)?
>
>
> IMO this will be possible when you manually set up jar filters. In 
> generall you can define the contents of jar archive on the files level 
> (there is some UI showing the tree of sources and built class files 
> accompanied by checkboxes allowing you to select what exactly you want 
> to pack in the jar. For details see the 
> http://jarpackager.netbeans.org/UISpec.html (Contenets customization 
> Editor).
>
> I don't kown how to do this using jarpackager API, but there seems to 
> be promising page on 
> http://www.netbeans.org/download/prj40_prototype/javadoc/JarpackagerAPI/index.html 
> (find the link to 'specify the contents of jars').
>
> -vita
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>