hsyed | 24d69a6 | 2018-08-10 12:38:35 +0100 | [diff] [blame] | 1 | # Copyright 2018 The Bazel Authors. All rights reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | #!/usr/bin/env bash |
| 15 | # Note: Written on a mac please make it compatible with linux if needed. |
hsyed | 97b1d49 | 2018-08-07 03:15:32 +0100 | [diff] [blame] | 16 | #!/usr/bin/env bash |
| 17 | |
| 18 | # The script precompiles the ptoto deps. If this isn't used the client workspaces would have a dependency on protoc. |
| 19 | # If (when) Bazel distributes a host protoc this file can be removed. |
| 20 | |
| 21 | WS_ROOT=$(bazel info workspace) |
hsyed | a4e902d | 2018-08-17 17:36:47 +0100 | [diff] [blame] | 22 | PROTO_PATH=src/main/protobuf |
hsyed | 97b1d49 | 2018-08-07 03:15:32 +0100 | [diff] [blame] | 23 | JAR_DIR=${WS_ROOT}/${PROTO_PATH}/jars |
| 24 | |
| 25 | function build_lib() { |
| 26 | bazel build //${PROTO_PATH}:$1_java_proto |
| 27 | local FILE=lib$1_proto-speed.jar |
| 28 | cp ${WS_ROOT}/bazel-bin/${PROTO_PATH}/${FILE} ${JAR_DIR}/${FILE} |
| 29 | } |
| 30 | |
| 31 | build_lib "deps" |
| 32 | build_lib "worker_protocol" |
| 33 | build_lib "kotlin_model" |
| 34 | |
| 35 | chmod -R 0744 ${PROTO_PATH}/jars |