Browse Source

Quick fail if ImportTask is used with a ProjectHelper that doesn't

support imports. The original helper won't work ( because of eval order ),
and embed will fail too ( since it can't use 1.6 features - one of the
goals is to work in ant1.5 ).

I'm ready to move the dynamic properties and the component hooks - I'll
porbably do it this weekend ( most people are in vacation, so fewer
will feel any breakage ). In any case [embed] should now used only
if you want to use (some) new features in ant1.5.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273707 13f79535-47bb-0310-9956-ffa450edef68
master
Costin Manolache 22 years ago
parent
commit
e1721225fc
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/main/org/apache/tools/ant/taskdefs/ImportTask.java

+ 5
- 0
src/main/org/apache/tools/ant/taskdefs/ImportTask.java View File

@@ -100,6 +100,11 @@ public class ImportTask extends Task {
ProjectHelper helper=
(ProjectHelper)project.getReference("ant.projectHelper");
Vector importStack=helper.getImportStack();
if( importStack.size() == 0) {
// this happens if ant is used with a project
// helper that doesn't set the import.
throw new BuildException("import requires support in ProjectHelper");
}
Object currentSource=importStack.elementAt(importStack.size() - 1);

// ProjectHelper2.AntXmlContext context;


Loading…
Cancel
Save