Boost logo

Boost-Build :

Subject: Re: [Boost-build] Picking up building Java in Boost
From: John Bito (jwbito_at_[hidden])
Date: 2009-04-17 17:06:54


On Fri, Apr 17, 2009 at 1:44 AM, Vladimir Prus <ghost_at_[hidden]> wrote:
> On Thursday 16 April 2009 01:01:18 John Bito wrote:
> Actually, I suspect that java support does not need any smartness at all --
> can you just run javac on all java sources and then run jar on every .class
> that is produced. You might need to put GLOB in between to collect the
> list of .class files without resorting to unportable commands such as
> 'find'.

The 'smartness' is to participate in variants (release vs debug) and
to jar only those class files that correspond with java sources
(important so that refactoring that removes a java file works when an
incremental build is run).

The goal is for the jar rule to work like the lib rule so that the jar
source targets can be specified as

jar my_app : [ glob-tree *.java ]

I want to parse the stdout of javac to pick up the names of the
generated class files and add them to the list of targets that will be
processed as sources for the jar action.

>
>> I also have a code-generator that produces a collection of C files, so
>> I'd be looking for ways to handle rules that generate multiple
>> targets.
>
> Can you describe your use case in more detail? If a code generate produces
> a fixed set of targets, it's easy to handle.

I'm considering the approach to take on this. The goal is to build an
Oracle client using the Pro*C preprocessor for embedded SQL. There is
currently a script that produces a variable number of .o files as one
component of the library. I can break it down so that each .o is a
separate target for bjam. An alternative would be to move some of the
generation process into bjam or to have bjam tell the process how many
files to make.

---- The alternative looks like a nice way to describe the build :
bjam controls the process ---

pro_c file1 : template_file.pctpl
pro_c file2 : template_file.pctpl

lib oracle_client : file1.pc file2.pc [ glob *.pc ] # there are other
sources to pre-process

--- possibly easier hack: delegate the process to the current script ---

oracle_object_generate : 2 # what I mean is 'tell the script to produce 2 files'

lib oracle_client : <something that makes it depend on the result of
oracle_object_generate> [ glob *.pc ] # I could probably find a way to
avoid defining a generator that accepts PRO_C (.pc) sources in this
case.

------------------------------------------

I'll probably let this stew for another day or two while I write some
of the code that I'll need to build.

Thanks for your thoughtful suggestions!
John

>
> - Volodya
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
>


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk