Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Any preprocessor mechanism in Eclipse yet?
Any preprocessor mechanism in Eclipse yet? [message #138199] Wed, 01 October 2003 05:10 Go to next message
Eclipse UserFriend
Originally posted by: use.reply.to.invalid

We have a scenario where some Java-sources are mechanically generated
from an XML file, and then used in our project.

We have ant-targets for regenerating these files, when the XML file
changes, but Eclipse is currently completely unaware of this. I would
like to know if there is an effort started in incorporating other
"compilation chains" than the standard ".java -> .class" in Eclipse?

We are looking for something similar to the "make" utility for Unix,
abeit we do not currently have a need for anything but the basic "if
changed then rebuild stuff" functionality.

Thanks in advance for any replies.

--
Thorbjørn Ravn Andersen
Re: Any preprocessor mechanism in Eclipse yet? [message #138457 is a reply to message #138199] Wed, 01 October 2003 10:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO--SPAM.us.ibm.com

When the ANT files generates the .java files make sure you do an
eclipse.refresh task, and then the standard java builder will take over
and compile the generated .java files into the .class files.

Rich
Re: Any preprocessor mechanism in Eclipse yet? [message #139610 is a reply to message #138199] Sat, 04 October 2003 09:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frankc-ns.t310.org

Thorbjørn Ravn Andersen wrote:

> We have a scenario where some Java-sources are mechanically generated
> from an XML file, and then used in our project.
>
> We have ant-targets for regenerating these files, when the XML file
> changes, but Eclipse is currently completely unaware of this. I would
> like to know if there is an effort started in incorporating other
> "compilation chains" than the standard ".java -> .class" in Eclipse?
>
> We are looking for something similar to the "make" utility for Unix,
> abeit we do not currently have a need for anything but the basic "if
> changed then rebuild stuff" functionality.
>
> Thanks in advance for any replies.
>
You can add an external tool builder to your project which calls the ant
file, which will then be run on any resource change in your project. If
you let the external tool builder execute before the java builder, the
java builder should pick up the changed java files and compile those.

The right way to do it is to implement an IncrementalProjectBuilder that
builds the java files from inside eclipse (probably faster, and you
can use that as a starting point for more support in eclipse for your
code generation system)

Kind regards,

Frank Cornelissen
Conditional ant tasks (Was: Any preprocessor mechanism in Eclipse yet?) [message #140691 is a reply to message #138457] Tue, 07 October 2003 06:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: use.reply.to.invalid

Richard L. Kulp wrote:
> When the ANT files generates the .java files make sure you do an
> eclipse.refresh task, and then the standard java builder will take over
> and compile the generated .java files into the .class files.

Thank you both for your suggestions, of which this one seems to be the
one giving us what we need with the least effort :)

We want to, however, to run ant outside of eclipse too, and here the
eclipse.refreshLocal task fails as it is unknown to the standard
distribtion of Ant. I do not want to use the Eclipse jar-files to
resolve this, but rather run the target conditionally in Ant.

My initial attempt with

<target name="eclipse.refresh" if="eclipse.available">
<echo>Refreshing Eclipse</echo>
<eclipse.refreshLocal resource="spine/build" depth="infinite" />
</target>
<target name="muh">
<available property="eclipse.available"
classname="org.eclipse.ant.core.antRunner"/>
<antcall target="eclipse.refresh"/>
</target>

works nicely outside of Eclipse, but fails to be set inside Eclipse. Is
there a knowledgeable person who knows the appropriate Ant incantation?
Re: Conditional ant tasks (Was: Any preprocessor mechanism in Eclipse yet?) [message #140729 is a reply to message #140691] Tue, 07 October 2003 07:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hcs33.egon.gyaloglo.hu

Hi,

1. Afaik there is an "eclipse.running" property set if you run ant tasks
inside Eclipse so you can use this property.
2. If you set the ant task as an "External Tools Builder" under "Project
properties" you can set the refresh option under the "Refresh" tab. In this
case you don't have to perform a refresh from the script.

HTH,
Regards,
Csaba

"Thorbj
Re: Conditional ant tasks (Was: Any preprocessor mechanism in Eclipse yet?) [message #141246 is a reply to message #140729] Wed, 08 October 2003 03:17 Go to previous message
Eclipse UserFriend
Originally posted by: use.reply.to.invalid

Horváth, Csaba wrote:
> Hi,
>
> 1. Afaik there is an "eclipse.running" property set if you run ant tasks
> inside Eclipse so you can use this property.

>><target name="eclipse.refresh" if="eclipse.available">

The build.xml snippet works if using "eclipse.running" instead in the
if-clause.

Thank you all! This is very nice :)

--
Thorbjoern Ravn Andersen "...plus...Tubular Bells!"
Previous Topic:How to add an Action to the popupmenu of javaeditor
Next Topic:Mandrake 9.1 and Eclipse gtk
Goto Forum:
  


Current Time: Fri Aug 29 00:10:04 EDT 2025

Powered by FUDForum. Page generated in 0.03826 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top