From e1721225fc634f365fb0855c828b6e98681ee57e Mon Sep 17 00:00:00 2001 From: Costin Manolache Date: Sat, 28 Dec 2002 16:17:07 +0000 Subject: [PATCH] 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 --- src/main/org/apache/tools/ant/taskdefs/ImportTask.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/ImportTask.java b/src/main/org/apache/tools/ant/taskdefs/ImportTask.java index fd8088a86..5bd07c126 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ImportTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/ImportTask.java @@ -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;