Merge pull request #57 from aiuto/lic

Add rules_license style declaration.
This commit is contained in:
aiuto 2023-02-09 11:03:33 -05:00 committed by GitHub
commit 829cd4bc1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 57 additions and 5 deletions

20
BUILD
View File

@ -1,8 +1,22 @@
package(default_visibility = ["//visibility:public"])
load("@rules_license//rules:license.bzl", "license")
licenses(["notice"])
package(
default_applicable_licenses = [":license"],
default_visibility = ["//visibility:public"],
)
exports_files(["LICENSE"])
license(
name = "license",
license_kinds = [
"@rules_license//licenses/spdx:Apache-2.0",
],
license_text = "LICENSE",
)
exports_files([
"LICENSE",
"MODULE.bazel",
])
filegroup(
name = "srcs",

View File

@ -1,5 +1,7 @@
module(
name = "platforms",
version = "0.0.6", # keep in sync with version.bzl
version = "0.0.7", # keep in sync with version.bzl
compatibility_level = 1,
)
bazel_dep(name = "rules_license", version = "0.0.4")

View File

@ -1 +1,12 @@
workspace(name = "platforms")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_license",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
"https://github.com/bazelbuild/rules_license/releases/download/0.0.4/rules_license-0.0.4.tar.gz",
],
sha256 = "6157e1e68378532d0241ecd15d3c45f6e5cfd98fc10846045509fb2a7cc9e381",
)

4
WORKSPACE.bzlmod Normal file
View File

@ -0,0 +1,4 @@
# Include dependencies which are only needed for development here.
#
# Even if this is empty, you need it with bzlmod enable to prevent
# bzlmod from bringing in WORKSPACE too.

21
tests/BUILD Normal file
View File

@ -0,0 +1,21 @@
load("//:version.bzl", "version")
package(default_visibility = ["//visibility:private"])
# This is a quick hack to make sure that version.bzl agrees with MODULE.bazel
# It only works from Linux, but that is sufficient, becuase we do a presubmit
# run linux, so we will still catch a mismatch.
genrule(
name = "versions_match",
outs = ["found_it"],
cmd = ";\n".join([
"""echo version: %s""" % version,
"""grep 'version = "%s",' $(location //:MODULE.bazel) >$(location :found_it)""" % version,
]),
target_compatible_with = [
"//os:linux",
],
tools = [
"//:MODULE.bazel",
],
)

View File

@ -13,4 +13,4 @@
# limitations under the License.
"""The version of bazelbuild/platforms."""
version = "0.0.6"
version = "0.0.7"