> -----Ursprungligt meddelande-----
> No attachment - try renaming to .txt and send again.
Ok, here it comes again.
/peter
Index: magic/src/main/org/apache/avalon/tools/tasks/PropertyTask.java
===================================================================
--- magic/src/main/org/apache/avalon/tools/tasks/PropertyTask.java (revision
46928)
+++ magic/src/main/org/apache/avalon/tools/tasks/PropertyTask.java (working copy)
@@ -36,6 +36,7 @@
private String m_key;
private String m_feature;
private String m_property;
+ private boolean m_resolve = true;
public void init()
{
@@ -50,6 +51,11 @@
m_key = key;
}
+ public void setResolve( final boolean policy )
+ {
+ m_resolve = policy;
+ }
+
public void setFeature( final String feature )
{
m_feature = feature;
@@ -82,7 +88,15 @@
return;
}
- final String value = getFeature();
+ final ResourceRef ref = new ResourceRef( m_key );
+ final Resource resource = getHome().getResource( ref );
+ if( m_resolve )
+ {
+ resource.getArtifact( getProject() );
+ }
+
+ final String value = getFeature( resource );
+
if( null != value )
{
final Property property = (Property) getProject().createTask( "property"
);
@@ -98,10 +112,8 @@
}
}
- private String getFeature()
+ private String getFeature( Resource resource )
{
- final ResourceRef ref = new ResourceRef( m_key );
- final Resource resource = getHome().getResource( ref );
if( m_feature.equals( "name" ) )
{
return resource.getInfo().getName();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]