Add basedir sub-directories

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163072 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2004-09-11 12:16:19 +00:00
parent 182d817ff1
commit 10fe573a33
1 changed files with 22 additions and 0 deletions

View File

@ -88,6 +88,28 @@ public class OgnlProjectValueExtractor
{
value = context.getProject().getFile().getParentFile().getAbsolutePath();
}
else if ( expression.startsWith( "#basedir" ) )
{
try
{
int pathSeparator = expression.indexOf( "/" );
if ( pathSeparator > 0 )
{
value = context.getProject().getFile().getParentFile().getAbsolutePath()
+ expression.substring( pathSeparator );
}
else
{
new Exception( "Got expression '" + expression + "' that was not recognised" ).printStackTrace();
}
}
catch ( OgnlException e )
{
// do nothing
e.printStackTrace(); // TODO: should log? should ignore as previously?
}
}
else if ( expression.startsWith( "#" ) )
{
new Exception( "Got expression '" + expression + "' that was not recognised" ).printStackTrace();