Thomas Vachuska | 46848a8 | 2018-08-13 14:32:05 -0700 | [diff] [blame] | 1 | """ |
| 2 | Copyright 2018-present Open Networking Foundation |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | """ |
| 16 | |
| 17 | def check_bazel_version(): |
Ray Milkey | 5063f5b | 2018-08-15 16:22:30 -0700 | [diff] [blame] | 18 | if "bazel_version" not in dir(native): |
Carmelo Cascone | 21eb042 | 2019-06-17 12:00:33 -0700 | [diff] [blame] | 19 | fail("\nBazel version is too old; please use 0.27.* official release!\n\n") |
Ray Milkey | 5063f5b | 2018-08-15 16:22:30 -0700 | [diff] [blame] | 20 | elif not native.bazel_version: |
Carmelo Cascone | 21eb042 | 2019-06-17 12:00:33 -0700 | [diff] [blame] | 21 | print("\nBazel is not a release version; please use 0.27.* official release!\n\n") |
Ray Milkey | 5063f5b | 2018-08-15 16:22:30 -0700 | [diff] [blame] | 22 | return |
Thomas Vachuska | 46848a8 | 2018-08-13 14:32:05 -0700 | [diff] [blame] | 23 | |
Ray Milkey | f381442 | 2018-09-17 14:47:23 -0700 | [diff] [blame] | 24 | versions = native.bazel_version.split(".") |
Thomas Vachuska | 2bf2453 | 2019-10-14 15:41:45 -0700 | [diff] [blame] | 25 | if not int(versions[0]) >= 1: |
| 26 | fail("\nBazel version %s is not supported; please use 1.0.* official release!\n\n" % |
Ray Milkey | 5063f5b | 2018-08-15 16:22:30 -0700 | [diff] [blame] | 27 | native.bazel_version) |