ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerard Janssen <gee...@janssenenjansen.nl>
Subject Re: Attempting to split the same package into two jars
Date Fri, 04 Feb 2005 14:52:05 GMT
Hi,

The fileset gives you a set of files, relative to the directory specified in 
the dir attribibute. What you probably want is to use the directory 
containing all your sources as the root of the fileset and do apply a filter 
on the fileset. 
So instead of: 

<jar jarfile="${dist_dir}/${dist_bof_file}" >
	<fileset dir="${scr_tbo_dir}"/>
        <fileset dir="${scr_tbo_dir}"/>
</jar>
use:
<jar jarfile="${dist_dir}/${dist_bof_file}" >
	<fileset dir="${comp_sun_dir}">
		<include name="com/foo/sbo/**/*">
		<include name="com/foo/tbo/**/*">	
        </fileset>
</jar>

And instead of: 

<jar jarfile="${dist_sun_dir}/${dist_sun_file}"
            basedir="${comp_sun_dir}"
            excludes="${comp_sun_dir}/${scr_tbo_dir}/**, ${comp_sun_dir}/
${scr_sbo_dir}/**" />

use:

<jar jarfile="${dist_sun_dir}/${dist_sun_file}">
	<fileset dir="${comp_sun_dir}">
		<exclude name="com/foo/sbo/**/*"/>
		<exclude name="com/foo/tbo/**/*"/>
	</fileset>
</jar>



Gerard



On Thursday 03 February 2005 00:55, damian.kelly@au.pwc.com wrote:

> Hi,
> I am having a problem packaging up my JARs using ant.
>
> Currently I am building a project which has the following elements:
>
> com.foo.sbo.*
> com.foo.tbo.*
> com.foo.*
>
> I want to create two jar files one which has com.foo.sbo and com.foo.tbo in
> the same file and another which has the rest of com.foo* excluding the sbo
> and tbo.
>
> Below is what I have attempted:
>
>   <target name="deploy">
>       <echo message="Packaging BOF..."/>
>                   <jar jarfile="${dist_dir}/${dist_bof_file}" >
>                   <fileset dir="${scr_tbo_dir}"/>
>                         <fileset dir="${scr_tbo_dir}"/>
>             </jar>
>     <echo message="Packaging server side Java code..."/>
>     <jar jarfile="${dist_sun_dir}/${dist_sun_file}"
>             basedir="${comp_sun_dir}"
>             excludes="${comp_sun_dir}/${scr_tbo_dir}/**, ${comp_sun_dir}/
> ${scr_sbo_dir}/**" />
>     <echo message="Done."/>
>   </target>
>
> There has the following two problems:
>
> The first jar file packages the correct classes but doesn't include the
> com.foo at the start therefore the jar doesn't work correctly.
>
> The second jar isn't excluding the com.foo..sbo.* and com.foo.tbo.*
> classses.
>
> Thanks a lot for any help.
>
> Regards,
> Damian.
>
> _________________________________________________________________
> Growing your business and less than $100 million turnover?
> Looking for ways to improve your business and increase profit?
> http://www.pwc.com/au/clevercompanies
>
> Explore opportunities for mid-sized companies to increase profits.
> Request a copy of our 'take action' tips.
> http://www.pwc.com/au/businessinsightssurvey
>
> PwC's latest news, insights and offerings
> http://www.pwc.com/au
>
> This communication is intended only for the person or entity to which it is
> addressed and may contain confidential and/or privileged material.  Any
> review, retransmission, dissemination or other use of, or taking any action
> in reliance on, this communication by persons or entities other than the
> intended recipient is prohibited.   If you received this in error, please
> inform PricewaterhouseCoopers ("PwC") immediately by return email and
> delete the  material including all copies from any computer.
>
> The liability of PwC, is limited by, the Accountants' Scheme approved under
> the Professional Standards Act 1994 (NSW).
>
> PwC makes no express or implied representation or warranty that this
> electronic communication or any attachment is free from computer viruses or
> other defects or conditions which could damage or interfere with the
> recipients data, hardware or software.  This communication and any
> attachment may have been modified or otherwise interfered with in the
> course of transmission.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message