Skip to content

Commit

Permalink
apache-pulsar: build with protoc-gen-grpc-java
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Nov 29, 2024
1 parent ce59103 commit 1e0f4c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Formula/a/apache-pulsar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ class ApachePulsar < Formula
end

depends_on "maven" => :build
depends_on arch: :x86_64 # https://github.com/grpc/grpc-java/issues/7690
depends_on "protoc-gen-grpc-java" => :build
depends_on "openjdk@21"

def install
# Avoid using pre-built `protoc-gen-grpc-java`
grpc_java_files = ["pulsar-client/pom.xml", "pulsar-functions/proto/pom.xml"]
plugin_artifact = "io.grpc:protoc-gen-grpc-java:${protoc-gen-grpc-java.version}:exe:${os.detected.classifier}"
inreplace grpc_java_files, %r{<pluginArtifact>#{Regexp.escape(plugin_artifact)}\s*</pluginArtifact>}, ""

java_home_env = Language::Java.java_home_env("21")
with_env(TMPDIR: buildpath, **java_home_env) do
system "mvn", "clean", "package", "-DskipTests", "-Pcore-modules"
Expand Down

0 comments on commit 1e0f4c3

Please sign in to comment.