Skip to content

Commit b545387

Browse files
committed
micronaut: switch to graalvm
1 parent bb52a87 commit b545387

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

Formula/m/micronaut.rb

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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,31 @@ 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+
depends_on "openjdk@21" => :build # If someone reads that, this is a test ... hopefully
25+
26+
on_linux do
27+
depends_on "zlib-ng-compat"
28+
end
2529

2630
def install
27-
ENV["JAVA_HOME"] = Language::Java.java_home("21")
28-
system "gradle", "micronaut-cli:assemble", "--exclude-task", "test", "--no-daemon"
31+
ENV["JAVA_HOME"] = if OS.mac?
32+
Formula["graalvm"].opt_libexec/"graalvm.jdk/Contents/Home"
33+
else
34+
Formula["graalvm"].opt_libexec
35+
end
36+
37+
native_image_env = ENV.keys.grep(/^HOMEBREW_/).map { |key| "-E#{key}" }
38+
ENV.prepend "NATIVE_IMAGE_OPTIONS", native_image_env.join(" ")
39+
40+
system "gradle", "micronaut-cli:nativeCompile", "--exclude-task", "test", "--no-daemon"
41+
42+
bin.install buildpath/"starter-cli/build/native/nativeCompile/mn"
2943

30-
libexec.install "starter-cli/build/exploded/lib"
31-
(libexec/"bin").install "starter-cli/build/exploded/bin/mn"
44+
system "gradle", "micronaut-cli:buildCompletion", "--exclude-task", "test", "--no-daemon"
3245

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")
46+
bash_completion.install buildpath/"starter-cli/build/bin/mn_completion" => "mn"
3547
end
3648

3749
test do

0 commit comments

Comments
 (0)