ASF Bugzilla – Attachment 13904 Details for
Bug 22901
[Patch] -only option to execute target(s) without dependencies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
patch (text/plain), 6.02 KB, created by
Alexey Solofnenko
on 2005-01-06 05:47:21 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Alexey Solofnenko
Created:
2005-01-06 05:47:21 UTC
Size:
6.02 KB
patch
obsolete
>Index: src/main/org/apache/tools/ant/Executor.java >=================================================================== >RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/Executor.java,v >retrieving revision 1.2 >diff -u -r1.2 Executor.java >--- src/main/org/apache/tools/ant/Executor.java 1 Dec 2004 17:52:25 -0000 1.2 >+++ src/main/org/apache/tools/ant/Executor.java 6 Jan 2005 04:45:43 -0000 >@@ -31,4 +31,10 @@ > */ > void executeTargets(Project project, String[] targetNames) > throws BuildException; >+ >+ /** >+ * Returns an executor for sub ANTs. >+ * @return Executor child executor >+ */ >+ Executor getChildExecutor(); > } >Index: src/main/org/apache/tools/ant/Project.java >=================================================================== >RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/Project.java,v >retrieving revision 1.180 >diff -u -r1.180 Project.java >--- src/main/org/apache/tools/ant/Project.java 14 Dec 2004 23:52:08 -0000 1.180 >+++ src/main/org/apache/tools/ant/Project.java 6 Jan 2005 04:45:44 -0000 >@@ -1050,16 +1050,11 @@ > } > > /** >- * Execute the specified sequence of targets, and the targets >- * they depend on. >- * >- * @param targetNames A vector of target name strings to execute. >- * Must not be <code>null</code>. >- * >- * @exception BuildException if the build failed >+ * Returns project's executor. If necessary it will create one. >+ * @throws BuildException if executor cannot be created. >+ * @return Executor project executor > */ >- public void executeTargets(Vector targetNames) throws BuildException { >- >+ public Executor getExecutor() throws BuildException { > Object o = getReference("ant.executor"); > if (o == null) { > String classname = getProperty("ant.executor.class"); >@@ -1089,10 +1084,32 @@ > if (o == null) { > throw new BuildException("Unable to obtain a Target Executor instance."); > } else { >- String[] targetNameArray = (String[]) (targetNames.toArray( >- new String[targetNames.size()])); >- ((Executor) o).executeTargets(this, targetNameArray); >+ return (Executor) o; > } >+ } >+ >+ /** >+ * Sets project's executor. >+ * @param executor Executor >+ */ >+ public void setExecutor(Executor executor) { >+ addReference("ant.executor", executor); >+ } >+ >+ /** >+ * Execute the specified sequence of targets, and the targets >+ * they depend on. >+ * >+ * @param targetNames A vector of target name strings to execute. >+ * Must not be <code>null</code>. >+ * >+ * @exception BuildException if the build failed >+ */ >+ public void executeTargets(Vector targetNames) throws BuildException { >+ >+ String[] targetNameArray = (String[]) (targetNames.toArray( >+ new String[targetNames.size()])); >+ getExecutor().executeTargets(this, targetNameArray); > } > > /** >Index: src/main/org/apache/tools/ant/helper/DefaultExecutor.java >=================================================================== >RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/helper/DefaultExecutor.java,v >retrieving revision 1.3 >diff -u -r1.3 DefaultExecutor.java >--- src/main/org/apache/tools/ant/helper/DefaultExecutor.java 14 Dec 2004 20:54:00 -0000 1.3 >+++ src/main/org/apache/tools/ant/helper/DefaultExecutor.java 6 Jan 2005 04:45:44 -0000 >@@ -38,4 +38,8 @@ > } > } > >+ // inherit doc >+ public Executor getChildExecutor() { >+ return new SingleCheckExecutor(); >+ } > } >Index: src/main/org/apache/tools/ant/helper/KeepGoingExecutor.java >=================================================================== >RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/helper/KeepGoingExecutor.java,v >retrieving revision 1.2 >diff -u -r1.2 KeepGoingExecutor.java >--- src/main/org/apache/tools/ant/helper/KeepGoingExecutor.java 7 Dec 2004 06:43:42 -0000 1.2 >+++ src/main/org/apache/tools/ant/helper/KeepGoingExecutor.java 6 Jan 2005 04:45:44 -0000 >@@ -48,4 +48,8 @@ > } > } > >+ // inherit doc >+ public Executor getChildExecutor() { >+ return new SingleCheckExecutor(); >+ } > } >Index: src/main/org/apache/tools/ant/helper/SingleCheckExecutor.java >=================================================================== >RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/helper/SingleCheckExecutor.java,v >retrieving revision 1.2 >diff -u -r1.2 SingleCheckExecutor.java >--- src/main/org/apache/tools/ant/helper/SingleCheckExecutor.java 7 Dec 2004 06:43:42 -0000 1.2 >+++ src/main/org/apache/tools/ant/helper/SingleCheckExecutor.java 6 Jan 2005 04:45:44 -0000 >@@ -40,4 +40,8 @@ > project.topoSort(targetNames, project.getTargets(), false)); > } > >+ // inherit doc >+ public Executor getChildExecutor() { >+ return this; >+ } > } >Index: src/main/org/apache/tools/ant/taskdefs/Ant.java >=================================================================== >RCS file: /home/cvspublic/ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v >retrieving revision 1.112 >diff -u -r1.112 Ant.java >--- src/main/org/apache/tools/ant/taskdefs/Ant.java 22 Dec 2004 09:47:37 -0000 1.112 >+++ src/main/org/apache/tools/ant/taskdefs/Ant.java 6 Jan 2005 04:45:44 -0000 >@@ -64,9 +64,6 @@ > */ > public class Ant extends Task { > >- /** Target Executor */ >- private static final Executor EXECUTOR = new SingleCheckExecutor(); >- > /** the basedir where is executed the build file */ > private File dir = null; > >@@ -382,8 +379,8 @@ > try { > log("Entering " + antFile + "...", Project.MSG_VERBOSE); > newProject.fireSubBuildStarted(); >- EXECUTOR.executeTargets(newProject, >- (String[]) (locals.toArray(new String[locals.size()]))); >+ newProject.setExecutor(getProject().getExecutor().getChildExecutor()); >+ newProject.executeTargets(locals); > > } catch (BuildException ex) { > t = ProjectHelper
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22901
:
8043
| 13904 |
13905