From 3fb9311d1066fb0a073b1b27154ba58a0691f4b4 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 10 Feb 2021 12:43:41 -0500 Subject: [PATCH] Remove ConfigureFile and ConfigureFileHolder They are not used anywhere. --- mesonbuild/build.py | 26 -------------------------- mesonbuild/interpreter.py | 21 +++++---------------- 2 files changed, 5 insertions(+), 42 deletions(-) diff --git a/mesonbuild/build.py b/mesonbuild/build.py index adba208fd..533375ea3 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -2588,32 +2588,6 @@ class CustomTargetIndex: def extract_all_objects_recurse(self): return self.target.extract_all_objects_recurse() -class ConfigureFile: - - def __init__(self, subdir, sourcename, targetname, configuration_data): - self.subdir = subdir - self.sourcename = sourcename - self.targetname = targetname - self.configuration_data = configuration_data - - def __repr__(self): - repr_str = "<{0}: {1} -> {2}>" - src = os.path.join(self.subdir, self.sourcename) - dst = os.path.join(self.subdir, self.targetname) - return repr_str.format(self.__class__.__name__, src, dst) - - def get_configuration_data(self): - return self.configuration_data - - def get_subdir(self): - return self.subdir - - def get_source_name(self): - return self.sourcename - - def get_target_name(self): - return self.targetname - class ConfigurationData: def __init__(self) -> None: super().__init__() diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 7c02631f7..2b7a36a5a 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -232,14 +232,6 @@ class RunProcess(InterpreterObject): def stderr_method(self, args, kwargs): return self.stderr -class ConfigureFileHolder(InterpreterObject, ObjectHolder[build.ConfigureFile]): - - def __init__(self, subdir, sourcename, targetname, configuration_data): - InterpreterObject.__init__(self) - obj = build.ConfigureFile(subdir, sourcename, targetname, configuration_data) - ObjectHolder.__init__(self, obj) - - class EnvironmentVariablesHolder(MutableInterpreterObject, ObjectHolder[build.EnvironmentVariables]): def __init__(self, initial_values=None, subproject: str = ''): MutableInterpreterObject.__init__(self) @@ -1925,7 +1917,7 @@ class MesonMain(InterpreterObject): def _process_script_args( self, name: str, args: T.List[T.Union[ str, mesonlib.File, CustomTargetHolder, - CustomTargetIndexHolder, ConfigureFileHolder, + CustomTargetIndexHolder, ExternalProgramHolder, ExecutableHolder, ]], allow_built: bool = False) -> T.List[str]: script_args = [] # T.List[str] @@ -1951,26 +1943,23 @@ class MesonMain(InterpreterObject): a.target.build_by_default = True else: a.build_by_default = True - elif isinstance(a, build.ConfigureFile): - new = True - script_args.append(os.path.join(a.subdir, a.targetname)) elif isinstance(a, ExternalProgram): script_args.extend(a.command) new = True else: raise InterpreterException( - 'Arguments to {} must be strings, Files, CustomTargets, ' - 'Indexes of CustomTargets, or ConfigureFiles'.format(name)) + 'Arguments to {} must be strings, Files, or CustomTargets, ' + 'Indexes of CustomTargets'.format(name)) if new: FeatureNew.single_use( 'Calling "{}" with File, CustomTaget, Index of CustomTarget, ' - 'ConfigureFile, Executable, or ExternalProgram'.format(name), + 'Executable, or ExternalProgram'.format(name), '0.55.0', self.interpreter.subproject) return script_args @FeatureNewKwargs('add_install_script', '0.57.0', ['skip_if_destdir']) @permittedKwargs({'skip_if_destdir'}) - def add_install_script_method(self, args: 'T.Tuple[T.Union[str, mesonlib.File, ExecutableHolder], T.Union[str, mesonlib.File, CustomTargetHolder, CustomTargetIndexHolder, ConfigureFileHolder], ...]', kwargs): + def add_install_script_method(self, args: 'T.Tuple[T.Union[str, mesonlib.File, ExecutableHolder], T.Union[str, mesonlib.File, CustomTargetHolder, CustomTargetIndexHolder], ...]', kwargs): if len(args) < 1: raise InterpreterException('add_install_script takes one or more arguments') if isinstance(args[0], mesonlib.File):