From ab6506c674f71e51c2f3ebaeb2e1feeef0cadfda Mon Sep 17 00:00:00 2001 From: Julie <30670028+juliexxia@users.noreply.github.com> Date: Wed, 16 Dec 2020 13:38:44 -0800 Subject: [PATCH] Add a helper getter method for common settings --- rules/common_settings.bzl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rules/common_settings.bzl b/rules/common_settings.bzl index e80ab09..edda079 100644 --- a/rules/common_settings.bzl +++ b/rules/common_settings.bzl @@ -98,3 +98,7 @@ string_setting = rule( }, doc = "A string-typed build setting that cannot be set on the command line", ) + +# Extracts the value from an attribute that returns BuildSettingInfo +def get_build_setting_value(build_setting_attr): + return build_setting_attr[BuildSettingInfo].value