Browse Source

Slight reorg of methods between context and service classes

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272170 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 23 years ago
parent
commit
3432c43ba0
7 changed files with 33 additions and 21 deletions
  1. +9
    -0
      proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java
  2. +0
    -9
      proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionContext.java
  3. +12
    -1
      proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Project.java
  4. +3
    -1
      proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/Ant.java
  5. +2
    -2
      proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntCall.java
  6. +1
    -8
      proposal/mutant/src/java/common/org/apache/ant/common/antlib/AntContext.java
  7. +6
    -0
      proposal/mutant/src/java/common/org/apache/ant/common/service/ExecService.java

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

@@ -176,5 +176,14 @@ public class CoreExecService implements ExecService {
public String getProjectName() { public String getProjectName() {
return frame.getProjectName(); return frame.getProjectName();
} }

/**
* Get the base directory for this execution of this frame
*
* @return the base directory
*/
public File getBaseDir() {
return frame.getBaseDir();
}
} }



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

@@ -115,15 +115,6 @@ public class ExecutionContext implements AntContext {
} }




/**
* Get the base directory for this execution of this frame
*
* @return the base directory
*/
public File getBaseDir() {
return frame.getBaseDir();
}

/** /**
* Gets the location associated with the ExecutionContext * Gets the location associated with the ExecutionContext
* *


+ 12
- 1
proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Project.java View File

@@ -381,6 +381,17 @@ public class Project implements org.apache.ant.common.event.BuildListener {
return description; return description;
} }


/**
* Get the Project's default Target, if any
*
* @return the project's default target or null if there is no default.
* @deprecated
*/
public String getDefaultTarget() {
throw new BuildException("The default project target is no longer "
+ "available through this method.");
}

/** /**
* Get a project property * Get a project property
* *
@@ -441,7 +452,7 @@ public class Project implements org.apache.ant.common.event.BuildListener {
* @return the baseDir * @return the baseDir
*/ */
public File getBaseDir() { public File getBaseDir() {
return context.getBaseDir();
return execService.getBaseDir();
} }


/** /**


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

@@ -106,7 +106,9 @@ public class Ant extends AntBase {
*/ */
public void execute() throws ExecutionException { public void execute() throws ExecutionException {
if (baseDir == null) { if (baseDir == null) {
baseDir = getAntContext().getBaseDir();
ExecService execService
= (ExecService)getCoreService(ExecService.class);
baseDir = execService.getBaseDir();
} }
File antFile = null; File antFile = null;


+ 2
- 2
proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntCall.java View File

@@ -69,10 +69,10 @@ public class AntCall extends AntBase {
* @exception ExecutionException if the build fails * @exception ExecutionException if the build fails
*/ */
public void execute() throws ExecutionException { public void execute() throws ExecutionException {
setProperty(MagicProperties.BASEDIR,
getAntContext().getBaseDir().getAbsolutePath());
ExecService execService ExecService execService
= (ExecService)getCoreService(ExecService.class); = (ExecService)getCoreService(ExecService.class);
setProperty(MagicProperties.BASEDIR,
execService.getBaseDir().getAbsolutePath());


execService.callTarget(getProperties(), getTargets()); execService.callTarget(getProperties(), getTargets());
} }


+ 1
- 8
proposal/mutant/src/java/common/org/apache/ant/common/antlib/AntContext.java View File

@@ -87,14 +87,7 @@ public interface AntContext {
throws ExecutionException; throws ExecutionException;


/** /**
* Get the basedir for the current execution
*
* @return the base directory for this execution of Ant
*/
File getBaseDir();

/**
* Gets the location associated witj the AntContext
* Gets the location associated with the AntContext
* *
* @return the location * @return the location
*/ */


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

@@ -114,5 +114,11 @@ public interface ExecService {
*/ */
String getProjectName(); String getProjectName();


/**
* Get the basedir for the current execution
*
* @return the base directory for this execution of Ant
*/
File getBaseDir();
} }



Loading…
Cancel
Save