Browse Source

304c8527dd2afe95b8027de1e37c625914b755e0

pg 8 months ago
parent
commit
19f80c3320

+ 1 - 1
build/conf/proto.conf

@@ -561,7 +561,7 @@ macro GRPC() {
     PY_PROTO_PLUGIN(grpc_py _pb2_grpc.py contrib/tools/protoc/plugins/grpc_python DEPS contrib/python/grpcio)
 
     # Java
-    JAVA_PROTO_PLUGIN(grpc_java contrib/tools/protoc/plugins/grpc_java DEPS $JAVA_GRPC_STUB $JAVA_GRPC_PROTOBUF)
+    JAVA_PROTO_PLUGIN(grpc_java build/prebuilt/contrib/tools/protoc/plugins/grpc_java DEPS $JAVA_GRPC_STUB $JAVA_GRPC_PROTOBUF)
     SET_APPEND(JAVA_PROTOBUF_PEERS contrib/java/javax/annotation/javax.annotation-api/1.3.1)
 }
 

+ 19 - 0
build/prebuilt/contrib/tools/protoc/plugins/grpc_java/resources.json

@@ -0,0 +1,19 @@
+{
+    "by_platform": {
+        "darwin-arm64": {
+            "uri": "sbr:6538659252"
+        },
+        "darwin-x86_64": {
+            "uri": "sbr:6538635125"
+        },
+        "linux-x86_64": {
+            "uri": "sbr:6538599922"
+        },
+        "linux-aarch64": {
+            "uri": "sbr:6538555418"
+        },
+        "win32-x86_64": {
+            "uri": "sbr:6538717281"
+        }
+    }
+}

+ 5 - 0
build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make

@@ -0,0 +1,5 @@
+INCLUDE(ya.make.prebuilt)
+
+IF (NOT PREBUILT)
+    MESSAGE(FATAL_ERROR Unsupported host platform for prebuilt grpc_java tool)
+ENDIF()

+ 9 - 0
build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.prebuilt

@@ -0,0 +1,9 @@
+SET_RESOURCE_URI_FROM_JSON(SANDBOX_RESOURCE_URI ${ARCADIA_ROOT}/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/resources.json)
+ENABLE(PREBUILT)
+
+PREBUILT_PROGRAM()
+    IF (SANDBOX_RESOURCE_URI != "")
+        DECLARE_EXTERNAL_RESOURCE(GRPC_JAVA ${SANDBOX_RESOURCE_URI})
+        PRIMARY_OUTPUT(${GRPC_JAVA_RESOURCE_GLOBAL}/grpc_java${MODULE_SUFFIX})
+    ENDIF()
+END()

+ 1 - 7
contrib/tools/protoc/plugins/grpc_java/ya.make

@@ -1,10 +1,4 @@
-IF (USE_PREBUILT_TOOLS)
-    INCLUDE(${ARCADIA_ROOT}/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.prebuilt)
-ENDIF()
-
-IF (NOT PREBUILT)
-    INCLUDE(${ARCADIA_ROOT}/contrib/tools/protoc/plugins/grpc_java/bin/ya.make)
-ENDIF()
+INCLUDE(${ARCADIA_ROOT}/build/prebuilt/contrib/tools/protoc/plugins/grpc_java/ya.make.prebuilt)
 
 RECURSE(
     bin