ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Patrick" <Todd.Patr...@dtn.com>
Subject RE: How do I specify the compiler on the cmd line?
Date Fri, 11 Jan 2008 17:02:39 GMT
Thank you David.

That worked great!

--Todd 

-----Original Message-----
From: David Weintraub [mailto:qazwart@gmail.com] 
Sent: Friday, January 11, 2008 10:58 AM
To: Ant Users List
Subject: Re: How do I specify the compiler on the cmd line?

Define your build.xml like this. Use properties to define the
"executabe" and "compiler" parameters. You can then override these
values via the "-D" flag on the command line. If you don't specify any
overriding properties with the -D flag, it'll take the value in the
build.xml file.

<property name="executable"
    value="/usr/jdk1.5.0_06/bin/javac"/>

<property name="compiler"
    value="javac1.5"/>

<target name="all" depends="init">
         <javac srcdir="${src}"
                         destdir="${build}"
                         executable="${executable}"
                         compiler="${compiler}">
                <classpath>
                <pathelement
location="/lib/opencsv-1.3/deploy/opencsv-1.3.jar"/>
                </classpath>
        </javac>
</target>

On Jan 11, 2008 11:06 AM, Todd Patrick <Todd.Patrick@dtn.com> wrote:
> I have a simple target:
>
> <target name="all" depends="init">
>         <javac srcdir="${src}"
>                          destdir="${build}"
>                          executable="/usr/jdk1.5.0_06/bin/javac"
>                          compiler="javac1.5">
>                 <classpath>
>                 <pathelement
> location="/lib/opencsv-1.3/deploy/opencsv-1.3.jar"/>
>                 </classpath>
>         </javac>
> </target>
>
>
> In which I specify to use JDK 5 in the Javac Task.
>
> How do I specify the compiler on the cmd line and remove the following

> lines from the Javac Task:
>
> executable="/usr/jdk1.5.0_06/bin/javac"
> compiler="javac1.5"
>
>
> Thanks,
>
> --Todd
>
> -----------------------------------------
> NOTICE: This email message is for the sole use of the intended
> recipient(s) and may contain confidential and privileged information. 
> Any unauthorized use, disclosure or distribution is prohibited. If you

> are not the intended recipient, please contact the sender by reply 
> email and destroy all copies of the original message.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional

> commands, e-mail: user-help@ant.apache.org
>
>



--
--
David Weintraub
qazwart@gmail.com

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


Mime
View raw message