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

Set gradle parameter with environmental variables #164

Merged
merged 1 commit into from Aug 21, 2019
Merged

Set gradle parameter with environmental variables #164

merged 1 commit into from Aug 21, 2019

Conversation

gbbirkisson
Copy link
Contributor

@gbbirkisson gbbirkisson commented Aug 20, 2019

Because the ./gradlew script uses the env variable $JAVA_HOME to set the java binary location, not the -Dorg.gradle.java.home parameter, I changed how we called it.

Now it uses the env variables for JAVA_HOME and XP_HOME. This fixes the issue on Linux when the Snap complained about an invalid $JAVA_HOME. Now when running enonic project deploy it uses the distribution rather than Java installed on the machine.

This has been tested on Linux (running bash) and it worked. I have not tested this on Window, Cygwin (Windows) or Mac (Although it should work for bash on macs aswell).

@gbbirkisson gbbirkisson requested a review from pmi August 20, 2019 13:57
@sigdestad
Copy link
Member

How do you control. gradlew? It is automatically generated by Gradle and comes from the projects, not CLI.

@gbbirkisson
Copy link
Contributor Author

gbbirkisson commented Aug 20, 2019

How do you control. gradlew? It is automatically generated by Gradle and comes from the projects, not CLI.

I should have said, changed how we called it :)

The automatically generated script looks at the $JAVA_HOME variable when choosing a Java binary. So by setting that env variable, we control what the script uses.

Copy link
Member

@pmi pmi left a comment

Choose a reason for hiding this comment

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

Works fine on windows too ! 👍

@pmi pmi merged commit 69609a9 into master Aug 21, 2019
@sigdestad
Copy link
Member

Awesome!

@sigdestad
Copy link
Member

We'll need to release a new version asap then...

@alansemenov alansemenov deleted the issue-141 branch June 15, 2020 10:09
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

3 participants