• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2022 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
15load("//:version.bzl", "version")
16load("@rules_pkg//pkg:pkg.bzl", "pkg_tar")
17load("@rules_pkg//pkg/releasing:defs.bzl", "print_rel_notes")
18
19package(
20    default_visibility = ["//visibility:public"],
21    default_applicable_licenses = ["//:license"],
22)
23
24licenses(["notice"])
25
26alias(
27    name = "distro",
28    actual = "rules_license-%s" % version,
29)
30
31# Build the artifact to put on the github release page.
32pkg_tar(
33    name = "rules_license-%s" % version,
34    srcs = [
35        ":small_workspace",
36        "//:standard_package",
37        "//licenses/generic:standard_package",
38        "//licenses/spdx:standard_package",
39        "//rules:standard_package",
40        "//rules_gathering:standard_package",
41        "//rules/private:standard_package",
42        "//sample_reports:standard_package",
43        "//tools:standard_package",
44    ],
45    extension = "tar.gz",
46    # It is all source code, so make it read-only.
47    mode = "0444",
48    # Make it owned by root so it does not have the uid of the CI robot.
49    owner = "0.0",
50    package_dir = ".",
51    strip_prefix = ".",
52    tags = [
53        "no_windows",
54    ],
55)
56
57genrule(
58    name = "small_workspace",
59    srcs = ["//:WORKSPACE"],
60    outs = ["WORKSPACE"],
61    cmd = "sed -e '/### INTERNAL ONLY/,$$d' $(location //:WORKSPACE) >$@",
62    tags = [
63        "no_windows",
64    ],
65)
66
67print_rel_notes(
68    name = "relnotes",
69    outs = ["relnotes.txt"],
70    mirror_host = "mirror.bazel.build",
71    org = "bazelbuild",
72    repo = "rules_license",
73    version = version,
74)
75