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.
< a id = "#versions.get" > < / a >
2021-09-24 15:24:43 +00:00
2019-02-28 22:43:57 +00:00
## versions.get
< pre >
versions.get()
< / pre >
Returns the current Bazel version
2021-09-24 15:24:43 +00:00
2019-02-28 22:43:57 +00:00
2021-10-27 13:13:59 +00:00
< a id = "#versions.parse" > < / a >
2019-02-28 22:43:57 +00:00
## versions.parse
< pre >
versions.parse(< a href = "#versions.parse-bazel_version" > bazel_version< / a > )
< / pre >
Parses a version string into a 3-tuple of ints
int tuples can be compared directly using binary operators (< , >).
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
| :------------- | :------------- | :------------- |
| < a id = "versions.parse-bazel_version" > < / a > bazel_version | the Bazel version string | none |
**RETURNS**
An int 3-tuple of a (major, minor, patch) version.
2021-09-24 15:24:43 +00:00
2021-10-27 13:13:59 +00:00
< a id = "#versions.check" > < / a >
2019-02-28 22:43:57 +00:00
## versions.check
< pre >
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 > )
< / pre >
Check that the version of Bazel is valid within the specified range.
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
| :------------- | :------------- | :------------- |
| < 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 | < code > None< / code > |
| < a id = "versions.check-bazel_version" > < / a > bazel_version | the version of Bazel to check. Used for testing, defaults to native.bazel_version | < code > None< / code > |
2021-09-24 15:24:43 +00:00
2021-10-27 13:13:59 +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
2021-10-27 13:13:59 +00:00
True if version < = threshold.
< a id = "#versions.is_at_least" > < / a >
2021-09-24 15:24:43 +00:00
2019-02-28 22:43:57 +00:00
## versions.is_at_least
< pre >
versions.is_at_least(< a href = "#versions.is_at_least-threshold" > threshold< / a > , < a href = "#versions.is_at_least-version" > version< / a > )
< / pre >
Check that a version is higher 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_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.
2019-02-28 22:43:57 +00:00