Alexey Solofnenko wrote:
Hello Nicola,

Hi Alex. Happy to hear again from you on this :-)

Externally loaded properties can be prefixed, since <property file=""/> and
<xmlproperty> have "prefix" attributes, but externally loaded properties
cannot be rebased in pre-processor, only in ANT itself. I had to provide a
"project.root" property to ANT and use it in all externally loaded property
files for path properties to work correctly.

It can be done probably if we tweak the new PropertyHelper to get a value from the Project that tells him if he has to prefix the value or not when inserting it. It should work with all variables.


Property rebasing requires some discipline from a build writer. That means
all path properties should be in <property location=""/> form. Sometimes a
property can be used in both string and path context. That is why the real
string property is not rebased, but a shadow rebased property should be
created:
<property name="some-dir" value="build"/>

<fileset dir="${some-dir}/.." includes="${some-dir}"/>

is translated into something like:

<property name="some-dir" value="build"/>
<property name="some-dir~~rebased"
location="${**rebased-base-dir**}/build"/> <fileset dir="${some-dir~~rebased}/.." includes="${some-dir}"/>

Ahh, now I get it. Interesting. Yes, it still needs discipline from writers but the file can be truly indipendent from importing or not.


ANT itself can be changed to save three kinds of values for each property -
a string value, path value and path list value. In that case no magical
names are needed.

I'm not sure I get this...

Anyway, it can be done IIUC in PropertyHelper in the same way we make prefixes.

In case of one property uses another rebased property it does not have to be
changed at all.

I think that dropping property rebasing will leave build writing still
inconvenient.

I'm trying to weight costs and benefits. Seems like th ebenefits are going up and the costs down! :-)


--
Nicola Ken Barozzi                   [EMAIL PROTECTED]
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



Reply via email to