Skip to content

Commit 883e792

Browse files
committed
update the formulat to add JAVA_HOME to the script env
1 parent e93d3cf commit 883e792

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# {{jreleaserCreationStamp}}
2+
{{#brewRequireRelative}}
3+
require_relative "{{.}}"
4+
{{/brewRequireRelative}}
5+
6+
class {{brewFormulaName}} < Formula
7+
desc "{{projectDescription}}"
8+
homepage "{{projectLinkHomepage}}"
9+
url "{{distributionUrl}}"{{#brewDownloadStrategy}}, :using => {{.}}{{/brewDownloadStrategy}}
10+
version "{{projectVersion}}"
11+
sha256 "{{distributionChecksumSha256}}"
12+
license "{{projectLicense}}"
13+
14+
{{#brewHasLivecheck}}
15+
livecheck do
16+
{{#brewLivecheck}}
17+
{{.}}
18+
{{/brewLivecheck}}
19+
end
20+
{{/brewHasLivecheck}}
21+
{{#brewDependencies}}
22+
depends_on {{.}}
23+
{{/brewDependencies}}
24+
25+
def install
26+
libexec.install Dir["*"]
27+
(bin/"{{distributionExecutableName}}").write_env_script libexec/"bin/{{distributionExecutableUnix}}", JAVA_HOME: Formula["openjdk@21"].opt_prefix
28+
end
29+
30+
test do
31+
output = shell_output("#{bin}/{{distributionExecutableName}} --version")
32+
assert_match "{{projectVersion}}", output
33+
end
34+
end

0 commit comments

Comments
 (0)