You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Leonardo Abreu de Barros <le...@email.com> on 2003/10/01 17:14:02 UTC

Warn for includes not found?

Hi all,

I was requested to do something that I'm not sure if it's possible
using Ant...
People here are giving a patternset to the javac task of source files
to be compiled; this is because they want to be allowed to have other
java files in the source directories, test files for example, that
shouldn't be compiled during the project build.
The problem is: when someone mispells a file name, Ant ignores it. As
a result, the right file isn't compiled. So, they want Ant to warn or
crash when some include file is not found.
Is there a simple way to accomplish this?

thanks,
Leonardo A. Barros


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


RE: Warn for includes not found?

Posted by "W. Sean Hennessy" <sh...@goldenhourdata.com>.
Using a path in place of patternset due filtering nature of fileset
The remainder is left as exercise...
NOTE.  Properties renamed.

  <property name="bandeirabr.logic.dir" value="${basedir}"/>

    <path id="bandeirabr.logic.path">
    <pathelement location="${bandeirabr.logic.dir}/Role.java"/>
    <pathelement location="${bandeirabr.logic.dir}/User.java"/>
    <pathelement location="${bandeirabr.logic.dir}/UserException.java"/>
    <pathelement location="${bandeirabr.logic.dir}/Mispeled.java"/>
    </path>

<target name="chkthefiles" depends="clean-new-build-dir">
  <!-- using path as input to filelist -->
  <pathconvert property="expanded.patternset.as.path.prop" refid="bandeirabr.logic.path"
                 pathsep=" " >
     <!-- If you use naked filenames in the path definition you would not have to
          trim off the directory using map.
          filelist demands dir attribute without this we get directory/directory/file..
     -->
     <map from="${bandeirabr.logic.dir}" to=""/>
   </pathconvert>
  <filelist dir="${bandeirabr.logic.dir}" id="bandeirabr.flist" files="${expanded.patternset.as.path.prop}" />
  <foreach param="iterFilespec" target="tstfileexits">
   <path>   
       <filelist refid="bandeirabr.flist" />
   </path>
  </foreach>
</target>
<target name="tstfileexits">
<!-- -->
<if>
<not><available file="${iterFilespec}" /></not>
<then>
<echo message="${iterFilespec} does not exist!" />

</then>
</if>
</target>
</project>


-----Original Message-----
From: W. Sean Hennessy [mailto:shennessy@goldenhourdata.com] 
Sent: Thursday, October 02, 2003 4:01 PM
To: 'Ant Users List'
Subject: RE: Warn for includes not found?


Perhaps replace files attribute value wit reference to property which is Result of patternset expanded as path with
space replacing ${path.separator}. Bet archive has example of this expansion..

<property name="expanded.patternset.as.path.prop" >

<filelist dir="${bandeirabr.logic}" id="bandeirabr.flist" files="${expanded.patternset.as.path.prop}"

-----Original Message-----
From: Leonardo Abreu de Barros [mailto:leobarros@email.com] 
Sent: Thursday, October 02, 2003 2:53 PM
To: ant-user@jakarta.apache.org
Subject: Re: Warn for includes not found?


You've got the point, Sean, this would solve the problem, but now the problem is: how can I get a FileList from a
patternset?? :) I wouldn't like to have to rewrite all the file names again (there is a big bunch of them...)

Thanks a lot,
Leonardo


--- In apache-ant@yahoogroups.com, "W. Sean Hennessy" <sh...@g...>
wrote:
> Identifying files which do not exist is a bit different than
collecting files which do not match a filter.
> A FileSet is filtered which results in (Mispeled.java) being left
out of the selection.
> Using foreach one can iterate through a FileList and check each file
explicitly.
> Example below demonstrates FileList iteration.
> If you can generate a FileList from patternset you're almost there...
> 
> <?xml version="1.0"?>
> <project name="trythis" default="chkthefiles" basedir="."> <taskdef
> resource="net/sf/antcontrib/antcontrib.properties">
>   <classpath>
>        <pathelement
location="C:/Tools/ant-contrib-0.3/lib/ant-contrib-0.3.jar" />
>   </classpath>
> </taskdef>
> 
>   <property name="bandeirabr.logic" value="${basedir}"/>
> 
>   <patternset id="bandeirabr.logic">
>     <include name="${bandeirabr.logic}/Role.java"/>
>     <include name="${bandeirabr.logic}/User.java"/>
>     <include name="${bandeirabr.logic}/UserException.java"/>
>     <include name="${bandeirabr.logic}/Mispeled.java"/>
>   </patternset>
> 
>   <filelist dir="${bandeirabr.logic}" id="bandeirabr.flist"
files="Role.java User.java UserException.java Mispeled.java"
> />
> 
> 
> <target name="chkthefiles"
>  description="check through filelist.">
>   <foreach param="iterFilespec" target="tstfileexits">
>    <path>   
>        <filelist refid="bandeirabr.flist" />
>    </path>
>   </foreach>
> </target>
> <target name="tstfileexits"
>    description="test barks if param iterFilespec does not exist.">
> <!-- -->
> <if>
> <not><available file="${iterFilespec}" /></not>
> <then>
> <echo message="${iterFilespec} does not exist!" />
> 
> </then>
> </if>
> </target>
> </project>
> 
> -----Original Message-----
> From: Leonardo Abreu de Barros [mailto:leobarros@e...]
> Sent: Wednesday, October 01, 2003 11:33 AM
> To: ant-user@j...
> Subject: Re: Warn for includes not found?
> 
> 
> Hi Sean,
> 
> I'm not sure if I understand your answer, so I'm sending you a
snippet to get things clearer.
> 
> I have the following xml: 
>   <!-- Package bandeirabr.logic -->
>   <property name="bandeirabr.logic" value="bandeirabr/logic"/>
>   <patternset id="bandeirabr.logic">
>     <include name="${bandeirabr.logic}/Role.java"/>
>     <include name="${bandeirabr.logic}/User.java"/>
>     <include name="${bandeirabr.logic}/UserException.java"/>
>     <include name="${bandeirabr.logic}/Mispeled.java"/>
>   </patternset>
> 
>   <target name="compile" depends="update">
>     <javac srcdir="${src}" destdir="${build}" listfiles="true">
>       <patternset refid="bandeirabr.logic"/>
>     </javac>
>   </target>
> 
> As you may see, the file "Mispeled.java" is missing an "l". In
consequence of this, it doesn't get compiled. What I need
> is something that warns the programmer about his mistake.
> 
> thanks,
> Leonardo.
> 
> --- In apache-ant@yahoogroups.com, "W. Sean Hennessy" <sh...@g...>
> wrote:
> > Would not an exclude patternset help to identify file(s) that do not
> match the naming convention in the javac patternset
> > as a result of misspellings?
> > The build.xml could then generate a warning if the exclude
> patternset is not empty.
> > 
> > -----Original Message-----
> > From: Leonardo Abreu de Barros [mailto:leobarros@e...]
> > Sent: Wednesday, October 01, 2003 8:14 AM
> > To: ant-user@j...
> > Subject: Warn for includes not found?
> > 
> > 
> > Hi all,
> > 
> > I was requested to do something that I'm not sure if it's possible
> using Ant... People here are giving a patternset to
> > the javac task of source files to be compiled; this is because they
> want to be allowed to have other java files in the
> > source directories, test files for example, that shouldn't be
> compiled during the project build. The problem is: when
> > someone mispells a file name, Ant ignores it. As a result, the right
> file isn't compiled. So, they want Ant to warn or
> > crash when some include file is not found. Is there a simple way to
> accomplish this?
> > 
> > thanks,
> > Leonardo A. Barros
> > 
> > 
> > --------------------------------------------------------------------
> > -
> > To unsubscribe, e-mail: user-unsubscribe@a...
> > For additional commands, e-mail: user-help@a...
> > 
> > 
> > --------------------------------------------------------------------
> > -
> > To unsubscribe, e-mail: user-unsubscribe@a...
> > For additional commands, e-mail: user-help@a...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@a...
> For additional commands, e-mail: user-help@a...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@a...
> For additional commands, e-mail: user-help@a...


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


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


RE: Warn for includes not found?

Posted by "W. Sean Hennessy" <sh...@goldenhourdata.com>.
Perhaps replace files attribute value wit reference to property which is
Result of patternset expanded as path with space replacing ${path.separator}.
Bet archive has example of this expansion..

<property name="expanded.patternset.as.path.prop" >

<filelist dir="${bandeirabr.logic}" id="bandeirabr.flist"
files="${expanded.patternset.as.path.prop}"

-----Original Message-----
From: Leonardo Abreu de Barros [mailto:leobarros@email.com] 
Sent: Thursday, October 02, 2003 2:53 PM
To: ant-user@jakarta.apache.org
Subject: Re: Warn for includes not found?


You've got the point, Sean, this would solve the problem, but now the problem is: how can I get a FileList from a
patternset?? :) I wouldn't like to have to rewrite all the file names again (there is a big bunch of them...)

Thanks a lot,
Leonardo


--- In apache-ant@yahoogroups.com, "W. Sean Hennessy" <sh...@g...>
wrote:
> Identifying files which do not exist is a bit different than
collecting files which do not match a filter.
> A FileSet is filtered which results in (Mispeled.java) being left
out of the selection.
> Using foreach one can iterate through a FileList and check each file
explicitly.
> Example below demonstrates FileList iteration.
> If you can generate a FileList from patternset you're almost there...
> 
> <?xml version="1.0"?>
> <project name="trythis" default="chkthefiles" basedir="."> <taskdef 
> resource="net/sf/antcontrib/antcontrib.properties">
>   <classpath>
>        <pathelement
location="C:/Tools/ant-contrib-0.3/lib/ant-contrib-0.3.jar" />
>   </classpath>
> </taskdef>
> 
>   <property name="bandeirabr.logic" value="${basedir}"/>
> 
>   <patternset id="bandeirabr.logic">
>     <include name="${bandeirabr.logic}/Role.java"/>
>     <include name="${bandeirabr.logic}/User.java"/>
>     <include name="${bandeirabr.logic}/UserException.java"/>
>     <include name="${bandeirabr.logic}/Mispeled.java"/>
>   </patternset>
> 
>   <filelist dir="${bandeirabr.logic}" id="bandeirabr.flist"
files="Role.java User.java UserException.java Mispeled.java"
> />
> 
> 
> <target name="chkthefiles"
>  description="check through filelist.">
>   <foreach param="iterFilespec" target="tstfileexits">
>    <path>   
>        <filelist refid="bandeirabr.flist" />
>    </path>
>   </foreach>
> </target>
> <target name="tstfileexits"
>    description="test barks if param iterFilespec does not exist.">
> <!-- -->
> <if>
> <not><available file="${iterFilespec}" /></not>
> <then>
> <echo message="${iterFilespec} does not exist!" />
> 
> </then>
> </if>
> </target>
> </project>
> 
> -----Original Message-----
> From: Leonardo Abreu de Barros [mailto:leobarros@e...]
> Sent: Wednesday, October 01, 2003 11:33 AM
> To: ant-user@j...
> Subject: Re: Warn for includes not found?
> 
> 
> Hi Sean,
> 
> I'm not sure if I understand your answer, so I'm sending you a
snippet to get things clearer.
> 
> I have the following xml: 
>   <!-- Package bandeirabr.logic -->
>   <property name="bandeirabr.logic" value="bandeirabr/logic"/>
>   <patternset id="bandeirabr.logic">
>     <include name="${bandeirabr.logic}/Role.java"/>
>     <include name="${bandeirabr.logic}/User.java"/>
>     <include name="${bandeirabr.logic}/UserException.java"/>
>     <include name="${bandeirabr.logic}/Mispeled.java"/>
>   </patternset>
> 
>   <target name="compile" depends="update">
>     <javac srcdir="${src}" destdir="${build}" listfiles="true">
>       <patternset refid="bandeirabr.logic"/>
>     </javac>
>   </target>
> 
> As you may see, the file "Mispeled.java" is missing an "l". In
consequence of this, it doesn't get compiled. What I need
> is something that warns the programmer about his mistake.
> 
> thanks,
> Leonardo.
> 
> --- In apache-ant@yahoogroups.com, "W. Sean Hennessy" <sh...@g...>
> wrote:
> > Would not an exclude patternset help to identify file(s) that do not
> match the naming convention in the javac patternset
> > as a result of misspellings?
> > The build.xml could then generate a warning if the exclude
> patternset is not empty.
> > 
> > -----Original Message-----
> > From: Leonardo Abreu de Barros [mailto:leobarros@e...]
> > Sent: Wednesday, October 01, 2003 8:14 AM
> > To: ant-user@j...
> > Subject: Warn for includes not found?
> > 
> > 
> > Hi all,
> > 
> > I was requested to do something that I'm not sure if it's possible
> using Ant... People here are giving a patternset to
> > the javac task of source files to be compiled; this is because they
> want to be allowed to have other java files in the
> > source directories, test files for example, that shouldn't be
> compiled during the project build. The problem is: when
> > someone mispells a file name, Ant ignores it. As a result, the right
> file isn't compiled. So, they want Ant to warn or
> > crash when some include file is not found. Is there a simple way to
> accomplish this?
> > 
> > thanks,
> > Leonardo A. Barros
> > 
> > 
> > --------------------------------------------------------------------
> > -
> > To unsubscribe, e-mail: user-unsubscribe@a...
> > For additional commands, e-mail: user-help@a...
> > 
> > 
> > --------------------------------------------------------------------
> > -
> > To unsubscribe, e-mail: user-unsubscribe@a...
> > For additional commands, e-mail: user-help@a...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@a...
> For additional commands, e-mail: user-help@a...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@a...
> For additional commands, e-mail: user-help@a...


---------------------------------------------------------------------
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: Warn for includes not found?

Posted by Leonardo Abreu de Barros <le...@email.com>.
You've got the point, Sean, this would solve the problem, but now the
problem is: how can I get a FileList from a patternset?? :) I wouldn't
like to have to rewrite all the file names again (there is a big bunch
of them...)

Thanks a lot,
Leonardo


--- In apache-ant@yahoogroups.com, "W. Sean Hennessy" <sh...@g...>
wrote:
> Identifying files which do not exist is a bit different than
collecting files which do not match a filter.
> A FileSet is filtered which results in (Mispeled.java) being left
out of the selection.
> Using foreach one can iterate through a FileList and check each file
explicitly.
> Example below demonstrates FileList iteration.
> If you can generate a FileList from patternset you're almost there...
> 
> <?xml version="1.0"?>
> <project name="trythis" default="chkthefiles" basedir=".">
> <taskdef resource="net/sf/antcontrib/antcontrib.properties">
>   <classpath>
>        <pathelement
location="C:/Tools/ant-contrib-0.3/lib/ant-contrib-0.3.jar" />
>   </classpath>
> </taskdef>
> 
>   <property name="bandeirabr.logic" value="${basedir}"/>
> 
>   <patternset id="bandeirabr.logic">
>     <include name="${bandeirabr.logic}/Role.java"/>
>     <include name="${bandeirabr.logic}/User.java"/>
>     <include name="${bandeirabr.logic}/UserException.java"/>
>     <include name="${bandeirabr.logic}/Mispeled.java"/>
>   </patternset>
> 
>   <filelist dir="${bandeirabr.logic}" id="bandeirabr.flist"
files="Role.java User.java UserException.java Mispeled.java"
> />
> 
> 
> <target name="chkthefiles"
>  description="check through filelist.">
>   <foreach param="iterFilespec" target="tstfileexits">
>    <path>   
>        <filelist refid="bandeirabr.flist" />
>    </path>
>   </foreach>
> </target>
> <target name="tstfileexits"
>    description="test barks if param iterFilespec does not exist.">
> <!-- -->
> <if>
> <not><available file="${iterFilespec}" /></not>
> <then>
> <echo message="${iterFilespec} does not exist!" />
> 
> </then>
> </if>
> </target>
> </project>
> 
> -----Original Message-----
> From: Leonardo Abreu de Barros [mailto:leobarros@e...] 
> Sent: Wednesday, October 01, 2003 11:33 AM
> To: ant-user@j...
> Subject: Re: Warn for includes not found?
> 
> 
> Hi Sean,
> 
> I'm not sure if I understand your answer, so I'm sending you a
snippet to get things clearer.
> 
> I have the following xml: 
>   <!-- Package bandeirabr.logic -->
>   <property name="bandeirabr.logic" value="bandeirabr/logic"/>
>   <patternset id="bandeirabr.logic">
>     <include name="${bandeirabr.logic}/Role.java"/>
>     <include name="${bandeirabr.logic}/User.java"/>
>     <include name="${bandeirabr.logic}/UserException.java"/>
>     <include name="${bandeirabr.logic}/Mispeled.java"/>
>   </patternset>
> 
>   <target name="compile" depends="update">
>     <javac srcdir="${src}" destdir="${build}" listfiles="true">
>       <patternset refid="bandeirabr.logic"/>
>     </javac>
>   </target>
> 
> As you may see, the file "Mispeled.java" is missing an "l". In
consequence of this, it doesn't get compiled. What I need
> is something that warns the programmer about his mistake.
> 
> thanks,
> Leonardo.
> 
> --- In apache-ant@yahoogroups.com, "W. Sean Hennessy" <sh...@g...>
> wrote:
> > Would not an exclude patternset help to identify file(s) that do not
> match the naming convention in the javac patternset
> > as a result of misspellings?
> > The build.xml could then generate a warning if the exclude
> patternset is not empty.
> > 
> > -----Original Message-----
> > From: Leonardo Abreu de Barros [mailto:leobarros@e...]
> > Sent: Wednesday, October 01, 2003 8:14 AM
> > To: ant-user@j...
> > Subject: Warn for includes not found?
> > 
> > 
> > Hi all,
> > 
> > I was requested to do something that I'm not sure if it's possible
> using Ant... People here are giving a patternset to
> > the javac task of source files to be compiled; this is because they
> want to be allowed to have other java files in the
> > source directories, test files for example, that shouldn't be
> compiled during the project build. The problem is: when
> > someone mispells a file name, Ant ignores it. As a result, the right
> file isn't compiled. So, they want Ant to warn or
> > crash when some include file is not found. Is there a simple way to
> accomplish this?
> > 
> > thanks,
> > Leonardo A. Barros
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@a...
> > For additional commands, e-mail: user-help@a...
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@a...
> > For additional commands, e-mail: user-help@a...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@a...
> For additional commands, e-mail: user-help@a...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@a...
> For additional commands, e-mail: user-help@a...


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


RE: Warn for includes not found?

Posted by "W. Sean Hennessy" <sh...@goldenhourdata.com>.
Identifying files which do not exist is a bit different than collecting files which do not match a filter.
A FileSet is filtered which results in (Mispeled.java) being left out of the selection.
Using foreach one can iterate through a FileList and check each file explicitly.
Example below demonstrates FileList iteration.
If you can generate a FileList from patternset you're almost there...

<?xml version="1.0"?>
<project name="trythis" default="chkthefiles" basedir=".">
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
  <classpath>
       <pathelement location="C:/Tools/ant-contrib-0.3/lib/ant-contrib-0.3.jar" />
  </classpath>
</taskdef>

  <property name="bandeirabr.logic" value="${basedir}"/>

  <patternset id="bandeirabr.logic">
    <include name="${bandeirabr.logic}/Role.java"/>
    <include name="${bandeirabr.logic}/User.java"/>
    <include name="${bandeirabr.logic}/UserException.java"/>
    <include name="${bandeirabr.logic}/Mispeled.java"/>
  </patternset>

  <filelist dir="${bandeirabr.logic}" id="bandeirabr.flist" files="Role.java User.java UserException.java Mispeled.java"
/>


<target name="chkthefiles"
 description="check through filelist.">
  <foreach param="iterFilespec" target="tstfileexits">
   <path>   
       <filelist refid="bandeirabr.flist" />
   </path>
  </foreach>
</target>
<target name="tstfileexits"
   description="test barks if param iterFilespec does not exist.">
<!-- -->
<if>
<not><available file="${iterFilespec}" /></not>
<then>
<echo message="${iterFilespec} does not exist!" />

</then>
</if>
</target>
</project>

-----Original Message-----
From: Leonardo Abreu de Barros [mailto:leobarros@email.com] 
Sent: Wednesday, October 01, 2003 11:33 AM
To: ant-user@jakarta.apache.org
Subject: Re: Warn for includes not found?


Hi Sean,

I'm not sure if I understand your answer, so I'm sending you a snippet to get things clearer.

I have the following xml: 
  <!-- Package bandeirabr.logic -->
  <property name="bandeirabr.logic" value="bandeirabr/logic"/>
  <patternset id="bandeirabr.logic">
    <include name="${bandeirabr.logic}/Role.java"/>
    <include name="${bandeirabr.logic}/User.java"/>
    <include name="${bandeirabr.logic}/UserException.java"/>
    <include name="${bandeirabr.logic}/Mispeled.java"/>
  </patternset>

  <target name="compile" depends="update">
    <javac srcdir="${src}" destdir="${build}" listfiles="true">
      <patternset refid="bandeirabr.logic"/>
    </javac>
  </target>

As you may see, the file "Mispeled.java" is missing an "l". In consequence of this, it doesn't get compiled. What I need
is something that warns the programmer about his mistake.

thanks,
Leonardo.

--- In apache-ant@yahoogroups.com, "W. Sean Hennessy" <sh...@g...>
wrote:
> Would not an exclude patternset help to identify file(s) that do not
match the naming convention in the javac patternset
> as a result of misspellings?
> The build.xml could then generate a warning if the exclude
patternset is not empty.
> 
> -----Original Message-----
> From: Leonardo Abreu de Barros [mailto:leobarros@e...]
> Sent: Wednesday, October 01, 2003 8:14 AM
> To: ant-user@j...
> Subject: Warn for includes not found?
> 
> 
> Hi all,
> 
> I was requested to do something that I'm not sure if it's possible
using Ant... People here are giving a patternset to
> the javac task of source files to be compiled; this is because they
want to be allowed to have other java files in the
> source directories, test files for example, that shouldn't be
compiled during the project build. The problem is: when
> someone mispells a file name, Ant ignores it. As a result, the right
file isn't compiled. So, they want Ant to warn or
> crash when some include file is not found. Is there a simple way to
accomplish this?
> 
> thanks,
> Leonardo A. Barros
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@a...
> For additional commands, e-mail: user-help@a...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@a...
> For additional commands, e-mail: user-help@a...


---------------------------------------------------------------------
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: Warn for includes not found?

Posted by Leonardo Abreu de Barros <le...@email.com>.
Hi Sean,

I'm not sure if I understand your answer, so I'm sending you a snippet
to get things clearer.

I have the following xml: 
  <!-- Package bandeirabr.logic -->
  <property name="bandeirabr.logic" value="bandeirabr/logic"/>
  <patternset id="bandeirabr.logic">
    <include name="${bandeirabr.logic}/Role.java"/>
    <include name="${bandeirabr.logic}/User.java"/>
    <include name="${bandeirabr.logic}/UserException.java"/>
    <include name="${bandeirabr.logic}/Mispeled.java"/>
  </patternset>

  <target name="compile" depends="update">
    <javac srcdir="${src}" destdir="${build}" listfiles="true">
      <patternset refid="bandeirabr.logic"/>
    </javac>
  </target>

As you may see, the file "Mispeled.java" is missing an "l". In
consequence of this, it doesn't get compiled. What I need is something
that warns the programmer about his mistake.

thanks,
Leonardo.

--- In apache-ant@yahoogroups.com, "W. Sean Hennessy" <sh...@g...>
wrote:
> Would not an exclude patternset help to identify file(s) that do not
match the naming convention in the javac patternset
> as a result of misspellings?
> The build.xml could then generate a warning if the exclude
patternset is not empty.
> 
> -----Original Message-----
> From: Leonardo Abreu de Barros [mailto:leobarros@e...] 
> Sent: Wednesday, October 01, 2003 8:14 AM
> To: ant-user@j...
> Subject: Warn for includes not found?
> 
> 
> Hi all,
> 
> I was requested to do something that I'm not sure if it's possible
using Ant... People here are giving a patternset to
> the javac task of source files to be compiled; this is because they
want to be allowed to have other java files in the
> source directories, test files for example, that shouldn't be
compiled during the project build. The problem is: when
> someone mispells a file name, Ant ignores it. As a result, the right
file isn't compiled. So, they want Ant to warn or
> crash when some include file is not found. Is there a simple way to
accomplish this?
> 
> thanks,
> Leonardo A. Barros
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@a...
> For additional commands, e-mail: user-help@a...
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@a...
> For additional commands, e-mail: user-help@a...


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


RE: Warn for includes not found?

Posted by "W. Sean Hennessy" <sh...@goldenhourdata.com>.
Would not an exclude patternset help to identify file(s) that do not match the naming convention in the javac patternset
as a result of misspellings?
The build.xml could then generate a warning if the exclude patternset is not empty.

-----Original Message-----
From: Leonardo Abreu de Barros [mailto:leobarros@email.com] 
Sent: Wednesday, October 01, 2003 8:14 AM
To: ant-user@jakarta.apache.org
Subject: Warn for includes not found?


Hi all,

I was requested to do something that I'm not sure if it's possible using Ant... People here are giving a patternset to
the javac task of source files to be compiled; this is because they want to be allowed to have other java files in the
source directories, test files for example, that shouldn't be compiled during the project build. The problem is: when
someone mispells a file name, Ant ignores it. As a result, the right file isn't compiled. So, they want Ant to warn or
crash when some include file is not found. Is there a simple way to accomplish this?

thanks,
Leonardo A. Barros


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