an optional package git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@446758 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -241,6 +241,7 @@ | |||||
| <filename name="${optional.package}/script/**/*"/> | <filename name="${optional.package}/script/**/*"/> | ||||
| <filename name="${optional.type.package}/*Script*"/> | <filename name="${optional.type.package}/*Script*"/> | ||||
| <filename name="${util.package}/Script*"/> | <filename name="${util.package}/Script*"/> | ||||
| <filename name="${util.package}/optional/Script*"/> | |||||
| </or> | </or> | ||||
| </selector> | </selector> | ||||
| @@ -462,6 +462,30 @@ public abstract class Definer extends DefBase { | |||||
| this.resource = res; | this.resource = res; | ||||
| } | } | ||||
| /** | |||||
| * Antlib attribute, sets resource and uri. | |||||
| * uri is set the antlib value and, resource is set | |||||
| * to the antlib.xml resource in the classpath. | |||||
| * For example antlib="antlib:org.acme.bland.cola" | |||||
| * corresponds to uri="antlib:org.acme.bland.cola" | |||||
| * resource="org/acme/bland/cola/antlib.xml". | |||||
| * ASF Bugzilla Bug 31999 | |||||
| * @param antlib the value to set. | |||||
| */ | |||||
| public void setAntlib(String antlib) { | |||||
| if (definerSet) { | |||||
| tooManyDefinitions(); | |||||
| } | |||||
| if (!antlib.startsWith("antlib:")) { | |||||
| throw new BuildException( | |||||
| "Invalid antlib attribute - it must start with antlib:"); | |||||
| } | |||||
| setURI(antlib); | |||||
| this.resource = antlib.substring("antlib:".length()).replace('.','/') | |||||
| + "/antlib.xml"; | |||||
| definerSet = true; | |||||
| } | |||||
| /** | /** | ||||
| * Name of the definition | * Name of the definition | ||||
| * @param name the name of the definition | * @param name the name of the definition | ||||
| @@ -20,7 +20,7 @@ package org.apache.tools.ant.taskdefs.optional; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| import org.apache.tools.ant.util.ScriptRunner; | |||||
| import org.apache.tools.ant.util.optional.ScriptRunner; | |||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.Reference; | import org.apache.tools.ant.types.Reference; | ||||
| @@ -36,7 +36,7 @@ import java.util.HashSet; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.tools.ant.util.ClasspathUtils; | import org.apache.tools.ant.util.ClasspathUtils; | ||||
| import org.apache.tools.ant.util.ScriptRunner; | |||||
| import org.apache.tools.ant.util.optional.ScriptRunner; | |||||
| /** | /** | ||||
| * Define a task using a script | * Define a task using a script | ||||
| @@ -18,7 +18,7 @@ | |||||
| package org.apache.tools.ant.types.optional; | package org.apache.tools.ant.types.optional; | ||||
| import org.apache.tools.ant.ProjectComponent; | import org.apache.tools.ant.ProjectComponent; | ||||
| import org.apache.tools.ant.util.ScriptRunner; | |||||
| import org.apache.tools.ant.util.optional.ScriptRunner; | |||||
| import java.io.File; | import java.io.File; | ||||
| @@ -20,7 +20,7 @@ package org.apache.tools.ant.types.optional; | |||||
| import org.apache.tools.ant.filters.TokenFilter; | import org.apache.tools.ant.filters.TokenFilter; | ||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import org.apache.tools.ant.util.ScriptRunner; | |||||
| import org.apache.tools.ant.util.optional.ScriptRunner; | |||||
| /** | /** | ||||
| @@ -18,7 +18,7 @@ | |||||
| package org.apache.tools.ant.types.optional; | package org.apache.tools.ant.types.optional; | ||||
| import org.apache.tools.ant.types.selectors.BaseSelector; | import org.apache.tools.ant.types.selectors.BaseSelector; | ||||
| import org.apache.tools.ant.util.ScriptRunner; | |||||
| import org.apache.tools.ant.util.optional.ScriptRunner; | |||||
| import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
| import java.io.File; | import java.io.File; | ||||
| @@ -15,7 +15,7 @@ | |||||
| * limitations under the License. | * limitations under the License. | ||||
| * | * | ||||
| */ | */ | ||||
| package org.apache.tools.ant.util; | |||||
| package org.apache.tools.ant.util.optional; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.FileInputStream; | import java.io.FileInputStream; | ||||
| @@ -29,6 +29,8 @@ import org.apache.tools.ant.BuildException; | |||||
| import org.apache.tools.ant.ProjectComponent; | import org.apache.tools.ant.ProjectComponent; | ||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.util.FileUtils; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| import java.util.HashMap; | import java.util.HashMap; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||