-
Notifications
You must be signed in to change notification settings - Fork 0
/
WORKSPACE
96 lines (86 loc) · 4.24 KB
/
WORKSPACE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# -*- mode: python -*-
# vi: set ft=python :
# Copyright (c) 2018, Toyota Research Institute.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
workspace(name = "drake_gym")
DRAKE_COMMIT = "master"
DRAKE_CHECKSUM = ""
# Or choose a specific revision of Drake to use.
# DRAKE_COMMIT = "be4f658487f739ba04ec079de46f9459b719636d"
# DRAKE_CHECKSUM = "31ec8f87df3ceb6516de3c33a14c5d59ac5c003b4faf93ac526877d2e150b394"
#
# You can also use DRAKE_COMMIT to choose a Drake release; eg:
# DRAKE_COMMIT = "v0.15.0"
#
# Before changing the COMMIT, temporarily uncomment the next line so that Bazel
# displays the suggested new value for the CHECKSUM.
# DRAKE_CHECKSUM = "0" * 64
# Or to temporarily build against a local checkout of Drake, at the bash prompt
# set an environment variable before building:
# export EXAMPLES_LOCAL_DRAKE_PATH=/home/user/stuff/drake
# Load an environment variable.
load("//:environ.bzl", "environ_repository")
environ_repository(name = "environ", vars = ["EXAMPLES_LOCAL_DRAKE_PATH"])
load("@environ//:environ.bzl", EXAMPLES_LOCAL_DRAKE_PATH = "EXAMPLES_LOCAL_DRAKE_PATH")
# This declares the `@drake` repository as an http_archive from github,
# iff EXAMPLES_LOCAL_DRAKE_PATH is unset. When it is set, this declares a
# `@drake_ignored` package which is never referenced, and thus is ignored.
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "drake" if not EXAMPLES_LOCAL_DRAKE_PATH else "drake_ignored",
urls = [x.format(DRAKE_COMMIT) for x in [
"https://github.com/RobotLocomotion/drake/archive/{}.tar.gz",
]],
sha256 = DRAKE_CHECKSUM,
strip_prefix = "drake-{}".format(DRAKE_COMMIT.lstrip("v")),
)
# This declares the `@drake` repository as a local directory,
# iff EXAMPLES_LOCAL_DRAKE_PATH is set. When it is unset, this declares a
# `@drake_ignored` package which is never referenced, and thus is ignored.
local_repository(
name = "drake" if EXAMPLES_LOCAL_DRAKE_PATH else "drake_ignored",
path = EXAMPLES_LOCAL_DRAKE_PATH,
)
print("Using EXAMPLES_LOCAL_DRAKE_PATH={}".format(EXAMPLES_LOCAL_DRAKE_PATH)) if EXAMPLES_LOCAL_DRAKE_PATH else None # noqa
# Reference external software libraries, tools, and toolchains per Drake's
# defaults. Some software will come from the host system (Ubuntu or macOS);
# other software will be downloaded in source or binary form from GitHub or
# other sites.
load("@drake//tools/workspace:default.bzl", "add_default_workspace")
add_default_workspace()
# pip install the requirements.txt file into the bazel sandbox; this allows
# a `requirements(pkg)` entries in a `deps` lists to pull the individual pip
# package `pkg` into test scope.
load("@rules_python//python:pip.bzl", "pip_parse")
pip_parse(
name = "pip_deps",
requirements_lock = ":requirements.txt",
)
load("@pip_deps//:requirements.bzl", "install_deps")
install_deps()