You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Hans Deragon <ha...@deragon.biz> on 2004/08/28 16:46:11 UTC

Cannot get exclude attribute to work in a dirset.

Greetings.


  Using 1.6.2 here.  I am trying to exclude any directory which would contain
the string "old" in its name.  Following the snippet of my build.xml:

    <javac debug="on" verbose="off" destdir="${build}">
      <src>
        <dirset dir="/data/devel/java">
          <exclude name="**/*old*/**"/>
          <exclude name="**/*old*"/>
          <exclude name="**/*old"/>
          <exclude name="*old*"/>
        </dirset>
      </src>
    </javac>

  Yet, when I run, I see:

    [javac] StockDB.old/CieDesc.java added as StockDB.old/CieDesc.class
doesn't exist.

  First, anybody has a clue why StockDB.old is included in the list even
though I try to explicitly exclude any "old" directories?

  Second, is there a feature in ant where one could simply test
dirsets/filesets (without coding)?  It would be nice if one could create a
test build.xml file with only dirsets/filesets and have the results printed on
screen, to test if the patterns are ok.


Best regards,
Hans Deragon
--
Consultant en informatique/Software Consultant
Deragon Informatique inc.     Open source:
http://www.deragon.biz        http://facil.qc.ca (Promotion du libre)
mailto://hans@deragon.biz     http://autopoweroff.sourceforge.net (Logiciel)

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


Re: Cannot get exclude attribute to work in a dirset.

Posted by Hans Deragon <ha...@deragon.biz>.
Bill Rich wrote:
> Try running the javac from the command line to see what it does. If it does
> the same thing then it is something to do with the behavior of javac or
> something to do with the dependencies within the source files that are being
> compiled.

javac requires source files.  You cannot simply provide a source directory to
it.  Thus ant must provide to javac all the files it got by scanning the
directories I provided.  Seams like a bug...

> Another thing to try is running ant with -v to get the verbose output and
> see if you can grock anything from that.

I did.  Nothing more comes out. :(

> HTH
> 
> Bill Rich
> Wilandra Consulting LLC

Best regards,
Hans Deragon
--
Consultant en informatique/Software Consultant
Deragon Informatique inc.     Open source:
http://www.deragon.biz        http://facil.qc.ca (Promotion du libre)
mailto://hans@deragon.biz     http://autopoweroff.sourceforge.net (Logiciel)

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


RE: Cannot get exclude attribute to work in a dirset.

Posted by Bill Rich <bi...@attglobal.net>.
Try running the javac from the command line to see what it does. If it does
the same thing then it is something to do with the behavior of javac or
something to do with the dependencies within the source files that are being
compiled.

Another thing to try is running ant with -v to get the verbose output and
see if you can grock anything from that.

HTH

Bill Rich
Wilandra Consulting LLC
1325 Addiewell Place
San Jose, CA  95120-3905
phone:      +1 408 268-2452
mobile:     +1 408 410-9713
Santa Cruz: +1 831 464-9007
fax:        +1 413 669-9716
billrich@wilandra.com or billrich@attglobal.net
http://www.wilandra.com 

-----Original Message-----
From: Hans Deragon [mailto:hans@deragon.biz] 
Sent: Saturday, August 28, 2004 9:40 AM
To: Ant Users List
Subject: Re: Cannot get exclude attribute to work in a dirset.

Bill Rich wrote:
> Try something like this to see what is in the dirset then you can 
> tinker around with it until you get what you want.
> 
> <path id="apath">
>   <dirset dir="${env.ANT_HOME}">
>     <include name="**/**"/>
>   </dirset>
> </path>
> <pathconvert refid="apath" property="ap" targetos="windows"/> <echo 
> message="A path is [${ap}]"/>
> 
> HTH
> 
> Bill Rich
> Wilandra Consulting LLC

Thanks for the tip.  The printed path is ok, i.e. does not contains any .old
directory, yet javac still goes into a .old directory:

[javac] StockDB.old/CieShareBrowser.java added as
StockDB.old/CieShareBrowser.class doesn't exist.

Here is what I tried.

  <path id="srcpath">
    <dirset dir="/data/devel/java">
      <exclude name="**/*old*/**"/>
      <exclude name="**/*obs*/**"/>
      <exclude name="**/*org*/**"/>
    </dirset>
  </path>
  <pathconvert refid="srcpath" property="srcpathprop" targetos="unix"/>
  <echo message="srcpath is [${srcpathprop}]"/>
  <javac debug="on" verbose="on" destdir="${build}">
    <src refid="srcpath"/>
  </javac>

The output looks like:

[echo] srcpath is
[/data/devel/java:/data/devel/java/Gui:/data/devel/java/Utilities:/data/deve
l/java/Utilities/Pcap:...

Could it be that because /data/devel/java is included, javac recursively
goes through that directory ignoring the exclusions?


Best regards,
Hans Deragon
--
Consultant en informatique/Software Consultant
Deragon Informatique inc.     Open source:
http://www.deragon.biz        http://facil.qc.ca (Promotion du libre)
mailto://hans@deragon.biz     http://autopoweroff.sourceforge.net (Logiciel)

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




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


Re: Cannot get exclude attribute to work in a dirset.

Posted by Hans Deragon <ha...@deragon.biz>.
Bill Rich wrote:
> Try something like this to see what is in the dirset then you can tinker
> around with it until you get what you want.
> 
> <path id="apath">
>   <dirset dir="${env.ANT_HOME}">
>     <include name="**/**"/>
>   </dirset>
> </path>
> <pathconvert refid="apath" property="ap" targetos="windows"/>
> <echo message="A path is [${ap}]"/>
> 
> HTH
> 
> Bill Rich
> Wilandra Consulting LLC

Thanks for the tip.  The printed path is ok, i.e. does not contains any .old
directory, yet javac still goes into a .old directory:

[javac] StockDB.old/CieShareBrowser.java added as
StockDB.old/CieShareBrowser.class doesn't exist.

Here is what I tried.

  <path id="srcpath">
    <dirset dir="/data/devel/java">
      <exclude name="**/*old*/**"/>
      <exclude name="**/*obs*/**"/>
      <exclude name="**/*org*/**"/>
    </dirset>
  </path>
  <pathconvert refid="srcpath" property="srcpathprop" targetos="unix"/>
  <echo message="srcpath is [${srcpathprop}]"/>
  <javac debug="on" verbose="on" destdir="${build}">
    <src refid="srcpath"/>
  </javac>

The output looks like:

[echo] srcpath is
[/data/devel/java:/data/devel/java/Gui:/data/devel/java/Utilities:/data/devel/java/Utilities/Pcap:...

Could it be that because /data/devel/java is included, javac recursively goes
through that directory ignoring the exclusions?


Best regards,
Hans Deragon
--
Consultant en informatique/Software Consultant
Deragon Informatique inc.     Open source:
http://www.deragon.biz        http://facil.qc.ca (Promotion du libre)
mailto://hans@deragon.biz     http://autopoweroff.sourceforge.net (Logiciel)

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


RE: Cannot get exclude attribute to work in a dirset.

Posted by Bill Rich <bi...@attglobal.net>.
Try something like this to see what is in the dirset then you can tinker
around with it until you get what you want.

<path id="apath">
  <dirset dir="${env.ANT_HOME}">
    <include name="**/**"/>
  </dirset>
</path>
<pathconvert refid="apath" property="ap" targetos="windows"/>
<echo message="A path is [${ap}]"/>

HTH

Bill Rich
Wilandra Consulting LLC
1325 Addiewell Place
San Jose, CA  95120-3905
phone:      +1 408 268-2452
mobile:     +1 408 410-9713
Santa Cruz: +1 831 464-9007
fax:        +1 413 669-9716
billrich@wilandra.com or billrich@attglobal.net
http://www.wilandra.com
-----Original Message-----
From: Hans Deragon [mailto:hans@deragon.biz] 
Sent: Saturday, August 28, 2004 7:46 AM
To: user@ant.apache.org
Subject: Cannot get exclude attribute to work in a dirset.

Greetings.


  Using 1.6.2 here.  I am trying to exclude any directory which would
contain the string "old" in its name.  Following the snippet of my
build.xml:

    <javac debug="on" verbose="off" destdir="${build}">
      <src>
        <dirset dir="/data/devel/java">
          <exclude name="**/*old*/**"/>
          <exclude name="**/*old*"/>
          <exclude name="**/*old"/>
          <exclude name="*old*"/>
        </dirset>
      </src>
    </javac>

  Yet, when I run, I see:

    [javac] StockDB.old/CieDesc.java added as StockDB.old/CieDesc.class
doesn't exist.

  First, anybody has a clue why StockDB.old is included in the list even
though I try to explicitly exclude any "old" directories?

  Second, is there a feature in ant where one could simply test
dirsets/filesets (without coding)?  It would be nice if one could create a
test build.xml file with only dirsets/filesets and have the results printed
on screen, to test if the patterns are ok.


Best regards,
Hans Deragon
--
Consultant en informatique/Software Consultant
Deragon Informatique inc.     Open source:
http://www.deragon.biz        http://facil.qc.ca (Promotion du libre)
mailto://hans@deragon.biz     http://autopoweroff.sourceforge.net (Logiciel)

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




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