ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Richardson <eric.richard...@milagrosoft.com>
Subject style path / classpath problems
Date Fri, 27 Jul 2001 17:31:21 GMT
Hi,
I want to pass to different absolute paths to ant which has a different
project basedir. 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}"/>

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

I got style to work but only when my pieces were all in the same place.
Several people recommended I use the style command rather than the java
command but not having much luck here either.

>From my style command target.

  <target name="style" depends="prepare">
    <echo>
      Outdir: ${output.dir}
      Infile: ${input.dir}/${input.file}
      Driver: ${xhtml.driver}
    </echo>
    <style destdir="${output.dir}" 
	   extension=".html" 
	   style="${xhtml.driver}" >
      <include name="${input.dir}/${input.file}"/>
    </style>
  </target>

Output, echos are correct.

style:
     [echo] 
      Outdir: ../../docs/example
      Indir: ./example.xml
      Driver: /home/maxwell/jdocbook2/drivers/xhtmldriver.xsl
    
    [style] Transforming into
/home/maxwell/jdocbook2/docroot/docs/example
    [style] Using class
org.apache.tools.ant.taskdefs.optional.TraXLiaison
    [style] Loading stylesheet
/home/maxwell/jdocbook2/docroot/src/example/home/maxwell/jdocbook2/drivers/xhtmldriver.xsl
    [style] Failed to read stylesheet
/home/maxwell/jdocbook2/drivers/xhtmldriver.xsl

BUILD FAILED

/home/maxwell/jdocbook2/docroot/src/example/build.xml:90:
javax.xml.transform.TransformerConfigurationException: File
"file:/home/maxwell/jdocbook2/docroot/src/example/home/maxwell/jdocbook2/drivers/xhtmldriver.xsl"
not found.
--- Nested Exception ---

Given the echo, I would say that the style command is appending the
basedir and not ant. I removed the basedir and found style doesn't
complain as the docs say it is required. 

I could use help with how to get the classpath to the style task. The
only way I can see is either in my running environment or by putting the
jars in the ant/lib dir which I don't want to do. 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"/>
    </fileset>
  </path>

Thanks, I'm really stuck and this is the most reasonable approach I
though of for using ant for this project.

Eric

Mime
View raw message