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

Support of setting the current working directory and environment variables. #3180

Merged
merged 1 commit into from Sep 30, 2021

Conversation

entlicher
Copy link
Contributor

Extending ExplicitProcessParameters with working directory and environment.
Adapted for Maven and native image.
Gradle support is TBD.

@entlicher
Copy link
Contributor Author

Gradle implementation added, thanks @sdedic for hints.

Tests and Javadoc added.

* @param command the command to run the native image.
* @return a new builder
*/
public static Builder newBuilder(List<String> command) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this method be more usable with vargargs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, ExplicitProcessParameters and ProcessBuilder have both list and vararg methods. List is used in the implementation, hence I've added a list method into the API. A method that takes vararg can be easily added in the future when the appropriate use-case emerges.

@@ -110,6 +110,18 @@
in action's context Lookup. See <a href="@TOP@/org/netbeans/modules/gradle/java/api/ProjectActions.html#TOKEN_JAVAEXEC_ARGS">ProjectActions.TOKEN_JAVAEXEC_ARGS</a>
for more details.
</api>
<api category="stable" group="property" name="javaExec.runWorkingDir" type="export">

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is type="import" as you are importing/using the Gradle API here. Thanks for documenting the contract anyway!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, there's export for other properties as well. IMHO the idea is, that these properties are created from ExplicitProcessParameters. We are essentially providing property values that are used in NetBeansRunSinglePlugin.groovy then.

@entlicher entlicher merged commit 03bd150 into apache:master Sep 30, 2021
@ebarboni ebarboni added this to the 12.6 milestone Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants