diff --git a/docs/manual/CoreTasks/include.html b/docs/manual/CoreTasks/include.html index 5afa06748..729741e73 100644 --- a/docs/manual/CoreTasks/include.html +++ b/docs/manual/CoreTasks/include.html @@ -74,6 +74,9 @@ that are not possible with entity includes: "b", then the targets of that last build file will be prefixed by "a.b.".

+

<import> contribute to the prefix as well, but + only if their as attribute has been specified. +

Special Properties

Included files are treated as they are present in the main diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java index 831a7d685..606026747 100644 --- a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java +++ b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java @@ -687,6 +687,14 @@ public class ProjectHelper2 extends ProjectHelper { if (!context.isIgnoringProjectTag()) { project.setName(value); project.addReference(value, project); + } else if (isInIncludeMode()) { + if (!"".equals(value) + && (getCurrentTargetPrefix() == null + || getCurrentTargetPrefix().length() == 0) + ) { + // help nested include tasks + setCurrentTargetPrefix(value); + } } } } else if (key.equals("id")) { @@ -918,11 +926,6 @@ public class ProjectHelper2 extends ProjectHelper { projectName = null; } - // help nested include tasks - if (projectName != null) { - setCurrentTargetPrefix(projectName); - } - return projectName; }