Introducing LunaBuild to the build flow (#36)
[lunaix-os.git] / lunaix-os / scripts / build-tools / integration / lbuild_bridge.py
diff --git a/lunaix-os/scripts/build-tools/integration/lbuild_bridge.py b/lunaix-os/scripts/build-tools/integration/lbuild_bridge.py
new file mode 100644 (file)
index 0000000..7566670
--- /dev/null
@@ -0,0 +1,17 @@
+from lbuild.api import ConfigProvider
+from lcfg.common import LConfigEnvironment
+
+class LConfigProvider(ConfigProvider):
+    def __init__(self, lcfg_env: LConfigEnvironment) -> None:
+        super().__init__()
+        self.__env = lcfg_env
+
+    def configured_value(self, name):
+        return self.__env.lookup_value(name)
+    
+    def has_config(self, name):
+        try:
+            self.__env.lookup_value(name)
+            return True
+        except:
+            return False
\ No newline at end of file