Is it possible to specify value of property as property in ant?

前端 未结 2 1429
离开以前
离开以前 2021-01-12 09:44

I have a property file which is generated by my ant script itself during execution. And I want to access the value of properties from this generated property file.

F

2条回答
  •  再見小時候
    2021-01-12 10:41

    This is from the doc:

    Nesting of Braces

    In its default configuration Ant will not try to balance braces in property expansions, it will only consume the text up to the first closing brace when creating a property name. I.e. when expanding something like ${a${b}} it will be translated into two parts:

    • the expansion of property a${b - likely nothing useful.
    • the literal text } resulting from the second closing brace

    This means you can't use easily expand properties whose names are given by properties, but there are some workarounds for older versions of Ant. With Ant 1.8.0 and the the props Antlib you can configure Ant to use the NestedPropertyExpander defined there if you need such a feature.

    So it is not available easily. Workarounds (using

提交回复
热议问题