version_cleanup ';' VERSION
Macro
The version_cleanup
macro takes a version-ish string and cleans it up, producing the OSGi Version syntax.
For example, a Maven version can be turned into the OSGi Version syntax:
${version_cleanup;1.2.3-SNAPSHOT} -> 1.2.3.SNAPSHOT
- If the argument passed in is
null
, the version returned is0
. - If the argument passed is a valid OSGi version range the range is returned unaltered.
- If the argument is a version range matching the regular expression
(\\(|\\[)\\s*([-.\\w]+)\\s*,\\s*([-.\\w]+)\\s*(\\]|\\))
(withjava.util.regex.Pattern.DOTALL
enabled) a sufficiently cleaned up OSGi Version range is returned. - If the argument is a version string matching the regular expression
(\\d+)(\\.(\\d+)(\\.(\\d+))?)?([^\\p{Alnum}](.*))?
(withjava.util.regex.Pattern.DOTALL
enabled) a sufficiently cleaned up OSGi Version string is returned.