ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: macrodef - do attributes as properties or substitutions
Date Fri, 14 Nov 2003 12:28:30 GMT
I came from the users point of view. More exactly while writing access code
inside a script task.
  <macrodef>
      <attribute>
      <sequential>
          <script>
              HERE PLAYS THE MUSIC :-)
          </script>
      </sequential>
  </macrodef>

And the question was: how can I access the attribute-value? If you write
inside a target that would be
    value = project.getProperty(name);
But not here. So development / copying the code from somewhere else /
refactor that code out would be
more diffult.

Difficult but not impossible:
    value = "${value}";
would do that (or the other bracket type).


But the textual expansion has another disadvantage:
    if (parameter == "${name}") set-default-for-parameter;
You can´t do that ... (mmh maybe nevertheless, not enought thought about
that).
So the workaround would be splitting the string "${name}" to "${na"+"me}".


All can be done. But not in a nice and uniform way.
That´s why I prefer local properties.



Jan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message