ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From walkingMan <nsew...@gmail.com>
Subject Re: Excluding files from the apt tool
Date Wed, 21 Nov 2007 19:15:14 GMT

Your ant script change below worked!

THanks


David Weintraub wrote:
> 
> Have you tried using <fileset> to define your source instead of the
> "sourcepath" attribute?
> 
> <target name="build" depends="clean">
> <apt
>     fork="true"
>     debug="true"
>     verbose="yes"
>     destdir="${target.dir}">
>     <classpath>
>        <path refid="jaxws.classpath"/>
>        <pathelement location="${source.dir}"/>
>     </classpath>
>     <option key="r" value="${target.dir}"/>
> *     <src dir="${source.dir}">
>        <exclude name="**/log4j.properties"/>
>     </src>
> *</apt>
> </apt>
> 
> On Nov 21, 2007 12:11 PM, walkingMan <nseward@gmail.com> wrote:
>>
>>
>> Hi,
>>
>> I am using an ant script to build a war file. But before it can do that
>> it
>> must process some annotations in some source files. In my src directory
> are
>> all my .java files plus a log4j.properties file.
>> I pass in the source directory to the apt ant task but it complains about
>> the log4j.properties file being an invalid flag.
>>
>> Here is the apt output (a bit messy):
>> build:
>> [apt] command line: apt "C:\Program
> Files\Java\jdk1.5.0_11\jre\bin\java.exe"
>> -classpath "C:\Program Files\Java\jdk1.5.0_11\lib\tools.jar;C:\Nick\me
>> tro\lib\webservices-api.jar;C:\Nick\metro\lib\webservices-extra-api.jar
> ;C:\Nick\metro\lib\webservices-extra.jar;C:\Nick\metro\lib\webservices-
> rt.jar;C:\N
>> ick\metro\lib\webservices-tools.jar
> ;C:\Nick\dev\EclipseSessions5\WebServices\src"
>> com.sun.tools.apt.Main -d C:\Nick\dev\EclipseSessions5\WebServices\bin
>> -sourcepath C:\Nick\dev\EclipseSessions5\WebServices\src -g -verbose
>> -Ar=C:/Nick/dev/EclipseSessions5/WebServices/bin
>> C:\Nick\dev\EclipseSessions5\WebSer
>> vices\src\org\echn\WebServices\servlet\SystemConfig.java
>>
> C:\Nick\dev\EclipseSessions5\WebServices\src\org\echn\WebServices\command\ICommands.java
>> C:\Nick
>>
> \dev\EclipseSessions5\WebServices\src\org\echn\WebServices\log4j.properties
>>
> C:\Nick\dev\EclipseSessions5\WebServices\src\org\echn\WebServices\db\commands
>> \WSPatientSearchCmd.java
>>
> C:\Nick\dev\EclipseSessions5\WebServices\src\org\echn\WebServices\beans\WSSearchResult.java
>> C:\Nick\dev\EclipseSessions5\WebServ
>> ices\src\org\echn\WebServices\AddNumbersException.java
>>
> C:\Nick\dev\EclipseSessions5\WebServices\src\org\echn\WebServices\command\CommandFactory.java
>> C:\N
>>
> ick\dev\EclipseSessions5\WebServices\src\org\echn\WebServices\AddNumbers.java
>> [apt] apt: invalid flag:
>>
> C:\Nick\dev\EclipseSessions5\WebServices\src\org\echn\WebServices\log4j.properties
>> [apt] Usage: apt <apt and javac options> <source files>
>> [apt] where apt options include:
>> [apt] -classpath <path> Specify where to find user class files and
>> annotation processor factories
>> [apt] -cp <path> Specify where to find user class files and annotation
>> processor factories
>> [apt] -d <path> Specify where to place processor and javac generated
>> class
>> files
>> [apt] -s <path> Specify where to place processor generated source files
>> [apt] -source <release> Provide source compatibility with specified
> release
>> [apt] -version Version information
>> [apt] -help Print a synopsis of standard options; use javac -help for
>> more
>> options
>> [apt] -X Print a synopsis of nonstandard options
>> [apt] -J<flag> Pass <flag> directly to the runtime system
>> [apt] -A[key[=value]] Options to pass to annotation processors
>> [apt] -nocompile Do not compile source files to class files
>> [apt] -print Print out textual representation of specified types
>> [apt] -factorypath <path> Specify where to find annotation processor
>> factories
>> [apt] -factory <class> Name of AnnotationProcessorFactory to use;
>> bypasses
>> default discovery process
>> [apt] See javac -help for information on javac options.
>> [apt]
>>
>> BUILD FAILED
>>
>> Here is the portion of the ant script that runs this:
>>
>> <taskdef name="apt" classname="com.sun.tools.ws.ant.Apt">
>>   <classpath refid="jaxws.classpath"/>
>> </taskdef>
>>
>> <target name="build" depends="clean">
>> <apt
>>   fork="true"
>>   debug="true"
>>   verbose="yes"
>>   destdir="${target.dir}"
>>   sourcepath="${source.dir}">
>>
>>     <classpath>
>>         <path refid="jaxws.classpath"/>
>>          <pathelement location="${source.dir}"/>
>>     </classpath>
>>
>>     <option key="r" value="${target.dir}"/>
>>     <source dir="${source.dir}"/>
>>   </apt>
>> </target>
>>
>>
>>
>> I've tried an exclude attribute on apt task but it said it wasn't
> supported.
>> Is there a way to tell apt to not process log4j.properties?
>>
>> Btw, this is JDK 1.5 and ant 1.7.0
>>
>> Thanks,
>> Nick
>>
>> Edited by: NickSeward on Nov 21, 2007 8:39 AM
>> --
>> View this message in context:
> http://www.nabble.com/Excluding-files-from-the-apt-tool-tf4851613.html#a13881666
>> Sent from the Ant - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
> 
> 
> 
> -- 
> --
> David Weintraub
> qazwart@gmail.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Excluding-files-from-the-apt-tool-tf4851613.html#a13884113
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Mime
View raw message