1# Copyright 2020 Google LLC 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# https://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 15# Example workspace demonstrating how to embed Sandboxed API into a project 16# using Bazel. 17 18workspace(name = "com_google_sandboxed_api_hello") 19 20load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") 21load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") 22 23# Include the Sandboxed API dependency if it does not already exist in this 24# project. This ensures that this workspace plays well with other external 25# dependencies that might use Sandboxed API. 26maybe( 27 git_repository, 28 name = "com_google_sandboxed_api", 29 # This example depends on the latest master. In an embedding project, it 30 # is advisable to pin Sandboxed API to a specific revision instead. 31 # commit = "ba47adc21d4c9bc316f3c7c32b0faaef952c111e", # 2020-05-15 32 branch = "main", 33 remote = "https://github.com/google/sandboxed-api.git", 34) 35 36# From here on, Sandboxed API files are available. The statements below setup 37# transitive dependencies such as Abseil. Like above, those will only be 38# included if they don't already exist in the project. 39load( 40 "@com_google_sandboxed_api//sandboxed_api/bazel:sapi_deps.bzl", 41 "sapi_deps", 42) 43 44sapi_deps() 45 46# Need to separately setup Protobuf dependencies in order for the build rules 47# to work. 48load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") 49 50protobuf_deps() 51