Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade stardoc to 0.6.2 #276

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ tasks:
name: "Latest Bazel"
bazel: latest
<<: *common
build_flags:
# Bazel 6.x has dependencies that produce warnings now
# TODO: Remove once latest is Bazel 7+
- "--features=-treat_warnings_as_errors"
test_flags:
# Bazel 6.x has dependencies that produce warnings now
# TODO: Remove once latest is Bazel 7+
- "--features=-treat_warnings_as_errors"

macos_latest_bzlmod:
name: "Current LTS using bzlmod"
Expand All @@ -35,8 +43,14 @@ tasks:
- "-//doc/..."
build_flags:
- "--enable_bzlmod"
# Bazel 6.x has dependencies that produce warnings now
# TODO: Remove once latest is Bazel 7+
- "--features=-treat_warnings_as_errors"
test_flags:
- "--enable_bzlmod"
# Bazel 6.x has dependencies that produce warnings now
# TODO: Remove once latest is Bazel 7+
- "--features=-treat_warnings_as_errors"

macos_last_green:
name: "Last Green Bazel"
Expand All @@ -51,6 +65,14 @@ tasks:
# has landed on them breaking this project.
- .bazelci/update_workspace_to_deps_heads.sh
<<: *common
build_flags:
# Bazel 6.x has dependencies that produce warnings now
# TODO: Remove once latest is Bazel 7+
- "--features=-treat_warnings_as_errors"
test_flags:
# Bazel 6.x has dependencies that produce warnings now
# TODO: Remove once latest is Bazel 7+
- "--features=-treat_warnings_as_errors"

linux_latest:
name: "Current LTS on Linux"
Expand Down
7 changes: 6 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ module(
bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "platforms", version = "0.0.7")

bazel_dep(name = "stardoc", version = "0.5.3", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(
name = "stardoc",
version = "0.6.2",
dev_dependency = True,
repo_name = "io_bazel_stardoc",
)

apple_cc_configure = use_extension("//crosstool:setup.bzl", "apple_cc_configure_extension")
use_repo(apple_cc_configure, "local_config_apple_cc", "local_config_apple_cc_toolchains")
Expand Down
26 changes: 23 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,29 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_stardoc",
sha256 = "c9794dcc8026a30ff67cf7cf91ebe245ca294b20b071845d12c192afe243ad72",
sha256 = "62bd2e60216b7a6fec3ac79341aa201e0956477e7c8f6ccc286f279ad1d96432",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz",
"https://github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz",
"https://github.com/bazelbuild/stardoc/releases/download/0.6.2/stardoc-0.6.2.tar.gz",
],
)

load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories")

stardoc_repositories()

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")

rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")

rules_jvm_external_setup()

load("@io_bazel_stardoc//:deps.bzl", "stardoc_external_deps")

stardoc_external_deps()

load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_install")

stardoc_pinned_maven_install()
37 changes: 15 additions & 22 deletions doc/rules.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<!-- Generated with Stardoc, Do Not Edit! -->


# Helper rules for Apple platforms

On this page:

* [apple_genrule](#apple_genrule)
* [toolchain_substitution](#toolchain_substitution)
* [universal_binary](#universal_binary)

<a id="#apple_genrule"></a>
<a id="apple_genrule"></a>

## apple_genrule

<pre>
apple_genrule(<a href="#apple_genrule-name">name</a>, <a href="#apple_genrule-cmd">cmd</a>, <a href="#apple_genrule-executable">executable</a>, <a href="#apple_genrule-message">message</a>, <a href="#apple_genrule-no_sandbox">no_sandbox</a>, <a href="#apple_genrule-outs">outs</a>, <a href="#apple_genrule-srcs">srcs</a>, <a href="#apple_genrule-tools">tools</a>)
apple_genrule(<a href="#apple_genrule-name">name</a>, <a href="#apple_genrule-srcs">srcs</a>, <a href="#apple_genrule-outs">outs</a>, <a href="#apple_genrule-cmd">cmd</a>, <a href="#apple_genrule-executable">executable</a>, <a href="#apple_genrule-message">message</a>, <a href="#apple_genrule-no_sandbox">no_sandbox</a>, <a href="#apple_genrule-tools">tools</a>)
</pre>

Genrule which provides Apple specific environment and make variables.
Expand Down Expand Up @@ -65,31 +63,29 @@ NOTE: `DEVELOPER_DIR` and `SDKROOT` are environment variables and *not* make
variables. To refer to them in `cmd` you must use environment variable
syntax (i.e. using `$$`). Example: ```cmd = "xcrun --sdkroot $$SDKROOT clang...```


**ATTRIBUTES**


| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="apple_genrule-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="apple_genrule-cmd"></a>cmd | The command to run. Subject the variable substitution. | String | required | |
| <a id="apple_genrule-executable"></a>executable | Declare output to be executable. Setting this flag to 1 means the output is an executable file and can be run using the run command. The genrule must produce exactly one output in this case. | Boolean | optional | False |
| <a id="apple_genrule-message"></a>message | A progress message to be reported as the rule runs. | String | optional | "" |
| <a id="apple_genrule-no_sandbox"></a>no_sandbox | If the sandbox should be disabled when the action is run. | Boolean | optional | False |
| <a id="apple_genrule-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="apple_genrule-srcs"></a>srcs | A list of inputs for this rule, such as source files to process. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |
| <a id="apple_genrule-outs"></a>outs | A list of files generated by this rule. If the executable flag is set, outs must contain exactly one label. | List of labels | required | |
| <a id="apple_genrule-srcs"></a>srcs | A list of inputs for this rule, such as source files to process. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
| <a id="apple_genrule-tools"></a>tools | A list of tool dependencies for this rule, they will be available when the action is run. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
| <a id="apple_genrule-cmd"></a>cmd | The command to run. Subject the variable substitution. | String | required | |
| <a id="apple_genrule-executable"></a>executable | Declare output to be executable. Setting this flag to 1 means the output is an executable file and can be run using the run command. The genrule must produce exactly one output in this case. | Boolean | optional | `False` |
| <a id="apple_genrule-message"></a>message | A progress message to be reported as the rule runs. | String | optional | `""` |
| <a id="apple_genrule-no_sandbox"></a>no_sandbox | If the sandbox should be disabled when the action is run. | Boolean | optional | `False` |
| <a id="apple_genrule-tools"></a>tools | A list of tool dependencies for this rule, they will be available when the action is run. | <a href="https://bazel.build/concepts/labels">List of labels</a> | optional | `[]` |


<a id="#toolchain_substitution"></a>
<a id="toolchain_substitution"></a>

## toolchain_substitution

<pre>
toolchain_substitution(<a href="#toolchain_substitution-name">name</a>, <a href="#toolchain_substitution-src">src</a>, <a href="#toolchain_substitution-var_name">var_name</a>)
</pre>


Register a subsitution, from a variable to a file, for use in arguments in a
target's attributes. Useful for passing custom tools to a compile or link.

Expand All @@ -112,39 +108,36 @@ ios_application(
)
```


**ATTRIBUTES**


| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="toolchain_substitution-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="toolchain_substitution-src"></a>src | Source file to substitute | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | required | |
| <a id="toolchain_substitution-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="toolchain_substitution-src"></a>src | Source file to substitute | <a href="https://bazel.build/concepts/labels">Label</a> | required | |
| <a id="toolchain_substitution-var_name"></a>var_name | Name of the variable to substitute, ex: FOO | String | required | |


<a id="#universal_binary"></a>
<a id="universal_binary"></a>

## universal_binary

<pre>
universal_binary(<a href="#universal_binary-name">name</a>, <a href="#universal_binary-binary">binary</a>)
</pre>


This rule produces a multi-architecture ("fat") binary targeting Apple macOS
platforms *regardless* of the architecture of the macOS host platform. The
`lipo` tool is used to combine built binaries of multiple architectures. For
non-macOS platforms, this simply just creates a symbolic link of the input
binary.


**ATTRIBUTES**


| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="universal_binary-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="universal_binary-binary"></a>binary | Target to generate a 'fat' binary from. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | required | |
| <a id="universal_binary-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="universal_binary-binary"></a>binary | Target to generate a 'fat' binary from. | <a href="https://bazel.build/concepts/labels">Label</a> | required | |