Browse Source

make sure prefix isn't set to project name in import. make sure it is set even when no target has been encountered in include.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@713745 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
193919c329
2 changed files with 11 additions and 5 deletions
  1. +3
    -0
      docs/manual/CoreTasks/include.html
  2. +8
    -5
      src/main/org/apache/tools/ant/helper/ProjectHelper2.java

+ 3
- 0
docs/manual/CoreTasks/include.html View File

@@ -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.".</p>

<p><code>&lt;import&gt;</code> contribute to the prefix as well, but
only if their <code>as</code> attribute has been specified.

<h4>Special Properties</h4>

<p>Included files are treated as they are present in the main


+ 8
- 5
src/main/org/apache/tools/ant/helper/ProjectHelper2.java View File

@@ -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;
}



Loading…
Cancel
Save