Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Gradle wrapper executables must exist at the root of the workspace folders? #717

Closed
hannah23280 opened this issue Sep 29, 2020 · 9 comments · Fixed by #744
Closed
Assignees
Labels
enhancement New feature or request

Comments

@hannah23280
Copy link

hannah23280 commented Sep 29, 2020

vscode-gradle extensions: v3.4.5

Hi,
I notice that one of the requirement for the extension to work is "Local Gradle wrapper executables must exist at the root of the workspace folders". As shown in the screenshot, the gradlew.bat is not at the root of the workspace (Tutorial1 folder), but at the root of the subfolder called demoMS1. Can i check that vscode-gradle extension will not support such workspace configuration?

image

@hannah23280 hannah23280 added the enhancement New feature or request label Sep 29, 2020
@hannah23280
Copy link
Author

please ignore my query. I misunderstand the meaning of "Local Gradle wrapper executables must exist at the root of the workspace folders".

@badsyntax
Copy link
Collaborator

Btw this extension does support nested projects, you just need to enable that feature with the setting "gradle.nestedProjects".

@hannah23280
Copy link
Author

Btw this extension does support nested projects, you just need to enable that feature with the setting "gradle.nestedProjects".
Thanks! Never know have such setting.

@badsyntax
Copy link
Collaborator

here's some reasoning as to why it's not enabled by default: #339 (comment)

@hannah23280
Copy link
Author

here's some reasoning as to why it's not enabled by default: #339 (comment)

Noted. Thanks. But regardless of whether nested projects are enabled or not, the folder added to the workspace must contain a build.gradle file. In order word, I can't add a folder A to the workspace, in which folder A does not have build.gradle, even if its subfolder folder B has. Not sure if my understanding is correct.

@badsyntax
Copy link
Collaborator

badsyntax commented Oct 8, 2020

But regardless of whether nested projects are enabled or not, the folder added to the workspace must contain a build.gradle file.

if "gradle.nestedProjects": true, the folder added to the workspace does not need to contain any gradle build files.

Consider the following directory tree:

─── projecta
    └── projectb
        ├── build.gradle
        └── gradlew

If I open projecta with "gradle.nestedProjects": false, then the extension won't load the gradle projectb.

If I open projecta with "gradle.nestedProjects": true, then the extension will load the gradle projectb.

(To clarify, gradle project discovery is based on the wrapper scripts not the build.gradle files [as gradle projects can have multiple nested build.gradle files])

I think I need to update the README to make this more obvious. The following doesn't reflect what i've mentioned:

Local Gradle wrapper executables must exist at the root of the workspace folders

It should rather say something like:

Local Gradle wrapper executables must exist at the root of the Gradle projects

I'm going to re-open this ticket for tracking purposes.

@badsyntax
Copy link
Collaborator

I've updated the README. Hopefully it's a little clearer.

@hannah23280
Copy link
Author

Thanks for updating the README to improve clarity.
I just come to realize i have misinterpret the meaning of gradle.nestedProjects. I initially still thought nestedProjects refer to multi-project gradle where we have a root gradle project with one or more nested child gradle project. Then now i realize these are 2 different things. But now i get it that the "nestedProjects" means gradle projects that are nested inside the root folder, such that once this setting is set to true, the root folder no longer need to have the local gradle wrapper executable.

Since we are on the topic of gradle.nestedProjects, just to highlight to you in my vscode IDE, i saw that there is no description for the gradle.nestedProjects (see screenshot), but other settings have.

image

@badsyntax
Copy link
Collaborator

Yes that's all correct.

Thanks for pointing out the missing description, i am fixing that with #745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants