From 9daa63d2b07f2b6993d4f2d436f065193227280d Mon Sep 17 00:00:00 2001 From: Viren Baraiya Date: Tue, 6 Dec 2022 14:52:58 -0800 Subject: [PATCH] add support compilation on m1 mac --- grpc/build.gradle | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/grpc/build.gradle b/grpc/build.gradle index b2f6d721b4..db778a83b6 100644 --- a/grpc/build.gradle +++ b/grpc/build.gradle @@ -36,9 +36,22 @@ dependencies { implementation "javax.annotation:javax.annotation-api:1.3.2" } +def artifactName = 'com.google.protobuf:protoc:3.14.0:osx-x86_64' +switch (org.gradle.internal.os.OperatingSystem.current()) { + case org.gradle.internal.os.OperatingSystem.LINUX: + artifactName = "com.google.protobuf:protoc:3.13.0" + break; + case org.gradle.internal.os.OperatingSystem.MAC_OS: + artifactName = "com.google.protobuf:protoc:3.14.0:osx-x86_64" + break; + case org.gradle.internal.os.OperatingSystem.WINDOWS: + artifactName = "com.google.protobuf:protoc:3.13.0" + break; +} + protobuf { protoc { - artifact = "com.google.protobuf:protoc:${revProtoBuf}" + artifact = artifactName } plugins { grpc {