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 #794

Closed
hannah23280 opened this issue Nov 21, 2020 · 11 comments
Closed

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

hannah23280 opened this issue Nov 21, 2020 · 11 comments
Assignees
Labels
bug Something isn't working

Comments

@hannah23280
Copy link

Extension Name: vscode-gradle
Extension Version: 3.5.2
OS Version:Windows
VSCode version: 1.51.1

Describe the bug
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

@hannah23280 hannah23280 added the bug Something isn't working label Nov 21, 2020
@hannah23280 hannah23280 changed the title Build Task does not get displayed Build Task in the root gradle project does not get displayed Nov 21, 2020
@hannah23280
Copy link
Author

My goal is to execute build task at root gradle project, so as to trigger build task for all the nested child projects. I can do it via terminal manual typing, but could not do it via gradle pane

@badsyntax
Copy link
Collaborator

Thanks for the report. I can reproduce on a clean project using gradle init. Seems like the Gradle API won't return root runnable tasks if there's no corresponding build.gradle file for root. Not sure why, but i'll investigate.

(Although not ideal, you can still run root tasks using the "Run a Gradle Build" feature, by clicking on the Terminal icon)

@hannah23280
Copy link
Author

Thanks for the report. I can reproduce on a clean project using gradle init. Seems like the Gradle API won't return root runnable tasks if there's no corresponding build.gradle file for root. Not sure why, but i'll investigate.

(Although not ideal, you can still run root tasks using the "Run a Gradle Build" feature, by clicking on the Terminal icon)

Noted. For your info, my root workspace folder has a build.gradle, and is the parent of the nested gradle projects called main-service and main-service1

@hannah23280
Copy link
Author

Just for your reference, Intellij displays the circled task at the root gradle project. But the vscode-gradle does not display them

image

@badsyntax
Copy link
Collaborator

badsyntax commented Mar 6, 2021

I've not seeing root "default" tasks when I run ./gradlew tasks --all. I don't know what gradle api I should be using to discover those tasks. I'm currently using getTasks but it's not listing these "default" tasks.

They seem like special case tasks that are internal to gradle.

I wish I knew how intellij is discovering those tasks!

@hannah23280
Copy link
Author

I've not seeing root "default" tasks when I run ./gradlew tasks --all. I don't know what gradle api I should be using to discover those tasks. I'm currently using getTasks but it's not listing these "default" tasks.

They seem like special case tasks that are internal to gradle.

I wish I knew how intellij is discovering those tasks!

Hi,
I tried run ./gradlew tasks (without the --all) in the root. It is able to discover those tasks (e.g root's build task).
I try asking gradle engineer to see if they have any idea what api to call.

@hannah23280
Copy link
Author

meanwhile, have u tried getAllTasks api?

@hannah23280
Copy link
Author

Bump

@badsyntax
Copy link
Collaborator

hi @hanct. fyi the project has been transferred to Microsoft and i'm no longer doing active development on it. i'm sure the MS devs will eventually pick this up, but they probably aren't getting notified in these old issues.

@hannah23280
Copy link
Author

hi @hanct. fyi the project has been transferred to Microsoft and i'm no longer doing active development on it. i'm sure the MS devs will eventually pick this up, but they probably aren't getting notified in these old issues.

Understood. Thanks. I will open another new request again. Thanks for helping to maintain this great extension all these while.

@CsCherrYY
Copy link
Collaborator

closed in #1046

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

No branches or pull requests

3 participants