ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Extension to Manifest task?
Date Thu, 04 Mar 2004 12:58:51 GMT
On Wed, 3 Mar 2004, Craig Berry <Craig.Berry@portblue.com> wrote:

> The fit turns out to be rather awkward.

Doesn't look that bad to me.

> <!-- Gather the non-ejb EAR jars and build a fileset containing them -->
> <copy todir="${portblue.build.ear-libs}" flatten="true">
> 	<fileset refid="portblue.libs.ear"/>
> </copy>
> 
> <fileset dir="${portblue.build.ear-libs}" id="lib.include"/>

Do your really need that copy operation or are you just doing it in
order to create the classpath entry?

> <pathconvert property="lib.prefix" pathsep=" ">
>   <path location="${portblue.build.ear-libs}"/>
> </pathconvert>

Are you doing this to turn portblue.build.ear-libs into an absolute
path?

<property name="lib.prefix" location="${portblue.build.ear-libs}"/>

would be simpler.

> <pathconvert refid="lib.include" property="ear.classpath" dirsep="/"
>               pathsep=" ">
>   <map from="${lib.prefix}" to="lib"/>
> </pathconvert>

creates the property you need.

Assuming you don't need the <copy> task, the whole thing could be
simplyfied with the CVS HEAD version as

<pathconvert property="ear.classpath" dirsep="/" pathsep=" ">
  <path>
    <fileset refid="portblue.libs.ear"/>
  </path>
  <mapper type="regexp"
          from=".*/([^/]*)$$"
          to="lib/\1"
  />
</pathconvert>

would do.  And once we get composite mappers, we could even do without
regular expressions.  A "flatten" mapper followed by "glob" from="*"
to="lib/*" would do.

I understand that this operation may be common to build a Class-Path
attribute for arbitrary manifests, so if we want to create specific
support for it, my target would be the manifest task rather than the
ear task as well.

Stefan

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


Mime
View raw message