jdeb icon indicating copy to clipboard operation
jdeb copied to clipboard

Resolve variables recursively

Open thomas-hilaire opened this issue 10 years ago • 4 comments

Hello ! We wanted to contribute to the jdeb project as we improved variables resolution for our needs.

When the MapVariableResolver is fulfilled, some entries are composed like : "myVariable" : "${otherVairable}" "otherVairable" : "the value that I want"

.. this patch makes the resolve action on the key "myVariable" returning "the value that I want".

thomas-hilaire avatar Mar 04 '14 17:03 thomas-hilaire

Hey Thomas, that adds quite some complexity to the variable resolving. Could you explain the use case?

tcurdt avatar Mar 09 '14 12:03 tcurdt

The question is: Why do you have something like "myVariable" : "${otherVairable}"

tcurdt avatar Mar 09 '14 12:03 tcurdt

Hello, We use a variable for the version attribute of the control file like

== in the pom.xml == <packaging.version>${module.release}~git${git.date}.${git.sha1}</packaging.version>

== in the control file == Version: [[packaging.version]]

With the current variable resolver I get "${module.release}~git${git.date}.${git.sha1}" in my final control file. I know that I can directly set the content of packaging.version in my control file but as I use it at some other places I want to make one composed variable.

Thanks !

thomas-hilaire avatar Mar 10 '14 09:03 thomas-hilaire

While I now see the need it seems like this is the wrong approach. If these variables are Maven variables, it should also be Maven to expand them - not jdeb. We would need to dig a bit more into Maven to see how it's done.

tcurdt avatar Dec 15 '14 16:12 tcurdt