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 support for Gradle builds in addition to Maven #118

Closed
vorburger opened this issue Mar 4, 2018 · 3 comments
Closed

add support for Gradle builds in addition to Maven #118

vorburger opened this issue Mar 4, 2018 · 3 comments

Comments

@vorburger
Copy link
Collaborator

Would there be any interest in a contribution to this project to build Gradle projects, in addition to Maven?

It doesn't seem that hard to add a something like this here:

if [ -f "${S2I_SOURCE_DIR}/*.gradle*" ]; then

note the use of *.gradle* in order to also allow build.gradle.kts for the Gradle Kotlin DSL, and myProjectName.gradle.

if present, then run something like ./gradlew --gradle-user-home=${S2I_ARTIFACTS_DIR}/gradle-home --project-cache-dir=${S2I_ARTIFACTS_DIR}/gradle-project-cache build (TBC, probably with a GRADLE_ARGS and/or GRADLE_ARGS_APPEND, similar to the MAVEN_ARGS and MAVEN_ARGS_APPEND).

I would limit this to support only the Gradle wrapper, and not even bother to add a Gradle distribution into the image. Just because using the wrapper is VERY widespread in Gradle based project (contrary to the maven-wrapper), and saves a ton of "which version" hassles, which for frequently releasing Gradle is even more important than with Maven (BTW surprised we're on ancient Maven 3.3.3 instead of latest 3.5.2 here...). The overhead of downloading a Gradle distribution IMHO is manageable with incremental builds by preserving the --gradle-user-home and --project-cache-dir accross builds; in the bigger picture of typically many many dependencies, the Gradle distribution itself is really just another such dependency.

BTW incremental builds with Gradle should be blazingly fast, not only avoiding dependency re-downloads, but truly incrementallying building code changes themselves (which never really works reliably in Maven; BTW I'm surprised we don't do clean package instead of just package here).

It should also include the equivalent of #110.

@vorburger
Copy link
Collaborator Author

@rhuss @ctron @apupier @chirino @jamesnetherton how do you like #121 ? It works e.g. with https://github.com/vorburger/s2i-java-example/tree/gradle (if you want to try, note "git checkout gradle" branch...) - which something like #120 could "prove" on the PR (and ensure future non-regression for).

vorburger added a commit to OASIS-learn-study/minecraft-storeys-maker that referenced this issue May 1, 2018
To work, this requires vorburger/s2i#gradle which includes:
 * fabric8io-images/s2i#146
 * fabric8io-images/s2i#118
vorburger added a commit to vorburger/s2i that referenced this issue May 1, 2018
rhuss pushed a commit to vorburger/s2i that referenced this issue May 15, 2018
@rhuss rhuss closed this as completed in b77b0a8 May 15, 2018
rhuss added a commit that referenced this issue May 15, 2018
add Gradle build support, initial version (fixes #118)
rhuss added a commit that referenced this issue May 15, 2018
add java/examples/gradle and cover it in test.sh (#118)
@toretest
Copy link

toretest commented Nov 7, 2019

"/usr/local/s2i/assemble: line 214: ./gradlew: Permission denied" in minishift when try to build my own gradle project

@vorburger
Copy link
Collaborator Author

vorburger commented Nov 7, 2019 via email

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

No branches or pull requests

2 participants