aboutsummaryrefslogtreecommitdiff
path: root/docs/versions_doc.md
blob: d94076cb6c401dcef4ffe1500a49ad7c1aa5866a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
## versions.get

<pre>
versions.get()
</pre>

Returns the current Bazel version



## 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 (<, >).


### Parameters

<table class="params-table">
  <colgroup>
    <col class="col-param" />
    <col class="col-description" />
  </colgroup>
  <tbody>
    <tr id="versions.parse-bazel_version">
      <td><code>bazel_version</code></td>
      <td>
        required.
        <p>
          the Bazel version string
        </p>
      </td>
    </tr>
  </tbody>
</table>


## 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.

### Parameters

<table class="params-table">
  <colgroup>
    <col class="col-param" />
    <col class="col-description" />
  </colgroup>
  <tbody>
    <tr id="versions.check-minimum_bazel_version">
      <td><code>minimum_bazel_version</code></td>
      <td>
        required.
        <p>
          minimum version of Bazel expected
        </p>
      </td>
    </tr>
    <tr id="versions.check-maximum_bazel_version">
      <td><code>maximum_bazel_version</code></td>
      <td>
        optional. default is <code>None</code>
        <p>
          maximum version of Bazel expected
        </p>
      </td>
    </tr>
    <tr id="versions.check-bazel_version">
      <td><code>bazel_version</code></td>
      <td>
        optional. default is <code>None</code>
        <p>
          the version of Bazel to check. Used for testing, defaults to native.bazel_version
        </p>
      </td>
    </tr>
  </tbody>
</table>


## 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.

### Parameters

<table class="params-table">
  <colgroup>
    <col class="col-param" />
    <col class="col-description" />
  </colgroup>
  <tbody>
    <tr id="versions.is_at_most-threshold">
      <td><code>threshold</code></td>
      <td>
        required.
        <p>
          the maximum version string
        </p>
      </td>
    </tr>
    <tr id="versions.is_at_most-version">
      <td><code>version</code></td>
      <td>
        required.
        <p>
          the version string to be compared to the threshold
        </p>
      </td>
    </tr>
  </tbody>
</table>


## 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.

### Parameters

<table class="params-table">
  <colgroup>
    <col class="col-param" />
    <col class="col-description" />
  </colgroup>
  <tbody>
    <tr id="versions.is_at_least-threshold">
      <td><code>threshold</code></td>
      <td>
        required.
        <p>
          the minimum version string
        </p>
      </td>
    </tr>
    <tr id="versions.is_at_least-version">
      <td><code>version</code></td>
      <td>
        required.
        <p>
          the version string to be compared to the threshold
        </p>
      </td>
    </tr>
  </tbody>
</table>