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 15:12:47 GMT
Thanks very much.  As you said it's not pretty but it *does* work.

Nolan

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


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

> For each target in my buildfile, however, I want to be able to
> exclude a *different* jar file.

Argh.

> 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>

So you'd do something like

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

  <path id="classpath.path">
      <fileset dir="${distDir}">
          <include name="**/*.jar"/>
          <include name="**/*.zip"/>
      </fileset>
      <fileset dir="${libDir}">
          <include name="**/*.jar"/>
          <include name="**/*.zip"/>
      </fileset>
      <path refid="base.classpath.path"/>
  </path>

i.e. build a basic path that includes all common parts and add
filesets for each target in a different path - finally create a full
classpath for the targets that don't need exceptions.

Ugly, but I cannot think of a better solution ATM.

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