ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Richardson <>
Subject Re: Strange java/fork behavior with xalan
Date Fri, 27 Jul 2001 01:19:16 GMT
Conor MacNeill wrote:
> > From: Eric Richardson []
> >
> > BTW, it would be nice if embedding ant was considered as a design
> > criteria in the next major release. Ant seems to work very well if run
> > standalone or from a script but running from Java is tough at least as
> > far as I've tried so far(Although i'd certainly not be an expert on this
> > topic).
> Eric, what are you finding tough. There are some issues currently for sure,
> but it can be done and I believe it has been done in products such as
> NetBeans. The best approach is usually to create your own Project object and
> manage it from within your app, much the same way as does now.

I tried running it with an exec from java. I didn't think to look at to embed.

I'm taking a different approach which I think is better but still having
problems. I need to pass two different locations on the file system to
ant. I'm using -D with absolute paths. This is the last part of the
simple shell wrapper.

build_file="-buildfile ${doc_root}/src/example/build.xml"
d_opts="-Ddoc_root=${doc_root} -Djdocbook_home=${jdocbook_home}"
# run ant
${jdocbook_home}/jakarta-ant-1.3/bin/ant ${d_opts} ${build_file} "$@"

In the ant file I try to use 

  <!-- Incoming -D properties:  jdocbook_home, doc_root -->
  <property name="jdocbook.home" location="${jdocbook_home}"/>
  <property name="doc.root" location="${doc_root}"/>

These are absolute and correct but now I can't build path from these
such as 

  <!-- docbook xsl/dtd properties -->
  <property name="driver.root" location="${jdocbook.home}/drivers"/>
  <property name="xhtml.driver"
  <property name="fo.driver" location="${driver.root}/fodriver.xsl"/>

It seems to look at these and add the relative path to the front. Is the
problem the evaluate sequence so that ${xxx} gets evalated after and the
location rule "if it starts with / don't mess with it" doesn't get

I got style to work but only when my pieces were all in the same place.
>From my style command target.

  <target name="style" depends="prepare">
    <style basedir="${input.dir}" 
	   style="${xhtml.driver}" >
      <include name="${input.file}"/>

Here is the bad output(*** my additions ***):

    [style] Transforming into
    [style] Loading stylesheet
*** local build path added ***
    [style] Failed to read stylesheet
*** this is what I want ***


javax.xml.transform.TransformerConfigurationException: File
not found.
*** same as first one ***
> Let us know the details of the issues you are having and we can help more.
> Conor

Two things I could use help with, the path thing above,

and how to get the classpath to the style task. I have this already in
my file which worked before when I called xalan with a java task.

  <path id="xalan.classpath">
    <fileset dir="${xalan.dir}/bin">
      <include name="xalan.jar"/>
      <include name="xerces.jar"/>
      <include name="bsf.jar"/>


View raw message