blob: 1e7141471fde99bf3e6c94653d16c8ac4bf6fb54 [file] [log] [blame]
hsyed24d69a62018-08-10 12:38:35 +01001# 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.
hsyed97b1d492018-08-07 03:15:32 +010016#!/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
21WS_ROOT=$(bazel info workspace)
hsyeda4e902d2018-08-17 17:36:47 +010022PROTO_PATH=src/main/protobuf
hsyed97b1d492018-08-07 03:15:32 +010023JAR_DIR=${WS_ROOT}/${PROTO_PATH}/jars
24
25function 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
31build_lib "deps"
32build_lib "worker_protocol"
33build_lib "kotlin_model"
34
35chmod -R 0744 ${PROTO_PATH}/jars