https://bz.apache.org/bugzilla/show_bug.cgi?id=70168

            Bug ID: 70168
           Summary: For subbuilds expose parent Project through API and
                    properties
           Product: Ant
           Version: 1.10.17
          Hardware: PC
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

While in a subbuild I'd like to detect that scenario without having to add a
custom parameter to all <ant>/<antcall> (I assume <subant> also) calls.

Also I'd like access to select things from the parent project from my
scriptdefs.  Currently it's all or nothing with inheritAll/inheritRefs

I'd like to propose:

1) On Project add getParent()/getParentProject(); I use scriptdefs extensively
and from there I can get everything I need if I can access the parent project. 
I don't know if there's a concern about security/isolation, but if so we could
also add a remainAnonymous=([true]|false) to those tags to prevent this being
set.

2) For people that use properties more, then following the "ant.file" pattern,
we could add a MagicNames "ant.parent" pattern.

So for Projects A->B->C->D:

A
ant.file=a.xml
ant.file.a=a.xml

B
ant.file=b.xml
ant.file.a=a.xml
ant.file.b=b.xml
ant.parent=a

C
ant.file=c.xml
ant.file.a=a.xml
ant.file.b=b.xml
ant.file.c=c.xml
ant.parent=b
ant.parent.b=a

D
ant.file=d.xml
ant.file.a=a.xml
ant.file.b=b.xml
ant.file.c=c.xml
ant.file.d=d.xml
ant.parent=c
ant.parent.c=b
ant.parent.b=a

Testing ${ant.parent} alone would tell me if I'm in a subbuild, but also would
let you know the "ant.file" being used by the parent.  I don't know the use
case for "ant.file", but today you'd have to know who could be calling you to
lookup ${ant.file.<name>}, where now you could do ${ant.file.${ant.parent}}.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to