Skip to content

Commit

Permalink
update the formulat to add JAVA_HOME to the script env
Browse files Browse the repository at this point in the history
  • Loading branch information
cwensel committed Nov 5, 2024
1 parent e93d3cf commit 883e792
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/jreleaser/distributions/subpop/brew/formula.rb.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# {{jreleaserCreationStamp}}
{{#brewRequireRelative}}
require_relative "{{.}}"
{{/brewRequireRelative}}

class {{brewFormulaName}} < Formula
desc "{{projectDescription}}"
homepage "{{projectLinkHomepage}}"
url "{{distributionUrl}}"{{#brewDownloadStrategy}}, :using => {{.}}{{/brewDownloadStrategy}}
version "{{projectVersion}}"
sha256 "{{distributionChecksumSha256}}"
license "{{projectLicense}}"

{{#brewHasLivecheck}}
livecheck do
{{#brewLivecheck}}
{{.}}
{{/brewLivecheck}}
end
{{/brewHasLivecheck}}
{{#brewDependencies}}
depends_on {{.}}
{{/brewDependencies}}

def install
libexec.install Dir["*"]
(bin/"{{distributionExecutableName}}").write_env_script libexec/"bin/{{distributionExecutableUnix}}", JAVA_HOME: Formula["openjdk@21"].opt_prefix
end

test do
output = shell_output("#{bin}/{{distributionExecutableName}} --version")
assert_match "{{projectVersion}}", output
end
end

0 comments on commit 883e792

Please sign in to comment.