summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2019-05-16 10:51:14 -0700
committerJoshua Haberman <jhaberman@gmail.com>2019-05-16 10:51:14 -0700
commitf74cb51f113afcf579e60b74749cffffdf2a5f6a (patch)
tree702ae213197537eaedc691c8941c50e7f99a9ccc
parent240bf641de10a056a048b9b7fa0de811a39bb707 (diff)
Refactored workspace deps into a separate file.
-rw-r--r--WORKSPACE34
-rw-r--r--examples/bazel/WORKSPACE34
-rwxr-xr-xtools/make_cmakelists.py3
-rw-r--r--workspace_deps.bzl36
4 files changed, 43 insertions, 64 deletions
diff --git a/WORKSPACE b/WORKSPACE
index 74c41c5..63ccaab 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1,12 +1,9 @@
workspace(name = "upb")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
-load(":repository_defs.bzl", "bazel_version_repository")
+load("@upb//:workspace_deps.bzl", "upb_deps")
-bazel_version_repository(
- name = "bazel_version",
-)
+upb_deps()
http_archive(
name = "lua",
@@ -19,27 +16,6 @@ http_archive(
],
)
-git_repository(
- name = "com_google_protobuf",
- remote = "https://github.com/protocolbuffers/protobuf.git",
- commit = "d41002663fd04325ead28439dfd5ce2822b0d6fb",
-)
-
-http_archive(
- name = "zlib",
- build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
- sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
- strip_prefix = "zlib-1.2.11",
- urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
-)
-
-git_repository(
- name = "absl",
- commit = "070f6e47b33a2909d039e620c873204f78809492",
- remote = "https://github.com/abseil/abseil-cpp.git",
- shallow_since = "1541627663 -0500",
-)
-
http_archive(
name = "ragel",
build_file = "//:ragel.BUILD",
@@ -47,9 +23,3 @@ http_archive(
strip_prefix = "ragel-6.10",
urls = ["http://www.colm.net/files/ragel/ragel-6.10.tar.gz"],
)
-
-http_archive(
- name = "bazel_skylib",
- strip_prefix = "bazel-skylib-master",
- urls = ["https://github.com/bazelbuild/bazel-skylib/archive/master.tar.gz"],
-)
diff --git a/examples/bazel/WORKSPACE b/examples/bazel/WORKSPACE
index 01d3efd..ea03c0a 100644
--- a/examples/bazel/WORKSPACE
+++ b/examples/bazel/WORKSPACE
@@ -1,7 +1,6 @@
workspace(name = "upb_example")
-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
@@ -10,35 +9,6 @@ git_repository(
commit = "d5af87d06bbe3abad66970ce9c7ae0a7de8bb3c6",
)
-load("@upb//:repository_defs.bzl", "bazel_version_repository")
+load("@upb//:workspace_deps.bzl", "upb_deps")
-bazel_version_repository(
- name = "bazel_version",
-)
-
-git_repository(
- name = "absl",
- commit = "070f6e47b33a2909d039e620c873204f78809492",
- remote = "https://github.com/abseil/abseil-cpp.git",
- shallow_since = "1541627663 -0500",
-)
-
-git_repository(
- name = "com_google_protobuf",
- remote = "https://github.com/protocolbuffers/protobuf.git",
- commit = "d41002663fd04325ead28439dfd5ce2822b0d6fb",
-)
-
-http_archive(
- name = "bazel_skylib",
- strip_prefix = "bazel-skylib-master",
- urls = ["https://github.com/bazelbuild/bazel-skylib/archive/master.tar.gz"],
-)
-
-http_archive(
- name = "zlib",
- build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
- sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
- strip_prefix = "zlib-1.2.11",
- urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
-)
+upb_deps()
diff --git a/tools/make_cmakelists.py b/tools/make_cmakelists.py
index 44cd1b0..22f3757 100755
--- a/tools/make_cmakelists.py
+++ b/tools/make_cmakelists.py
@@ -178,6 +178,9 @@ class WorkspaceFileFunctions(object):
def bazel_version_repository(self, **kwargs):
pass
+ def upb_deps(self):
+ pass
+
class Converter(object):
def __init__(self):
diff --git a/workspace_deps.bzl b/workspace_deps.bzl
new file mode 100644
index 0000000..a77d584
--- /dev/null
+++ b/workspace_deps.bzl
@@ -0,0 +1,36 @@
+
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
+load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
+load("@upb//:repository_defs.bzl", "bazel_version_repository")
+
+def upb_deps():
+ bazel_version_repository(
+ name = "bazel_version",
+ )
+
+ git_repository(
+ name = "absl",
+ commit = "070f6e47b33a2909d039e620c873204f78809492",
+ remote = "https://github.com/abseil/abseil-cpp.git",
+ shallow_since = "1541627663 -0500",
+ )
+
+ git_repository(
+ name = "com_google_protobuf",
+ remote = "https://github.com/protocolbuffers/protobuf.git",
+ commit = "d41002663fd04325ead28439dfd5ce2822b0d6fb",
+ )
+
+ http_archive(
+ name = "bazel_skylib",
+ strip_prefix = "bazel-skylib-master",
+ urls = ["https://github.com/bazelbuild/bazel-skylib/archive/master.tar.gz"],
+ )
+
+ http_archive(
+ name = "zlib",
+ build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
+ sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
+ strip_prefix = "zlib-1.2.11",
+ urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
+ )
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback