xref: /aosp_15_r20/external/stardoc/setup.bzl (revision b2fa42943c124aa9c7163734493fc7a7559681cf)
1# Copyright 2019 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
15"""Repository external dependency resolution functions."""
16
17load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
18
19def _include_if_not_defined(repo_rule, name, **kwargs):
20    if not native.existing_rule(name):
21        repo_rule(name = name, **kwargs)
22
23def stardoc_repositories():
24    """Adds the external repositories used by the Starlark rules."""
25    _include_if_not_defined(
26        http_archive,
27        name = "bazel_skylib",
28        urls = [
29            "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz",
30            "https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz",
31        ],
32        sha256 = "f7be3474d42aae265405a592bb7da8e171919d74c16f082a5457840f06054728",
33    )
34    _include_if_not_defined(
35        http_archive,
36        name = "rules_java",
37        urls = [
38            "https://mirror.bazel.build/github.com/bazelbuild/rules_java/releases/download/4.0.0/rules_java-4.0.0.tar.gz",
39            "https://github.com/bazelbuild/rules_java/releases/download/4.0.0/rules_java-4.0.0.tar.gz",
40        ],
41        sha256 = "34b41ec683e67253043ab1a3d1e8b7c61e4e8edefbcad485381328c934d072fe",
42    )
43