import-bot (20211) [Avatar] Offline
#1
[Originally posted by svetlin]

Thanks for a great book.

Now, my question.
XML inclusion of file fragments through entity reference should be in the
prolog and requires resolved URI. No Ant properties are allowed.

How can I then define mount points for the directories where shared files
reside and reference them in the XML "includes", provided I know the directory
of the master build?

Specifically, I would like to have set global properties in my global build
file such as:

<property environment="env"/>
<property name="build.root" value="${env.BUILD_ROOT}"/>
<property file="${build.root}/build.properties"/>

So I know always ${build.root}.
Then, in the global build.properties:

# shared props logical name
shared-props.dir=shared-props

# mountpoint for shared between all projects props,
# library names, dir structure etc -- change to some relative to
# ${build.root} path if you want another
mountpoint.shared-props=${build.root}/${shared-props.dir}

Now in some particular project build I want to say smth like:

<!DOCTYPE project [>
<!ENTITY libnames SYSTEM "file:${mountpoint.shared-props}/libnames.xml">
]>

How can I achieve that?
There is some remark on page 226 in this direction which I was not able to
figure out.

I want to avoid those fixed (relative to current project directory) physical
paths like "../../". I want to have only one common reference point for my
entire build structure (${build.root}) along with definition of mount points
(e.g. for common properties/targets/etc.) relative to it.

Thanks,
--
Svetlin
import-bot (20211) [Avatar] Offline
#2
Re: mount points in XML file fragments
[Originally posted by erikhatcher]

Unfortunately with Ant 1.5.x there is not a good solution to this, and
relative paths are the way to
go. Ant 1.6 (currently not released, but available from CVS) has an import
task that solves this
issue.