What about this little variation?

  <patternset id="allJarsAndZips">
      <include name="**/*.jar"/>
      <include name="**/*.zip"/>
  </patternset>

  <path id="base.classpath.path">
      <pathelement path="${basedir}"/>
      <pathelement path="${classesDir}"/>
      <fileset dir="${productionLibDir}">
           <patternset refid="allJarsAndZips"/>
      </fileset>
  </path>

  <patternset id="allJarsAndZipsMinus">
      <patternset refid="allJarsAndZips" />
      <exclude name="${data_jarName}" />
  </patternset>

  <path id="classpath.data.path">
      <fileset dir="${distDir}" >
          <patternset refid="allJarsAndZipsMinus" />
      </fileset>
      <fileset dir="${productionLibDir}" >
          <patternset refid="allJarsAndZipsMinus" />
      </fileset>
      <path refid="base.classpath.path"/>
  </path>

  <path id="classpath.path">
      <fileset dir="${distDir}">
           <patternset refid="allJarsAndZips"/>
      </fileset>
      <fileset dir="${libDir}">
           <patternset refid="allJarsAndZips"/>
      </fileset>
      <path refid="base.classpath.path"/>
  </path>

I believe this results in more 'reuse', although it doesn't look any
simpler... --DD

-----Original Message-----
From: Stefan Bodewig [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 18, 2002 8:56 AM
To: [EMAIL PROTECTED]
Subject: Re: is there any way to modify a classpath that referenced with r
efid ?

On Thu, 18 Jul 2002, Nolan Ring <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

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

Reply via email to