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

Build Task in the root gradle project does not get displayed #1046

Closed
Tracked by #1129
hannah23280 opened this issue Oct 22, 2021 · 5 comments · Fixed by #1121
Closed
Tracked by #1129

Build Task in the root gradle project does not get displayed #1046

hannah23280 opened this issue Oct 22, 2021 · 5 comments · Fixed by #1121
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@hannah23280
Copy link

Extension Name: vscode-gradle
Extension Version: 3.8.0
OS Version: Windows
VSCode version: 1.61.0

I am developing a gradle-based project, which has nested gradle projects (namely, mainservice and mainservice1), as shown in the below screenshot. I notice that the root gradle project (csv_bundler) does not have a task called build. But yet, i can go to the command prompt and execute gradlew.bat build at the root project.

image

When i execute the gradlew.bat tasks at the root project, the terminal list down all the supported tasks , one of them include build task. But yet in the gradle pane, build task (among others) does not get displayed.
image

For more detail, refer to a previously open request on #794 .
I open a new one, cos the the previously open request is created before microsoft takes over.

@hannah23280 hannah23280 added the bug Something isn't working label Oct 22, 2021
@mozhuanzuojing
Copy link

@hanct build It is provided by the java plugin. If the root project does not apply the plugin, there will be no.
.

@hannah23280
Copy link
Author

@hanct build It is provided by the java plugin. If the root project does not apply the plugin, there will be no. .

Thanks for the hint. Unfortunately, I can't apply java plugin at root level, as there will be error during building. I think cos root level does not have any expected source codes. So i have no choice but to remove apply java plugin at root level, after which the build is successful

@CsCherrYY
Copy link
Collaborator

CsCherrYY commented Oct 29, 2021

@hanct Sorry for the late reply since we just finished the release of version 3.8.1.

After reading your comments and discussion in #794, and tried myself (both in current mechanism and by a separate Gradle plugin), I'm convinced the root project doesn't contain such Build tasks.

But you can still run the tasks under Build category correctly in Gradle CLI or other tooling in the project root, IMO it's from Gradle execute tasks mechanism. Each build task you execute in the root project will tell all the tasks with the same name in subprojects to execure, which makes them "available" or "runnable" in the root project. That's why they are shown in both Gradle tasks CLI and IntelliJ explorer.

@hannah23280
Copy link
Author

@hanct Sorry for the late reply since we just finished the release of version 3.8.1.

After reading your comments and discussion in #794, and tried myself (both in current mechanism and by a separate Gradle plugin), I'm convinced the root project doesn't contain such Build tasks.

But you can still run the tasks under Build category correctly in Gradle CLI or other tooling in the project root, IMO it's from Gradle execute tasks mechanism. Each build task you execute in the root project will tell all the tasks with the same name in subprojects to execure, which makes them "available" or "runnable" in the root project. That's why they are shown in both Gradle tasks CLI and IntelliJ explorer.

@CsCherrYY Hi, thanks for the response. Since "gradle tasks" can returns all the tasks, will it possible to enhance the vscode-gradle, where the root project (that contains subprojects), is able to display all the tasks from the command "gradle tasks". So that developer can just double click on a task under the root project, in order for it to run all tasks with the same name in subprojects.

Reason for such enhancement is because for root projects with many subprojects, it would be very tedious to build/run them individually. Of course, we can run them via CLI, but I thought one benefit of using vscode-gradle extension is to shield us away from typing command line, and instead provide simple click of interface to run gradle tasks.

@CsCherrYY
Copy link
Collaborator

Agree with that we should keep alignment with the command "gradle tasks". Let me investigate first and find a better way to implement it.

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

Successfully merging a pull request may close this issue.

3 participants