@@ -2,7 +2,7 @@ class Micronaut < Formula
22 desc "Modern JVM-based framework for building modular microservices"
33 homepage "https://micronaut.io/"
44 url "https://github.com/micronaut-projects/micronaut-starter/archive/refs/tags/v4.10.11.tar.gz"
5- sha256 "c5f4187cb9c2407127a3fda64680ff50d073d5f39cacb9d7a6e04689423b7328 "
5+ sha256 "888d5b23033442f7d57a32c267ad0c7d0d052429a47ece567e6d256cf734f141 "
66 license "Apache-2.0"
77
88 livecheck do
@@ -19,19 +19,30 @@ class Micronaut < Formula
1919 sha256 cellar : :any_skip_relocation , x86_64_linux : "b08eece94522458a6a4e6be11c4c312b7c4d67a799e29a376906e61051f9f720"
2020 end
2121
22- # Issue ref: https://github.com/micronaut-projects/micronaut-starter/issues/2848
23- depends_on "gradle@8" => :build
24- depends_on "openjdk@21"
22+ depends_on "graalvm" => :build
23+ depends_on "gradle" => :build
24+
25+ on_linux do
26+ depends_on "zlib-ng-compat"
27+ end
2528
2629 def install
27- ENV [ "JAVA_HOME" ] = Language ::Java . java_home ( "21" )
28- system "gradle" , "micronaut-cli:assemble" , "--exclude-task" , "test" , "--no-daemon"
30+ ENV [ "JAVA_HOME" ] = if OS . mac?
31+ Formula [ "graalvm" ] . opt_libexec /"graalvm.jdk/Contents/Home"
32+ else
33+ Formula [ "graalvm" ] . opt_libexec
34+ end
35+
36+ native_image_env = ENV . keys . grep ( /^HOMEBREW_/ ) . map { |key | "-E#{ key } " }
37+ ENV . prepend "NATIVE_IMAGE_OPTIONS" , native_image_env . join ( " " )
38+
39+ system "gradle" , "micronaut-cli:nativeCompile" , "--exclude-task" , "test" , "--no-daemon"
40+
41+ bin . install buildpath /"starter-cli/build/native/nativeCompile/mn"
2942
30- libexec . install "starter-cli/build/exploded/lib"
31- ( libexec /"bin" ) . install "starter-cli/build/exploded/bin/mn"
43+ system "gradle" , "micronaut-cli:buildCompletion" , "--exclude-task" , "test" , "--no-daemon"
3244
33- bash_completion . install "starter-cli/build/exploded/bin/mn_completion" => "mn"
34- ( bin /"mn" ) . write_env_script libexec /"bin/mn" , Language ::Java . overridable_java_home_env ( "21" )
45+ bash_completion . install buildpath /"starter-cli/build/bin/mn_completion" => "mn"
3546 end
3647
3748 test do
0 commit comments