Merlin users/developers,

I've completed the addition of a new feature in merlin this week that provides support for an Ant-like fileset directive for classpath specification.

This feature is included in the latest CVS of the avalon/utils, avalon/composition-api, and avalon/composition-impl packages. This feature is slated to be part of the upcoming Merlin v3.3 release. But maybe Steve could grace us with an interim binary snapshot release, possibly?

Anyway... I'll be updating the site documentation soon, but in the meantime, here are a few examples of how you can use the fileset directive for classpath specification.

*Example 1: Include a directory-only in a classpath specification*
This example, which contains only a *dir* attribute, will include only the given d:/my-java-libs directory in the application classpath -- it
will NOT include any files or subdirectory's in that directory.


   <classloader>
      <classpath>

         <!-- normal repo links here -->
         <repository>
            <resource id="avalon-db:avalon-db-api" version="0.9.0"/>
         </repository>

         <!-- new fileset usages -->
         <fileset dir="d:/my-java-libs"/>

      </classpath>
   </classloader>

*Example 2: Include certain files matching a wildcard specification in given directory*
This example, which contains both a *dir* attribute and an *include* directive, will include all the files with .jar file extension in the d:/my-java-libs directory in the application classpath.


   <classloader>
      <classpath>
         <repository>
            <resource id="avalon-db:avalon-db-api" version="0.9.0"/>
         </repository>
         <fileset dir="d:/my-java-libs">
            <include name="*.jar"/>
         </filset
      </classpath>
   </classloader>

*Example 3: Exclusion of certain files matching a wildcard specification*
This example is the same as #2, but excludes files that have "-dev" as part of the filename.


   <classloader>
      <classpath>
         <repository>
            <resource id="avalon-db:avalon-db-api" version="0.9.0"/>
         </repository>
         <fileset dir="d:/my-java-libs">
            <include name="*.jar"/>
            <exclude name="*-dev*/>
         </filset
      </classpath>
   </classloader>

*Example 4: Directory tree inclusion/exclusion*
This example includes all files with a .jar file extension in given directory and in all it's subsequent sub-directories.


   <classloader>
      <classpath>
         <repository>
            <resource id="avalon-db:avalon-db-api" version="0.9.0"/>
         </repository>
         <fileset dir="d:/my-java-libs">
            <include name="**/*.jar"/>
         </filset
      </classpath>
   </classloader>


With the notable exception of Example #1, care has been taken to preserve as much of the Ant fileset pattern semantics as possible. Any other exceptions that are discovered will be documented along with the fileset documentation on the Avalon site.


Regards and enjoy,
Timothy


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to