From 2812b21de56c578ec552e182a071dbaa7f2463ee Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 20 Nov 2023 23:31:13 -0800 Subject: backend/ninja: use A dataclass for TargetDependencyScannerInfo --- mesonbuild/backend/ninjabackend.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index f7ba6468a..e808b0c92 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright 2012-2017 The Meson development team +# Copyright © 2023 Intel Corporation from __future__ import annotations @@ -134,10 +135,20 @@ Please report this error with a test case to the Meson bug tracker.''' raise MesonException(errmsg) return quote_re.sub(r'$\g<0>', text) + +@dataclass class TargetDependencyScannerInfo: - def __init__(self, private_dir: str, source2object: T.Dict[str, str]): - self.private_dir = private_dir - self.source2object = source2object + + """Information passed to the depscanner about a target. + + :param private_dir: The private scratch directory for the target. + :param source2object: A mapping of source file names to the objects that + will be created from them. + """ + + private_dir: str + source2object: T.Dict[str, str] + @unique class Quoting(Enum): -- cgit v1.2.3