On Wed, 3 Mar 2004, Craig Berry <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to