-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
The application plugin's run task should not change the working directory #6074
Comments
Since Gradle 4.9 the run task can directly take arguments, see https://docs.gradle.org/4.9/release-notes.html#command-line-args-supported-by-javaexec However, note that any relative paths specified as arguments are interpreted as relative to the project directory, see gradle/gradle#6074 Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
Since Gradle 4.9 the run task can directly take arguments, see https://docs.gradle.org/4.9/release-notes.html#command-line-args-supported-by-javaexec However, note that any relative paths specified as arguments are interpreted as relative to the project directory, see gradle/gradle#6074 Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
Since Gradle 4.9 the run task can directly take arguments, see https://docs.gradle.org/4.9/release-notes.html#command-line-args-supported-by-javaexec However, note that any relative paths specified as arguments are interpreted as relative to the project directory, see gradle/gradle#6074 Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
Since Gradle 4.9 the run task can directly take arguments, see https://docs.gradle.org/4.9/release-notes.html#command-line-args-supported-by-javaexec However, note that any relative paths specified as arguments are interpreted as relative to the project directory, see gradle/gradle#6074 Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
Since Gradle 4.9 the run task can directly take arguments, see https://docs.gradle.org/4.9/release-notes.html#command-line-args-supported-by-javaexec However, note that any relative paths specified as arguments are interpreted as relative to the project directory, see gradle/gradle#6074 Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
Since Gradle 4.9 the run task can directly take arguments, see https://docs.gradle.org/4.9/release-notes.html#command-line-args-supported-by-javaexec However, note that any relative paths specified as arguments are interpreted as relative to the project directory, see gradle/gradle#6074 Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
This issue has been automatically closed due to inactivity. If you can reproduce this on a recent version of Gradle or if you have a good use case for this feature, please feel free to to let know so we can reopen the issue. Please try to provide steps to reproduce, a quick explanation of your use case or a high-quality pull request. |
Gradle 4.9 added support for passing arguments to JavaExec tasks. By default, JavaExec tasks change the working directory to the project directory. However, this default behavior is confusing when using the application plugin's
run
task (which is a JavaExec task) and passing relative file paths as part of the arguments.Expected Behavior
Assume a multi-project and a directory structure like
When running an application like
I would expect the application to look for
input-file.txt
at~/development/input-file.txt
.Current Behavior
The application looks for
input-file.txt
at~/development/app/input-file.txt
.Context
Now that arguments can be passed to JavaExec tasks, it's convenient to use that feature as a drop-in replacement for calling the start scripts that can be generated by the application plugin. However, currently relative file paths need to be adjusted to take the implicit change of the working directory into account.
Steps to Reproduce (for bugs)
I wouldn't necessarily consider this to be a bug, but rather an ask for a change in behavior to increase convenience.
Your Environment
The text was updated successfully, but these errors were encountered: