From 7a5907077c8be81ffbc7da2952960c4a12c8faa3 Mon Sep 17 00:00:00 2001 From: Manuel Fuchs Date: Fri, 4 Oct 2024 10:43:07 +0200 Subject: [PATCH] Add Micronaut and Quarkus support (#144) --- CHANGELOG.md | 1 + bin/compile | 6 ++++++ bin/release | 6 ++++++ lib/common.sh | 10 ++++++++++ 4 files changed, 23 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b099cb1..e51e34e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [Unreleased] * Remove heroku-18 support ([#128](https://github.com/heroku/heroku-buildpack-gradle/pull/128)) +* Add default process type and build task detection for Micronaut and Quarkus. ([#144](https://github.com/heroku/heroku-buildpack-gradle/pull/144)) ## [v39] - 2022-12-06 diff --git a/bin/compile b/bin/compile index e51bce4..b619360 100755 --- a/bin/compile +++ b/bin/compile @@ -39,6 +39,12 @@ elif is_spring_boot $BUILD_DIR; then mcount "task.spring" fi DEFAULT_GRADLE_TASK="build -x ${GRADLE_CHECK_TASK}" +elif is_micronaut $BUILD_DIR; then + echo "-----> Micronaut detected" + DEFAULT_GRADLE_TASK="shadowJar -x ${GRADLE_CHECK_TASK}" +elif is_quarkus $BUILD_DIR; then + echo "-----> Quarkus detected" + DEFAULT_GRADLE_TASK="build -x ${GRADLE_CHECK_TASK}" elif is_ratpack $BUILD_DIR; then echo "-----> Ratpack detected" mcount "task.ratpack" diff --git a/bin/release b/bin/release index 856c45d..9c47fe5 100755 --- a/bin/release +++ b/bin/release @@ -37,6 +37,12 @@ if [ ! -f $BUILD_DIR/Procfile ]; then elif is_ratpack $BUILD_DIR && [ $(_ratpack_proc_count $BUILD_DIR) -eq 1 ]; then echo "default_process_types:" echo " web: $(_ratpack_proc $BUILD_DIR)" + elif is_micronaut $BUILD_DIR; then + echo "default_process_types:" + echo " web: java -Dmicronaut.server.port=\$PORT \$JAVA_OPTS -jar build/libs/*.jar" + elif is_quarkus $BUILD_DIR; then + echo "default_process_types:" + echo " web: java -Dquarkus.http.port=\$PORT \$JAVA_OPTS -jar build/quarkus-app/quarkus-run.jar" else echo "{}" fi diff --git a/lib/common.sh b/lib/common.sh index bc71a0e..389c898 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -26,6 +26,16 @@ is_spring_boot() { test -z "$(grep "org.grails:grails-" ${gradleFile})" } +is_micronaut() { + local gradleFile="$(gradle_build_file ${1})" + test -f ${gradleFile} && test -n "$(grep "io.micronaut" ${gradleFile})" +} + +is_quarkus() { + local gradleFile="$(gradle_build_file ${1})" + test -f ${gradleFile} && test -n "$(grep "io.quarkus" ${gradleFile})" +} + is_ratpack() { local gradleFile="$(gradle_build_file ${1})" test -f ${gradleFile} &&