NickHeap2 / vscode-ant

Visual Studio Code Ant Task Runner Extension published on the marketplace
MIT License
6 stars 4 forks source link

ATR: Workspace has no build.xml files. #14

Open Tank-Missile opened 4 years ago

Tank-Missile commented 4 years ago

I have a single workspace which houses multiple projects. One of these projects has a build.xml file. By modifying buildFileDirectories to look into the project's root directory, the build.xml file should be found. However, that is not the case. Instead, I get the error ATR: Workspace has no build.xml files. no matter what I set buildFileDirectories to. My platform is Linux. If my workspace is located in /home/\\/Projects, and my project and build.xml file is located in /home/\\/Projects/ant-project, what should I set buildFileDirectories to?

sflynn850 commented 4 years ago

Hi there - I also am experiencing this issue; platform is Windows 10.

EDIT: I suspect this may be an issue with the way multi-root workspaces work?

EDIT EDIT: Yep, this.rootPath always gets defined with the first workspaceFolder (workspaceFolder[0]), and never searches in alternate workspace folders.

You can replicate this issue with the following. Imagine folderA and folderB, both with valid build.xml files, and folderC, without any build.xml file.

1) If you open only one of folderA or folderB by themselves, you'll see the ant tasks in the ATR panel. If you then add the other folder to the workspace, you'll notice that those tasks are not added to the ATR panel. 2) If you open folderC, you'll (properly) see no ant tasks. If you then add folderA or folderB, you'll (improperly) still see no ant tasks.

tl;dr: the rootPath bit needs to be rewritten to properly scan for the build.xml files in multi-root workspaces. If I have enough time today/this weekend, I'll submit a PR.

NickHeap2 commented 4 years ago

Sorry for the delay (the usual workload issues). I've actually created a branch for this and started working on it. Have just committed the WIP. If you fancy doing a PR then that's great otherwise I'll try and get back on this sometime later this week.

sflynn850 commented 4 years ago

Fantastic, thank you! I didn't get to it this weekend (see also: workload issues, haha).

NickHeap2 commented 4 years ago

@Tank-Missile, @sflynn850 I've finally released v0.3.0 which will scan workspace folders in turn until it hits one with a build file. Hopefully this will work for people until I get time to do the changes to support multiple folders with multiple build files.

sflynn850 commented 4 years ago

Thanks so much!

blueoak-dhananjaysinghsengar commented 3 years ago

I still have got the same problem. I am on Windows 10.

NickHeap2 commented 3 years ago

@blueoak-dhananjaysinghsengar Do you have details of your environment so that I can try and re-create?

blueoak-dhananjaysinghsengar commented 3 years ago

@NickHeap2 here are the details - OS Name Microsoft Windows 10 Home Version 10.0.19041 Build 19041 Ant Target Runner version v0.3.0

Let me know if you are after any other details.

NickHeap2 commented 3 years ago

@blueoak-dhananjaysinghsengar there shouldn't be an issue with that combination. If you can give me details of your workspace layout and settings I'm happy to get it working for you.

tiagoccarreira commented 8 months ago

I have the same issue : ATR: Workspace has no build.xml files.