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

input variables not supported in task args #1281

Closed
dshick-nydig opened this issue Sep 6, 2022 · 1 comment · Fixed by #1298
Closed

input variables not supported in task args #1281

dshick-nydig opened this issue Sep 6, 2022 · 1 comment · Fixed by #1298
Labels
bug Something isn't working
Milestone

Comments

@dshick-nydig
Copy link

Extension Name: vscode-gradle
Extension Version: v3.12.4
OS Version: macOS Monterey
VSCode version: 1.70.2

Describe the bug
PR #1035 doesn't seem to have included support for input variables

To Reproduce
Define a gradle workflow and reference an input variable from the args, e.g.

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "gradle",
			"script": "app:run",
			"args": "-PfileToRun=${input:fileToRun}",
			...
		}
	],
	"inputs": [
		{
			"type": "pickString",
			"id": "fileToRun",
			"description": "What file do you want to run?",
			"options": [
				"File1",
				"File2"
			]
		},
	]
}

A possible build.gradle.kts might include...

application {
    // Define the main class for the application.
    mainClass.set("com.example." + project.findProperty("fileToRun").toString() + "Kt")
}

Expected behavior
the input variable should be dereferenced in the resulting command's arguments

Output from "Gradle for Java"

> :app:run
Error: Could not find or load main class com.example.${input:fileToRun}Kt
Caused by: java.lang.ClassNotFoundException: com.example.${input:fileToRun}Kt

Does the bug still exist if you disable all other extensions?
Yes

@dshick-nydig dshick-nydig added the bug Something isn't working label Sep 6, 2022
@CsCherrYY CsCherrYY added enhancement New feature or request and removed enhancement New feature or request labels Nov 4, 2022
@CsCherrYY
Copy link
Collaborator

I can reproduce this bug. It seems that we didn't put the resolved args into execution args, I will fix 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants