Skip to content
Snippets Groups Projects
Unverified Commit be046d73 authored by Adam J. Stewart's avatar Adam J. Stewart Committed by GitHub
Browse files

Bazel: add spack external find support (#18008)

parent 84a16e62
Branches
Tags
No related merge requests found
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
class Bazel(Package): class Bazel(Package):
"""Bazel is an open-source build and test tool similar to Make, Maven, and """Bazel is an open-source build and test tool similar to Make, Maven, and
...@@ -135,6 +137,14 @@ class Bazel(Package): ...@@ -135,6 +137,14 @@ class Bazel(Package):
phases = ['bootstrap', 'install'] phases = ['bootstrap', 'install']
executables = ['^bazel$']
@classmethod
def determine_version(cls, exe):
output = Executable(exe)('version', output=str, error=str)
match = re.search(r'Build label: ([\d.]+)', output)
return match.group(1) if match else None
def url_for_version(self, version): def url_for_version(self, version):
if version >= Version('0.4.1'): if version >= Version('0.4.1'):
url = 'https://github.com/bazelbuild/bazel/releases/download/{0}/bazel-{0}-dist.zip' url = 'https://github.com/bazelbuild/bazel/releases/download/{0}/bazel-{0}-dist.zip'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment