[ 
https://issues.apache.org/jira/browse/FELIX-1627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Derek Baum resolved FELIX-1627.
-------------------------------

    Resolution: Fixed

variables are now expanded in sigil defaults files using ${name} notation, 
including Unix shell ${name:-default} syntax.

where ${name} is replaced with System.getProperty(name), or if not set, by 
System.getenv(name).
${name:?Error message} can be used to cause a failed expansion to throw an 
exception.

This allows, for example, sigil-default.properties to contain:

version: 1.2.3.${QUALIFIER:-SNAPSHOT}

which allows the default version qualifier of SNAPSHOT to be overridden by 
setting QUALIFIER in the environment.

The following properties in sigil.properties take path names as arguments:

-defaults:
-resources:
-sourcedirs:
-libs:

each of these effectively resolves the path name against the pathname of the 
file in which it appears, without needing the explicit use of ${.}, but there 
are some special cases:

-resources: strips @ or {} before attempting to resolve the path, then passes 
the resolved path to BND
-libs: additionally atempts to resolve against the target directory.

Some properties in repository definitions also take pathnames as arguments:

project;pattern:
filesystem;dir:
obr;auth:
obr;index:

These still require the explicit use of ${.} to cause them resolve against the 
file in which they appear.

Changing this behaviour would  involve changing the repository constructors, 
which currently just take a Properties argument, and does not indicate the base 
directory against which to resolve path arguments.






> Add support for variable expansion in sigil.property values
> -----------------------------------------------------------
>
>                 Key: FELIX-1627
>                 URL: https://issues.apache.org/jira/browse/FELIX-1627
>             Project: Felix
>          Issue Type: Improvement
>          Components: Sigil
>            Reporter: David Savage
>            Assignee: Derek Baum
>
> Currently sigil.properties supports expansion of ${key} values in a number of 
> key places such as -defaults location and translation of ${.} and ${..} to 
> paths relative to the sigil.properties file.
> Proposal to make this behaviour universal for all values.
> As part of this fix we should also address consistency issues with path 
> locations wrt ${.} and ${..}
> In most places:
> key: path/to/resource
> is considered a path relative to the jvm process that executes where as 
> key: ${.}/path/to/resource
> is considered a path relative to the sigil.properties file
> However this is not true for the -sourcedirs attribute which has explicit 
> parsing to make 
> -sourcedirs: src
> imply the source dir relative to the sigil.properties file.
> Suggestion to make source dirs behaviour default and use ${.} syntax only for 
> jvm process paths.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to