update_crate_tests: Generate Bazel files

Bug: 190582745
Test: update_crate_tests.py in external/rust/crates/libc
Change-Id: If61239c5fe9ae3f8fc568eec906bf73baf603105
This commit is contained in:
Thiébaud Weksteen
2021-06-10 08:45:37 +02:00
parent 5212f8a43f
commit df132d6056

View File

@@ -67,11 +67,19 @@ class Bazel(object):
if platform.system() != 'Linux':
raise UpdaterException('This script has only been tested on Linux.')
self.path = os.path.join(env.ANDROID_BUILD_TOP, "tools", "bazel")
soong_ui = os.path.join(env.ANDROID_BUILD_TOP, "build", "soong", "soong_ui.bash")
os.chdir(env.ANDROID_BUILD_TOP)
print("Building Bazel Queryview. This can take a couple of minutes...")
cmd = "./build/soong/soong_ui.bash --build-mode --all-modules --dir=. queryview"
print("Generating Bazel files...")
cmd = [soong_ui, "--make-mode", "GENERATE_BAZEL_FILES=1", "nothing"]
try:
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
subprocess.check_output(cmd, stderr=subprocess.STDOUT, text=True)
except subprocess.CalledProcessError as e:
raise UpdaterException('Unable to generate bazel workspace: ' + e.output)
print("Building Bazel Queryview. This can take a couple of minutes...")
cmd = [soong_ui, "--build-mode", "--all-modules", "--dir=.", "queryview"]
try:
subprocess.check_output(cmd, stderr=subprocess.STDOUT, text=True)
except subprocess.CalledProcessError as e:
raise UpdaterException('Unable to update TEST_MAPPING: ' + e.output)
os.chdir(env.cwd)