Bug 204904 - Enhance <import> resolving ability
Summary: Enhance <import> resolving ability
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-28 09:06 EDT by David Corley CLA
Modified: 2019-09-06 15:37 EDT (History)
1 user (show)

See Also:


Attachments
ant build file which uses import (4.71 KB, text/xml)
2008-07-02 11:23 EDT, David Corley CLA
no flags Details
imported build file (2.28 KB, text/xml)
2008-07-02 11:24 EDT, David Corley CLA
no flags Details
zip file containing ant build files in ready-to-test directory structure (629 bytes, application/x-zip-compressed)
2008-10-03 06:17 EDT, David Corley CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Corley CLA 2007-09-28 09:06:00 EDT
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.
Comment 1 Darin Swanson CLA 2008-07-01 18:29:07 EDT
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.
Comment 2 David Corley CLA 2008-07-02 11:23:55 EDT
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.
Comment 3 David Corley CLA 2008-07-02 11:24:57 EDT
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
Comment 4 David Corley CLA 2008-07-02 11:28:29 EDT
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
Comment 5 David Corley CLA 2008-07-02 11:29:46 EDT
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"/>
Comment 6 Darin Swanson CLA 2008-07-02 13:50:09 EDT
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?
Comment 7 David Corley CLA 2008-07-03 10:21:47 EDT
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?
Comment 8 David Corley CLA 2008-07-03 10:40:49 EDT
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.
Comment 9 David Corley CLA 2008-10-03 06:17:10 EDT
Created attachment 114172 [details]
zip file containing ant build files in ready-to-test directory structure
Comment 10 David Corley CLA 2008-10-03 06:19:16 EDT
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
Comment 11 Eclipse Webmaster CLA 2019-09-06 15:37:35 EDT
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.