ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nolan Ring <Nolan.R...@Sun.Com>
Subject RE: is there any way to modify a classpath that referenced with r efid ?
Date Thu, 18 Jul 2002 13:43:28 GMT
Thanks for your quick response.

I'm not quite sure I understand what you're suggesting.  I have a couple of
directories with many jar files in them - the generic classpath
(classpath.path) includes all jar files in the ${distDir} and
${productionLibDir} directories using a **/*.jar.  For each target in my
buildfile, however, I want to be able to exclude a *different* jar file.
So, the expanded version of what I sent previously would be something like:

<path id="classpath.path">
      <pathelement path="${basedir}"/>
      <pathelement path="${classesDir}"/>
      <fileset dir="${distDir}">
          <include name="**/*.jar"/>
          <include name="**/*.zip"/>
      </fileset>
      <fileset dir="${libDir}">
          <include name="**/*.jar"/>
          <include name="**/*.zip"/>
      </fileset>
      <fileset dir="${productionLibDir}">
          <include name="**/*.jar"/>
          <include name="**/*.zip"/>
      </fileset>
  </path>
  <path id="classpath.data.path">
      <fileset dir="${distDir}" >
         <exclude name="${data_jarName}" />
      </fileset>
      <fileset dir="${productionLibDir}" >
         <exclude name="${data_jarName}" />
      </fileset>
      <path refid="classpath.path"/>
  </path>
  <path id="classpath.util.path">
      <fileset dir="${distDir}" >
         <exclude name="${util_jarName}" />
      </fileset>
      <fileset dir="${productionLibDir}" >
         <exclude name="${util_jarName}" />
      </fileset>
      <path refid="classpath.path"/>
  </path>
  <path id="classpath.service.path">
      <fileset dir="${distDir}" >
         <exclude name="${service_jarName}" />
      </fileset>
      <fileset dir="${productionLibDir}" >
         <exclude name="${service_jarName}" />
      </fileset>
      <path refid="classpath.path"/>
  </path>

Does that make sense?   Am I missing something?  

Nolan

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Thursday, July 18, 2002 9:26 AM
To: ant-user@jakarta.apache.org
Subject: Re: is there any way to modify a classpath that referenced with
refid ?


On Thu, 18 Jul 2002, Nolan Ring <Nolan.Ring@Sun.Com> wrote:

> I've defined a classpath and assigned it the id "classpath.path" ;
> it's a path that I want to use throughout my buildfile with very
> minor modifications.  What I want to do is exclude a particular jar
> file that would otherwise be included because of the wildcards in
> the original definition.

And you can build compound <path>s:

<path id="path-without-the-jar">
 ...
</path>

<path id="with-the-jar">
  <path refid="path-without-the-jar" />
  <fileset ...>
</path>

and use the first path whenever you want to exclude the extra jar and
the second one where you need it.

Stefan

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

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


Mime
View raw message