Browse Source

adding inheritRefs to <antcall>, for better consistency with ant. The default is of course false.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272283 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 23 years ago
parent
commit
23337b5063
1 changed files with 20 additions and 1 deletions
  1. +20
    -1
      src/main/org/apache/tools/ant/taskdefs/CallTarget.java

+ 20
- 1
src/main/org/apache/tools/ant/taskdefs/CallTarget.java View File

@@ -87,6 +87,7 @@ public class CallTarget extends Task {
private String subTarget; private String subTarget;
private boolean initialized = false; private boolean initialized = false;
private boolean inheritAll = true; private boolean inheritAll = true;
private boolean inheritRefs = false;


/** /**
* If true, inherit all properties from parent Project * If true, inherit all properties from parent Project
@@ -97,6 +98,18 @@ public class CallTarget extends Task {
inheritAll = inherit; inheritAll = inherit;
} //-- setInheritAll } //-- setInheritAll


/**
* set the inherit refs flag
* @param inheritRefs new value
*/
public void setInheritRefs(boolean inheritRefs) {
this.inheritRefs=inheritRefs;
}

/**
* init this task by creating new instance of the ant task and
* configuring it's by calling its own init method.
*/
public void init() { public void init() {
callee = (Ant) project.createTask("ant"); callee = (Ant) project.createTask("ant");
callee.setOwningTarget(target); callee.setOwningTarget(target);
@@ -106,7 +119,12 @@ public class CallTarget extends Task {
initialized = true; initialized = true;
} }


public void execute() {
/**
* hand off the work to the ant task of ours, after setting it up
* @throws BuildException on validation failure or if the target didn't
* execute
*/
public void execute() throws BuildException {
if (!initialized) { if (!initialized) {
init(); init();
} }
@@ -120,6 +138,7 @@ public class CallTarget extends Task {
callee.setAntfile(project.getProperty("ant.file")); callee.setAntfile(project.getProperty("ant.file"));
callee.setTarget(subTarget); callee.setTarget(subTarget);
callee.setInheritAll(inheritAll); callee.setInheritAll(inheritAll);
callee.setInheritRefs(inheritRefs);
callee.execute(); callee.execute();
} }




Loading…
Cancel
Save