You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Gao Lin <ao...@gmail.com> on 2009/09/04 10:21:47 UTC
How to run java source code in ant target
HI:
Is there an existed ant target to execute plain java source code?
I need to run one java statement before junit target, I don`t want
to create a separated main class for this, it is possible to run the
code directly?
like:
<target name="run-java-source-code">
<execute classpath="run.classpath">
System.out.println("execute plain Java source code in ant target");
</execute>
</target>
--
Thanks and Best Regards
aoingl@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: How to run java source code in ant target
Posted by Gao Lin <ao...@gmail.com>.
"http://ant.apache.org/manual/OptionalTasks/script.html"
this works for me, thanks
Thanks Jan too, but the script is much simpler.
2009/9/4 <Ja...@rzf.fin-nrw.de>:
> Use <javac>+<java>.
>
> Jan
>
>>-----Ursprüngliche Nachricht-----
>>Von: Avlesh Singh [mailto:avlesh@gmail.com]
>>Gesendet: Freitag, 4. September 2009 10:27
>>An: Ant Users List
>>Betreff: Re: How to run java source code in ant target
>>
>>Looking for this? -
>>http://ant.apache.org/manual/OptionalTasks/script.html
>>
>>Cheers
>>Avlesh
>>
>>On Fri, Sep 4, 2009 at 1:51 PM, Gao Lin <ao...@gmail.com> wrote:
>>
>>> HI:
>>>
>>> Is there an existed ant target to execute plain java source code?
>>>
>>> I need to run one java statement before junit target, I don`t want
>>> to create a separated main class for this, it is possible to run the
>>> code directly?
>>>
>>> like:
>>>
>>> <target name="run-java-source-code">
>>> <execute classpath="run.classpath">
>>> System.out.println("execute plain Java source code in ant
>>> target");
>>> </execute>
>>> </target>
>>>
>>> --
>>> Thanks and Best Regards
>>>
>>> aoingl@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
>
>
--
Thanks and Best Regards
aoingl@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: How to run java source code in ant target
Posted by Ja...@rzf.fin-nrw.de.
Use <javac>+<java>.
Jan
>-----Ursprüngliche Nachricht-----
>Von: Avlesh Singh [mailto:avlesh@gmail.com]
>Gesendet: Freitag, 4. September 2009 10:27
>An: Ant Users List
>Betreff: Re: How to run java source code in ant target
>
>Looking for this? -
>http://ant.apache.org/manual/OptionalTasks/script.html
>
>Cheers
>Avlesh
>
>On Fri, Sep 4, 2009 at 1:51 PM, Gao Lin <ao...@gmail.com> wrote:
>
>> HI:
>>
>> Is there an existed ant target to execute plain java source code?
>>
>> I need to run one java statement before junit target, I don`t want
>> to create a separated main class for this, it is possible to run the
>> code directly?
>>
>> like:
>>
>> <target name="run-java-source-code">
>> <execute classpath="run.classpath">
>> System.out.println("execute plain Java source code in ant
>> target");
>> </execute>
>> </target>
>>
>> --
>> Thanks and Best Regards
>>
>> aoingl@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
Re: How to run java source code in ant target
Posted by Avlesh Singh <av...@gmail.com>.
Looking for this? - http://ant.apache.org/manual/OptionalTasks/script.html
Cheers
Avlesh
On Fri, Sep 4, 2009 at 1:51 PM, Gao Lin <ao...@gmail.com> wrote:
> HI:
>
> Is there an existed ant target to execute plain java source code?
>
> I need to run one java statement before junit target, I don`t want
> to create a separated main class for this, it is possible to run the
> code directly?
>
> like:
>
> <target name="run-java-source-code">
> <execute classpath="run.classpath">
> System.out.println("execute plain Java source code in ant
> target");
> </execute>
> </target>
>
> --
> Thanks and Best Regards
>
> aoingl@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>