On Fri, Oct 14, 2011 at 9:01 AM, Ian Dickinson <[email protected]> wrote:
> On 14/10/11 13:49, Joshua TAYLOR wrote:
>>
>> Thanks for the quick response! Well, I'm not too worried about
>> rebuilding Jena from SVN, but I am already using ant. When you say
>> "avoid the config file and use … to give a repeatable build step", you
>> just mean using something where the configuration can be specified as
>> command line options (without having to retype them every time),
>> right?
>
> Just so.
>
>> Since I'm already set up with ant on this project, I think
>> adding the command line options there will be the simplest option for
>> now.
>
> It is indeed a commonly-used pattern:
>
> http://incubator.apache.org/jena/documentation/tools/schemagen.html#using_schemagen_with_ant
While I do eventually want to work with the latest version, for the
moment, I'm trying to take the ant-based route. I'm running into some
issues with newlines in 'value' attributes on nested 'arg' element in
the java task. Particularly, I'm trying to add some declarations
(really, a static initialization block) but newlines aren't being
preserved. My task looks like
<target name="schemagen">
<java classname="jena.schemagen"
classpathref="cp"
fork="yes">
<arg value="-i" />
<arg value="path-to-file" />
<arg value="--declarations" />
<arg value="
static {
// Do some stuff...
}" />
</java>
</target>
But then the generated output contains:
static { // Do some stuff... }
which obviously introduces some problems. The same problem arises in
other places too (trying to put comments in a header, &c.). I'm not
up on my XML attribute value newline handling, but I thought they
should be preserved. If I run schemagen from the command line and use
multiline strings there, they're preserved, so I think this might be
an ant issue, but I wasn't sure.
Is this an instance of something that can be done with a config file
that can't be done on the command line using ant? I guess it's time
to move to some bash scripting?
Thanks for your patience,
//JT
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/