Browse Source

Project ref task now allows properties in the referenced project

to be overriden


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272638 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 23 years ago
parent
commit
981df1db07
6 changed files with 20 additions and 18 deletions
  1. +1
    -3
      proposal/mutant/bootstrap.bat
  2. +0
    -2
      proposal/mutant/bootstrap.sh
  3. +4
    -2
      proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java
  4. +9
    -1
      proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java
  5. +3
    -8
      proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/Ref.java
  6. +3
    -2
      proposal/mutant/src/java/common/org/apache/ant/common/service/ExecService.java

+ 1
- 3
proposal/mutant/bootstrap.bat View File

@@ -26,7 +26,5 @@ REM run full build using bootstrapped version
java -jar bootstrap\lib\start.jar %* java -jar bootstrap\lib\start.jar %*


REM Use the full build as the build used by the build script REM Use the full build as the build used by the build script
xcopy /s dist bootstrap
xcopy /s /y dist bootstrap


REM clean up after bootstrap
java -jar bootstrap\lib\start.jar clean

+ 0
- 2
proposal/mutant/bootstrap.sh View File

@@ -27,5 +27,3 @@ java -jar bootstrap/lib/start.jar $*
# Use the full build as the build used by the build script # Use the full build as the build used by the build script
cp -r dist/lib bootstrap cp -r dist/lib bootstrap


#clean up after bootstrap
java -jar bootstrap/lib/start.jar clean

+ 4
- 2
proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java View File

@@ -226,11 +226,13 @@ public class CoreExecService implements ExecService {
* @param referenceName the name under which the project will be * @param referenceName the name under which the project will be
* referenced. * referenced.
* @param model the project model. * @param model the project model.
* @param initialData the project's initial data load.
* @exception ExecutionException if the project cannot be referenced. * @exception ExecutionException if the project cannot be referenced.
*/ */
public void createProjectReference(String referenceName, Project model)
public void createProjectReference(String referenceName, Project model,
Map initialData)
throws ExecutionException { throws ExecutionException {
frame.createProjectReference(referenceName, model);
frame.createProjectReference(referenceName, model, initialData);
} }






+ 9
- 1
proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java View File

@@ -638,18 +638,26 @@ public class Frame implements DemuxOutputReceiver {
* @param name the name under which the project will be * @param name the name under which the project will be
* referenced. * referenced.
* @param project the project model. * @param project the project model.
* @param initialData the project's initial data load.
* @exception ExecutionException if the project cannot be referenced. * @exception ExecutionException if the project cannot be referenced.
*/ */
protected void createProjectReference(String name, Project project)
protected void createProjectReference(String name, Project project,
Map initialData)
throws ExecutionException { throws ExecutionException {
Frame referencedFrame = createFrame(project); Frame referencedFrame = createFrame(project);


if (initialData != null) {
referencedFrame.setInitialProperties(initialData);
}
// does the frame have any overrides? // does the frame have any overrides?
Map initialProperties = (Map) overrides.get(name); Map initialProperties = (Map) overrides.get(name);
if (initialProperties != null) { if (initialProperties != null) {
referencedFrame.setInitialProperties(initialProperties); referencedFrame.setInitialProperties(initialProperties);
overrides.remove(name); overrides.remove(name);
} }


referencedFrames.put(name, referencedFrame); referencedFrames.put(name, referencedFrame);
referencedFrame.initialize(); referencedFrame.initialize();


+ 3
- 8
proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/Ref.java View File

@@ -65,7 +65,7 @@ import org.apache.ant.common.util.ExecutionException;
* @author Conor MacNeill * @author Conor MacNeill
* @created 17 April 2002 * @created 17 April 2002
*/ */
public class Ref extends AbstractTask {
public class Ref extends SubBuild {


/** The project file containing the project to be referenced. */ /** The project file containing the project to be referenced. */
private File projectFile; private File projectFile;
@@ -73,10 +73,6 @@ public class Ref extends AbstractTask {
/** THe name under which this project is to be referenced. */ /** THe name under which this project is to be referenced. */
private String name; private String name;


/** The core's ExecutionService for running builds and external programs */
private ExecService execService;


/** /**
* Initialise this task * Initialise this task
* *
@@ -88,7 +84,6 @@ public class Ref extends AbstractTask {
public void init(AntContext context, String componentType) public void init(AntContext context, String componentType)
throws ExecutionException { throws ExecutionException {
super.init(context, componentType); super.init(context, componentType);
execService = (ExecService) getCoreService(ExecService.class);
} }




@@ -119,9 +114,9 @@ public class Ref extends AbstractTask {
* @exception ExecutionException if the project cannot be referenced. * @exception ExecutionException if the project cannot be referenced.
*/ */
public void execute() throws ExecutionException { public void execute() throws ExecutionException {
Project model = execService.parseXMLBuildFile(projectFile);
Project model = getExecService().parseXMLBuildFile(projectFile);


execService.createProjectReference(name, model);
getExecService().createProjectReference(name, model, getProperties());
} }
} }



+ 3
- 2
proposal/mutant/src/java/common/org/apache/ant/common/service/ExecService.java View File

@@ -82,10 +82,11 @@ public interface ExecService {
* @param referenceName the name under which the project will be * @param referenceName the name under which the project will be
* referenced. * referenced.
* @param model the project model. * @param model the project model.
* @param initialData the project's initial data load.
* @exception ExecutionException if the project cannot be referenced. * @exception ExecutionException if the project cannot be referenced.
*/ */
void createProjectReference(String referenceName, Project model)
throws ExecutionException;
void createProjectReference(String referenceName, Project model,
Map initialData) throws ExecutionException;




/** /**


Loading…
Cancel
Save