With DSL configuration format we introduce support for computable values for properties. It is now possible to set value which is result of a computation, ie. concatenation of a strings or very simple mathematical expression. We currently support only following mathematical operations:
- add
- subtract
- multiply
- divide
Example of setting environment variable related path and computed timeout.
bean { # setting path to `some-subdirectory` of user home directory path = prop('user.home') + '/some-subdirectory/' # setting timeout to 5 minutes (setting value in milliseconds) timeout = 5L * 60 * 1000 # previously it would need to be configured in following way: # timeout = 300000L }
Warning
For properties which accepts lists it is not allowed to set value using computed values with comma separated values like value1,value2
wrapped in []
, ie.
property = [ env('some-variable') + ',other-value' ]
. It needs to be set in following way property = env('some-variable') + ',other-value'
.