Community
Participate
Working Groups
I currently have an Ant build file which uses multiple <import> statements to bring further ant build files into the current build. Because we use the build files for both Windows and Unix, I prefer to use relative paths when specifying the location of the imported build files, so my import statement looks like: <import file="../../build.xml"/> I'd like to be able to use the Eclipse "CTRL-Click" function on these imported files to be able to open them from the current Ant Editor. At the moment when I CTRL-click the <import> I get the following error message: "Current text selection does not resolve to an Ant reference" Ideally what would happen is the the relative paths are understood by the editor and the file is opened in the present (or a new) Ant editor window. Alternatively, it might be possible to put an expansion (+) icon beside every import statement, and when it is click, an in-place import is carried out, and the contents of the imported files are added to the current ant file in the editor, replacing the import statement. This is very wishful thinking I realize. The key enhancement is simply that the relative paths are understood in the import statements, and I can use the CTRL-click functionality.
Using the following test file on 3.4: <project name="Domain" basedir=""> <import file="../../3.4/toBeImported.xml"/> </project> ctrl-clicking correctly opens the relative path buildfile toBeImported.xml. Note that we do have bug 158627.
Created attachment 106318 [details] ant build file which uses import This is an Ant build file which uses an import that I cannot ctrl-click to.
Created attachment 106319 [details] imported build file This is the build file that attachment 106318 [details] imports, but which Eclipse cannot resolve using ctrl-click
I'm still seeing the error I reported with the attached build files. Can you guys have a look and see if you can reproduce on your end? I'm going to re-open the bug until you can verify that the ctrl-click feature does work for the import statement on line 6 of build-common-macros.xml at the moment, I still receive the "current text selection does not resolve to an Ant reference" when I click the link. I'm using Eclipse 3.4 on Win XP SP3 with JRE 1.6.0_06
I should add that both build files are placed in the same directory, and the error appears whether I use either: <import file="./common-build-classpaths.xml"/> or <import file="common-build-classpaths.xml"/>
Thanks for reporting back David. Everything works as expected for me with your test cases. If you try with the simple test case that I outlined in comment #1, does this work for you?
Hey Darrin, No the test-case from Comment #1 does not work for me. I still get "current text selection does not resolve to an Ant reference" Is there any logging or debugging I can turn on to help you with this?
In an effort to rule out the potential interference of plug-ins, I installed a second instance of Eclipse 3.4 and created a new workspace. I tried repeating the Comment #1 testcase, but it still doesn't work with the bare-bones installation.
Created attachment 114172 [details] zip file containing ant build files in ready-to-test directory structure
Can confirm this still isn't fixed in 3.4.1 with a clean workspace. I've uploaded a new zip file demonstrating the issue. If you unzip then open /1/2/build.xml and try to CTRL-click the import link, Eclipse will throw the error message. Eclipse 3.4.1 Java 1.6.0_07 Win XP Pro SP3
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.