You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Tim Gordon <ti...@allustra.com> on 2005/12/13 14:30:21 UTC

C preprocessor driven from ANT?

Hi

Does anyone know of a pure-Java pre-processor that can handle c-style
multiple #include and nested #defines?

Our DB build is preceded by the SQL being subject to some C-style
pre-processing before the stored procs are run into the DB. Our DB build is
done outside of ANT using make at the moment but the only barrier to driving
it from ANT is the fact that this C-style pre-processing has to take place.

Obviously I'm after a pure-Java implementation so that I don't have to worry
about cross-platform issues, otherwise I'd just exec a resident native
binary pre-processor.

Tim

Allustra Limited
85 Gracechurch Street
London
EC3V 0AA
Tel +44 (0)20 7469 8640
Fax +44 (0)20 7469 8689
http://www.allustra.com/





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


Re: C preprocessor driven from ANT?

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 13 Dec 2005, Tim Gordon <ti...@allustra.com> wrote:

> Our DB build is preceded by the SQL being subject to some C-style
> pre-processing before the stored procs are run into the DB. Our DB
> build is done outside of ANT using make at the moment but the only
> barrier to driving it from ANT is the fact that this C-style
> pre-processing has to take place.

without changing the syntax, that is, I assume.  Otherwise there are a
couple of preprocessor tasks listed on Ant's external tasks page.

You could try to use your own filterreader which would force you to
re-implement the pieces of logic required for your scripts, which
might not be that much (keeping track of defines, very simple
conditionals, swallowing lines and including other files).  I'm not
aware of existing solutions here.

And like Brian said, you can always run gcc's preprocessor
stand-alone.  A quick look over the ant-contrib cc tasks reveals that
they don't support running the compiler without compiling.

Sorry, no good news

       Stefan

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


Re: C preprocessor driven from ANT?

Posted by Dominique Devienne <dd...@gmail.com>.
> Obviously I'm after a pure-Java implementation so that I don't have to worry
> about cross-platform issues, otherwise I'd just exec a resident native
> binary pre-processor.

I have played with replicating a C-preprocessor in pure Java, and
although I have the basics working, I doubt my experiment is either
correct or complete. It's probably much safer to <exec> a native one,
like gcc -E. This is what I ended up doing. --DD

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