2021-09-24 15:24:43 +00:00
|
|
|
<!-- Generated with Stardoc: http://skydoc.bazel.build -->
|
|
|
|
|
2021-10-27 13:13:59 +00:00
|
|
|
Skylib module containing functions for checking Bazel versions.
|
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
<a id="versions.check"></a>
|
2021-09-24 15:24:43 +00:00
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
## versions.check
|
2019-02-28 22:43:57 +00:00
|
|
|
|
|
|
|
<pre>
|
2024-04-24 21:40:06 +00:00
|
|
|
versions.check(<a href="#versions.check-minimum_bazel_version">minimum_bazel_version</a>, <a href="#versions.check-maximum_bazel_version">maximum_bazel_version</a>, <a href="#versions.check-bazel_version">bazel_version</a>)
|
2019-02-28 22:43:57 +00:00
|
|
|
</pre>
|
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
Check that the version of Bazel is valid within the specified range.
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
**PARAMETERS**
|
2019-02-28 22:43:57 +00:00
|
|
|
|
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
| Name | Description | Default Value |
|
|
|
|
| :------------- | :------------- | :------------- |
|
|
|
|
| <a id="versions.check-minimum_bazel_version"></a>minimum_bazel_version | minimum version of Bazel expected | none |
|
|
|
|
| <a id="versions.check-maximum_bazel_version"></a>maximum_bazel_version | maximum version of Bazel expected | `None` |
|
|
|
|
| <a id="versions.check-bazel_version"></a>bazel_version | the version of Bazel to check. Used for testing, defaults to native.bazel_version | `None` |
|
2023-09-26 01:25:37 +00:00
|
|
|
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
<a id="versions.get"></a>
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
## versions.get
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
<pre>
|
|
|
|
versions.get()
|
|
|
|
</pre>
|
2021-10-27 13:13:59 +00:00
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
Returns the current Bazel version
|
2021-10-27 13:13:59 +00:00
|
|
|
|
2021-09-24 15:24:43 +00:00
|
|
|
|
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
<a id="versions.is_at_least"></a>
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
## versions.is_at_least
|
2019-02-28 22:43:57 +00:00
|
|
|
|
|
|
|
<pre>
|
2024-04-24 21:40:06 +00:00
|
|
|
versions.is_at_least(<a href="#versions.is_at_least-threshold">threshold</a>, <a href="#versions.is_at_least-version">version</a>)
|
2019-02-28 22:43:57 +00:00
|
|
|
</pre>
|
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
Check that a version is higher or equals to a threshold.
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2021-09-24 15:24:43 +00:00
|
|
|
**PARAMETERS**
|
|
|
|
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2021-09-24 15:24:43 +00:00
|
|
|
| Name | Description | Default Value |
|
2021-10-27 13:13:59 +00:00
|
|
|
| :------------- | :------------- | :------------- |
|
2024-04-24 21:40:06 +00:00
|
|
|
| <a id="versions.is_at_least-threshold"></a>threshold | the minimum version string | none |
|
|
|
|
| <a id="versions.is_at_least-version"></a>version | the version string to be compared to the threshold | none |
|
|
|
|
|
|
|
|
**RETURNS**
|
|
|
|
|
|
|
|
True if version >= threshold.
|
2021-09-24 15:24:43 +00:00
|
|
|
|
|
|
|
|
2022-08-30 18:57:34 +00:00
|
|
|
<a id="versions.is_at_most"></a>
|
2019-02-28 22:43:57 +00:00
|
|
|
|
|
|
|
## versions.is_at_most
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
versions.is_at_most(<a href="#versions.is_at_most-threshold">threshold</a>, <a href="#versions.is_at_most-version">version</a>)
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
Check that a version is lower or equals to a threshold.
|
|
|
|
|
2021-09-24 15:24:43 +00:00
|
|
|
**PARAMETERS**
|
|
|
|
|
|
|
|
|
|
|
|
| Name | Description | Default Value |
|
2021-10-27 13:13:59 +00:00
|
|
|
| :------------- | :------------- | :------------- |
|
|
|
|
| <a id="versions.is_at_most-threshold"></a>threshold | the maximum version string | none |
|
|
|
|
| <a id="versions.is_at_most-version"></a>version | the version string to be compared to the threshold | none |
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2021-10-27 13:13:59 +00:00
|
|
|
**RETURNS**
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
True if version <= threshold.
|
2021-10-27 13:13:59 +00:00
|
|
|
|
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
<a id="versions.parse"></a>
|
2021-09-24 15:24:43 +00:00
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
## versions.parse
|
2019-02-28 22:43:57 +00:00
|
|
|
|
|
|
|
<pre>
|
2024-04-24 21:40:06 +00:00
|
|
|
versions.parse(<a href="#versions.parse-bazel_version">bazel_version</a>)
|
2019-02-28 22:43:57 +00:00
|
|
|
</pre>
|
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
Parses a version string into a 3-tuple of ints
|
|
|
|
|
|
|
|
int tuples can be compared directly using binary operators (<, >).
|
|
|
|
|
|
|
|
For a development build of Bazel, this returns an unspecified version tuple
|
|
|
|
that compares higher than any released version.
|
|
|
|
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2021-09-24 15:24:43 +00:00
|
|
|
**PARAMETERS**
|
|
|
|
|
|
|
|
|
|
|
|
| Name | Description | Default Value |
|
2021-10-27 13:13:59 +00:00
|
|
|
| :------------- | :------------- | :------------- |
|
2024-04-24 21:40:06 +00:00
|
|
|
| <a id="versions.parse-bazel_version"></a>bazel_version | the Bazel version string | none |
|
2021-10-27 13:13:59 +00:00
|
|
|
|
|
|
|
**RETURNS**
|
|
|
|
|
2024-04-24 21:40:06 +00:00
|
|
|
An int 3-tuple of a (major, minor, patch) version.
|
2019-02-28 22:43:57 +00:00
|
|
|
|
|
|
|
|