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

Add environmentVariables to gradle task quarkusDev #32662

Merged
merged 1 commit into from
Apr 15, 2023

Conversation

Eng-Fouad
Copy link
Contributor

Closes #32661

@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle labels Apr 15, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Apr 15, 2023

Thanks for your pull request!

The title of your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)

This message is automatically generated by a bot.

@Eng-Fouad Eng-Fouad changed the title add environmentVariables to gradle task quarkusDev Add environmentVariables to gradle task quarkusDev Apr 15, 2023
@Eng-Fouad Eng-Fouad force-pushed the gradle-dev-env-vars branch 2 times, most recently from 816ffbc to 0da1e2d Compare April 15, 2023 05:10
@aloubyansky
Copy link
Member

Thanks @Eng-Fouad, do you think you could add a little test in https://github.com/quarkusio/quarkus/tree/main/integration-tests/gradle for this feature?

@Eng-Fouad
Copy link
Contributor Author

Thanks @Eng-Fouad, do you think you could add a little test in https://github.com/quarkusio/quarkus/tree/main/integration-tests/gradle for this feature?

Yes sure, I will do.

@quarkus-bot

This comment has been minimized.

@Eng-Fouad Eng-Fouad force-pushed the gradle-dev-env-vars branch 2 times, most recently from ddba37e to 737fc04 Compare April 15, 2023 10:20
@Eng-Fouad
Copy link
Contributor Author

@aloubyansky I just added a simple test. However, I could not run the Quarkus project on my machine, so I wrote the test without compilation. Could you please verify the test from your side? Thanks.

@aloubyansky
Copy link
Member

Thanks @Eng-Fouad, let's see what the CI says.

@aloubyansky
Copy link
Member

Looks like it's passing @Eng-Fouad, thanks! Would you mind also adding a note about it in https://github.com/quarkusio/quarkus/blob/main/docs/src/main/asciidoc/gradle-tooling.adoc? It'll end up in https://quarkus.io/guides/gradle-tooling#dev-mode. You could do that in a separate PR, if you like.

@Eng-Fouad
Copy link
Contributor Author

Looks like it's passing @Eng-Fouad, thanks! Would you mind also adding a note about it in https://github.com/quarkusio/quarkus/blob/main/docs/src/main/asciidoc/gradle-tooling.adoc? It'll end up in https://quarkus.io/guides/gradle-tooling#dev-mode. You could do that in a separate PR, if you like.

OK, I will add it to docs 👍

@Eng-Fouad
Copy link
Contributor Author

@aloubyansky using Kotlin DSL, which one is correct?

tasks.quarkusDev {
    environmentVariables = mapOf("FOO_VALUE" to "abc", "BAR_VALUE" to "def")
}

or

tasks.quarkusDev {
    environmentVariables.set(mapOf("FOO_VALUE" to "abc", "BAR_VALUE" to "def"))
}

@Eng-Fouad
Copy link
Contributor Author

I chose: environmentVariables.set()

Copy link
Contributor

@gastaldi gastaldi left a comment

Choose a reason for hiding this comment

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

Nice!

@gastaldi gastaldi requested a review from glefloch April 15, 2023 12:19
@github-actions
Copy link

github-actions bot commented Apr 15, 2023

🙈 The PR is closed and the preview is expired.

@quarkus-bot
Copy link

quarkus-bot bot commented Apr 15, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@aloubyansky aloubyansky merged commit 8e81b1e into quarkusio:main Apr 15, 2023
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label Apr 15, 2023
@quarkus-bot quarkus-bot bot added this to the 3.1 - main milestone Apr 15, 2023
@Eng-Fouad Eng-Fouad deleted the gradle-dev-env-vars branch April 15, 2023 23:05
@maxandersen
Copy link
Member

maxandersen commented Apr 16, 2023

does this not overwrite users actual environment meaning users with FOO explicitly set in build.gradle can no longer do:

FOO=whatever gradle quarkusDev

as gradle build will override the environment?

That is not good IMO as it changes the order of priority/locality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/documentation area/gradle Gradle kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support setting environment variables in Gradle quarkusDev
4 participants