Skip to content

Commit 5394065

Browse files
authored
Merge branch 'main' into disable-echo-cmd-copy-dir-file-windows
2 parents 1ab752b + 908bf14 commit 5394065

22 files changed

+158
-35
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
Release 1.3.0
2+
3+
**New Features**
4+
- Added `dicts.omit` and `dicts.pick` (#304)
5+
- Added `expand_template` rule (#330)
6+
- Added `subpackages` module (#348)
7+
- Added `copy_directory` rule (#366)
8+
- Added `bzlmod` support (#385)
9+
10+
**Incompatible Changes**
11+
- `native_binary` and `native_test` now use symlinks instead of copying, if
12+
the OS supports it (#340)
13+
- `native_binary` and `native_test` now build in target configuration instead
14+
of host configuration (#341)
15+
- `copy_file` no longer adds non-executables to `default_runfiles` (#326)
16+
17+
**Contributors**
18+
19+
Alex Eagle, Alexandre Rostovtsev, Barry McNamara, Derek Cormier, Fabian
20+
Meumertzheim, Geoffrey Martin-Noble, hchsiao, Kevin Kres, nickgooding,
21+
Vertexwahn, Vinh Tran
22+
23+
124
Release 1.2.1
225

326
Bugfix release: fixes build failure with --incompatible_disallow_empty_glob

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module(
22
name = "bazel_skylib",
33
compatibility_level = 1,
4-
version = "1.2.1",
4+
version = "1.3.0",
55
)
66

77
register_toolchains(

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ s = shell.quote(p)
6060

6161
* [analysis_test](docs/analysis_test_doc.md)
6262
* [build_test](docs/build_test_doc.md)
63+
* [common_settings](docs/common_settings_doc.md)
64+
* [copy_directory](docs/copy_directory_doc.md)
6365
* [copy_file](docs/copy_file_doc.md)
66+
* [diff_test](docs/diff_test_doc.md)
6467
* [expand_template](docs/expand_template_doc.md)
68+
* [native_binary and native_test](docs/native_binary_doc.md)
69+
* [run_binary](docs/run_binary_doc.md)
70+
* [select_file](docs/select_file_doc.md)
6571
* [write_file](docs/write_file_doc.md)
6672

6773
## Writing a new module

docs/BUILD

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,111 +3,139 @@ load("//docs/private:stardoc_with_diff_test.bzl", "stardoc_with_diff_test", "upd
33
licenses(["notice"])
44

55
stardoc_with_diff_test(
6+
name = "analysis_test",
67
bzl_library_target = "//rules:analysis_test",
78
out_label = "//docs:analysis_test_doc.md",
89
)
910

1011
stardoc_with_diff_test(
12+
name = "build_test",
1113
bzl_library_target = "//rules:build_test",
1214
out_label = "//docs:build_test_doc.md",
1315
)
1416

1517
stardoc_with_diff_test(
18+
name = "collections",
1619
bzl_library_target = "//lib:collections",
1720
out_label = "//docs:collections_doc.md",
1821
)
1922

2023
stardoc_with_diff_test(
24+
name = "common_settings",
2125
bzl_library_target = "//rules:common_settings",
2226
out_label = "//docs:common_settings_doc.md",
2327
)
2428

2529
stardoc_with_diff_test(
30+
name = "copy_directory",
2631
bzl_library_target = "//rules:copy_directory",
2732
out_label = "//docs:copy_directory_doc.md",
2833
)
2934

3035
stardoc_with_diff_test(
36+
name = "copy_file",
3137
bzl_library_target = "//rules:copy_file",
3238
out_label = "//docs:copy_file_doc.md",
3339
)
3440

3541
stardoc_with_diff_test(
42+
name = "dicts",
3643
bzl_library_target = "//lib:dicts",
3744
out_label = "//docs:dicts_doc.md",
3845
)
3946

4047
stardoc_with_diff_test(
48+
name = "diff_test",
4149
bzl_library_target = "//rules:diff_test",
4250
out_label = "//docs:diff_test_doc.md",
4351
)
4452

4553
stardoc_with_diff_test(
54+
name = "expand_template",
4655
bzl_library_target = "//rules:expand_template",
4756
out_label = "//docs:expand_template_doc.md",
4857
)
4958

5059
stardoc_with_diff_test(
60+
name = "native_binary",
5161
bzl_library_target = "//rules:native_binary",
5262
out_label = "//docs:native_binary_doc.md",
5363
)
5464

5565
stardoc_with_diff_test(
66+
name = "new_sets",
5667
bzl_library_target = "//lib:new_sets",
5768
out_label = "//docs:new_sets_doc.md",
5869
)
5970

6071
stardoc_with_diff_test(
72+
name = "partial",
6173
bzl_library_target = "//lib:partial",
6274
out_label = "//docs:partial_doc.md",
6375
)
6476

6577
stardoc_with_diff_test(
78+
name = "paths",
6679
bzl_library_target = "//lib:paths",
6780
out_label = "//docs:paths_doc.md",
6881
)
6982

7083
stardoc_with_diff_test(
84+
name = "run_binary",
7185
bzl_library_target = "//rules:run_binary",
7286
out_label = "//docs:run_binary_doc.md",
7387
)
7488

7589
stardoc_with_diff_test(
90+
name = "selects",
7691
bzl_library_target = "//lib:selects",
7792
out_label = "//docs:selects_doc.md",
7893
)
7994

8095
stardoc_with_diff_test(
96+
name = "select_file",
97+
bzl_library_target = "//rules:select_file",
98+
out_label = "//docs:select_file_doc.md",
99+
)
100+
101+
stardoc_with_diff_test(
102+
name = "shell",
81103
bzl_library_target = "//lib:shell",
82104
out_label = "//docs:shell_doc.md",
83105
)
84106

85107
stardoc_with_diff_test(
108+
name = "structs",
86109
bzl_library_target = "//lib:structs",
87110
out_label = "//docs:structs_doc.md",
88111
)
89112

90113
stardoc_with_diff_test(
114+
name = "subpackages",
91115
bzl_library_target = "//lib:subpackages",
92116
out_label = "//docs:subpackages_doc.md",
93117
)
94118

95119
stardoc_with_diff_test(
120+
name = "types",
96121
bzl_library_target = "//lib:types",
97122
out_label = "//docs:types_doc.md",
98123
)
99124

100125
stardoc_with_diff_test(
126+
name = "unittest",
101127
bzl_library_target = "//lib:unittest",
102128
out_label = "//docs:unittest_doc.md",
103129
)
104130

105131
stardoc_with_diff_test(
132+
name = "versions",
106133
bzl_library_target = "//lib:versions",
107134
out_label = "//docs:versions_doc.md",
108135
)
109136

110137
stardoc_with_diff_test(
138+
name = "write_file",
111139
bzl_library_target = "//rules:write_file",
112140
out_label = "//docs:write_file_doc.md",
113141
)

docs/build_test_doc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ Typical usage:
3636
| :------------- | :------------- | :------------- |
3737
| <a id="build_test-name"></a>name | The name of the test rule. | none |
3838
| <a id="build_test-targets"></a>targets | A list of targets to ensure build. | none |
39-
| <a id="build_test-kwargs"></a>kwargs | The &lt;a href="https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes-tests"&gt;common attributes for tests&lt;/a&gt;. | none |
39+
| <a id="build_test-kwargs"></a>kwargs | The &lt;a href="https://bazel.build/reference/be/common-definitions#common-attributes-tests"&gt;common attributes for tests&lt;/a&gt;. | none |
4040

4141

docs/common_settings_doc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ These rules return a BuildSettingInfo with the value of the build setting.
66
For label-typed settings, use the native label_flag and label_setting rules.
77

88
More documentation on how to use build settings at
9-
https://docs.bazel.build/versions/main/skylark/config.html#user-defined-build-settings
9+
https://bazel.build/extending/config#user-defined-build-settings
1010

1111

1212
<a id="bool_flag"></a>

docs/diff_test_doc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ The test succeeds if the files' contents match.
2828
| <a id="diff_test-file1"></a>file1 | Label of the file to compare to &lt;code&gt;file2&lt;/code&gt;. | none |
2929
| <a id="diff_test-file2"></a>file2 | Label of the file to compare to &lt;code&gt;file1&lt;/code&gt;. | none |
3030
| <a id="diff_test-failure_message"></a>failure_message | Additional message to log if the files' contents do not match. | <code>None</code> |
31-
| <a id="diff_test-kwargs"></a>kwargs | The &lt;a href="https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes-tests"&gt;common attributes for tests&lt;/a&gt;. | none |
31+
| <a id="diff_test-kwargs"></a>kwargs | The &lt;a href="https://bazel.build/reference/be/common-definitions#common-attributes-tests"&gt;common attributes for tests&lt;/a&gt;. | none |
3232

3333

docs/maintainers_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Name 1, Name 2, Name 3 (alphabetically from `git log`)
8282
can obtain them via `gcloud init`):
8383

8484
```
85-
gsutil cp bazel-bin/distro/bazel-skylib-$VERSION.tar.gz gs://bazel-mirror/github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-$VERSION.tar.gz
85+
gsutil cp bazel-bin/distribution/bazel-skylib-$VERSION.tar.gz gs://bazel-mirror/github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-$VERSION.tar.gz
8686
gsutil setmeta -h "Cache-Control: public, max-age=31536000" "gs://bazel-mirror/github.com/bazelbuild/bazel-skylib/releases/download/$VERSION/bazel-skylib-$VERSION.tar.gz"
8787
```
8888

docs/native_binary_doc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ in genrule.tools for example. You can also augment the binary with runfiles.
2929
| Name | Description | Type | Mandatory | Default |
3030
| :------------- | :------------- | :------------- | :------------- | :------------- |
3131
| <a id="native_binary-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
32-
| <a id="native_binary-data"></a>data | data dependencies. See https://docs.bazel.build/versions/main/be/common-definitions.html#typical.data | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
32+
| <a id="native_binary-data"></a>data | data dependencies. See https://bazel.build/reference/be/common-definitions#typical.data | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
3333
| <a id="native_binary-out"></a>out | An output name for the copy of the binary | String | required | |
3434
| <a id="native_binary-src"></a>src | path of the pre-built executable | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | required | |
3535

@@ -55,7 +55,7 @@ the binary with runfiles.
5555
| Name | Description | Type | Mandatory | Default |
5656
| :------------- | :------------- | :------------- | :------------- | :------------- |
5757
| <a id="native_test-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
58-
| <a id="native_test-data"></a>data | data dependencies. See https://docs.bazel.build/versions/main/be/common-definitions.html#typical.data | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
58+
| <a id="native_test-data"></a>data | data dependencies. See https://bazel.build/reference/be/common-definitions#typical.data | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
5959
| <a id="native_test-out"></a>out | An output name for the copy of the binary | String | required | |
6060
| <a id="native_test-src"></a>src | path of the pre-built executable | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | required | |
6161

docs/private/stardoc_with_diff_test.bzl

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
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+
115
"""Helpers for keeping stardoc documentation up-to-date.
216
317
These are currently a private API in bazel-skylib.
@@ -14,22 +28,23 @@ load("@bazel_skylib//rules:write_file.bzl", "write_file")
1428
load("@bazel_skylib//rules:diff_test.bzl", "diff_test")
1529

1630
def stardoc_with_diff_test(
31+
name,
1732
bzl_library_target,
1833
out_label):
1934
"""Creates a stardoc target coupled with a `diff_test` for a given `bzl_library`.
2035
2136
This is helpful for minimizing boilerplate in repos wih lots of stardoc targets.
2237
2338
Args:
39+
name: the stardoc target name
2440
bzl_library_target: the label of the `bzl_library` target to generate documentation for
2541
out_label: the label of the output MD file
2642
"""
27-
2843
out_file = out_label.replace("//", "").replace(":", "/")
2944

3045
# Generate MD from .bzl
3146
stardoc(
32-
name = out_file.replace("/", "_").replace(".md", "-docgen"),
47+
name = name,
3348
out = out_file.replace(".md", "-docgen.md"),
3449
input = bzl_library_target + ".bzl",
3550
deps = [bzl_library_target],

0 commit comments

Comments
 (0)