files.new_contents: # Copyright 2012-2017 The Meson development team
  
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  
  #     http://www.apache.org/licenses/LICENSE-2.0
  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  import os, pickle, re, shlex, subprocess, sys
  from collections import OrderedDict
  from pathlib import PurePath
  
  from . import backends
  from .. import modules
  from .. import environment, mesonlib
  from .. import build
  from .. import mlog
  from .. import dependencies
  from .. import compilers
  from ..compilers import CompilerArgs
  from ..linkers import ArLinker
  from ..mesonlib import File, MesonException, OrderedSet
  from ..mesonlib import get_compiler_for_source
  from .backends import CleanTrees, InstallData
  from ..build import InvalidArguments
  
  if mesonlib.is_windows():
      quote_func = lambda s: '"{}"'.format(s)
      execute_wrapper = 'cmd /c'
      rmfile_prefix = 'del /f /s /q {} &&'
  else:
      quote_func = shlex.quote
      execute_wrapper = ''
      rmfile_prefix = 'rm -f {} &&'
  
  def ninja_quote(text, is_build_line=False):
      if is_build_line:
          qcs = ('$', ' ', ':')
      else:
          qcs = ('$', ' ')
      for char in qcs:
          text = text.replace(char,
  
  [... the rest is omitted ...]
files.new_path: mesonbuild/backend/ninjabackend.py
files.old_contents: # Copyright 2012-2017 The Meson development team
  
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  
  #     http://www.apache.org/licenses/LICENSE-2.0
  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  import os, pickle, re, shlex, subprocess, sys
  from collections import OrderedDict
  from pathlib import PurePath
  
  from . import backends
  from .. import modules
  from .. import environment, mesonlib
  from .. import build
  from .. import mlog
  from .. import dependencies
  from .. import compilers
  from ..compilers import CompilerArgs
  from ..linkers import ArLinker
  from ..mesonlib import File, MesonException, OrderedSet
  from ..mesonlib import get_compiler_for_source
  from .backends import CleanTrees, InstallData
  from ..build import InvalidArguments
  
  if mesonlib.is_windows():
      quote_func = lambda s: '"{}"'.format(s)
      execute_wrapper = 'cmd /c'
      rmfile_prefix = 'del /f /s /q {} &&'
  else:
      quote_func = shlex.quote
      execute_wrapper = ''
      rmfile_prefix = 'rm -f {} &&'
  
  def ninja_quote(text, is_build_line=False):
      if is_build_line:
          qcs = ('$', ' ', ':')
      else:
          qcs = ('$', ' ')
      for char in qcs:
          text = text.replace(char,
  
  [... the rest is omitted ...]
files.old_path: mesonbuild/backend/ninjabackend.py
files.new_contents: # Copyright 2012-2017 The Meson development team
  
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  
  #     http://www.apache.org/licenses/LICENSE-2.0
  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  import copy, os, re
  from collections import OrderedDict
  import itertools, pathlib
  
  from . import environment
  from . import dependencies
  from . import mlog
  from .mesonlib import File, MesonException, listify, extract_as_list
  from .mesonlib import typeslistify, stringlistify, classify_unity_sources
  from .mesonlib import get_filenames_templates_dict, substitute_values
  from .mesonlib import for_windows, for_darwin, for_cygwin, for_android
  from .compilers import is_object, clike_langs, sort_clike, lang_suffixes
  
  known_basic_kwargs = {'install': True,
                        'c_pch': True,
                        'cpp_pch': True,
                        'c_args': True,
                        'objc_args': True,
                        'objcpp_args': True,
                        'cpp_args': True,
                        'cs_args': True,
                        'vala_args': True,
                        'fortran_args': True,
                        'd_args': True,
                        'd_import_dirs': True,
                        'd_unittest': True,
                        'd_module_versions': True,
                        'java_args': True,
                        'rust_args': True,
                       
  
  [... the rest is omitted ...]
files.new_path: mesonbuild/build.py
files.old_contents: # Copyright 2012-2017 The Meson development team
  
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  
  #     http://www.apache.org/licenses/LICENSE-2.0
  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  import copy, os, re
  from collections import OrderedDict
  import itertools, pathlib
  
  from . import environment
  from . import dependencies
  from . import mlog
  from .mesonlib import File, MesonException, listify, extract_as_list
  from .mesonlib import typeslistify, stringlistify, classify_unity_sources
  from .mesonlib import get_filenames_templates_dict, substitute_values
  from .mesonlib import for_windows, for_darwin, for_cygwin, for_android
  from .compilers import is_object, clike_langs, sort_clike, lang_suffixes
  
  known_basic_kwargs = {'install': True,
                        'c_pch': True,
                        'cpp_pch': True,
                        'c_args': True,
                        'objc_args': True,
                        'objcpp_args': True,
                        'cpp_args': True,
                        'cs_args': True,
                        'vala_args': True,
                        'fortran_args': True,
                        'd_args': True,
                        'd_import_dirs': True,
                        'd_unittest': True,
                        'd_module_versions': True,
                        'java_args': True,
                        'rust_args': True,
                       
  
  [... the rest is omitted ...]
files.old_path: mesonbuild/build.py
files.new_contents: # Copyright 2012-2017 The Meson development team
  
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  
  #     http://www.apache.org/licenses/LICENSE-2.0
  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  import os.path, subprocess
  
  from ..mesonlib import EnvironmentException, version_compare
  
  from .compilers import (
      GCC_STANDARD,
      d_dmd_buildtype_args,
      d_gdc_buildtype_args,
      d_ldc_buildtype_args,
      get_gcc_soname_args,
      gnu_color_args,
      Compiler,
      CompilerArgs,
  )
  
  d_feature_args = {'gcc':  {'unittest': '-funittest',
                             'version': '-fversion',
                             'import_dir': '-J'
                             },
                    'llvm': {'unittest': '-unittest',
                             'version': '-d-version',
                             'import_dir': '-J'
                             },
                    'dmd':  {'unittest': '-unittest',
                             'version': '-version',
                             'import_dir': '-J'
                             }
                    }
  
  class DCompiler(Compiler):
      def __init__(self, exelist, version, is_cross, **kwargs):
          self.language = 'd'
          super().__init__(exelist, version, **kwargs)
          self.id = 'unknown'
          self.is_cross = is_cross
  
      def sanity_check(self, work_dir, environment):
          source_name = os.path
  
  [... the rest is omitted ...]
files.new_path: mesonbuild/compilers/d.py
files.old_contents: # Copyright 2012-2017 The Meson development team
  
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  
  #     http://www.apache.org/licenses/LICENSE-2.0
  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  import os.path, subprocess
  
  from ..mesonlib import EnvironmentException, version_compare
  
  from .compilers import (
      GCC_STANDARD,
      d_dmd_buildtype_args,
      d_gdc_buildtype_args,
      d_ldc_buildtype_args,
      get_gcc_soname_args,
      gnu_color_args,
      Compiler,
      CompilerArgs,
  )
  
  d_feature_args = {'gcc':  {'unittest': '-funittest',
                             'version': '-fversion',
                             'import_dir': '-J'
                             },
                    'llvm': {'unittest': '-unittest',
                             'version': '-d-version',
                             'import_dir': '-J'
                             },
                    'dmd':  {'unittest': '-unittest',
                             'version': '-version',
                             'import_dir': '-J'
                             }
                    }
  
  class DCompiler(Compiler):
      def __init__(self, exelist, version, is_cross, **kwargs):
          self.language = 'd'
          super().__init__(exelist, version, **kwargs)
          self.id = 'unknown'
          self.is_cross = is_cross
  
      def sanity_check(self, work_dir, environment):
          source_name = os.path
  
  [... the rest is omitted ...]
files.old_path: mesonbuild/compilers/d.py
files.new_contents: # Copyright 2012-2018 The Meson development team
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  
  #     http://www.apache.org/licenses/LICENSE-2.0
  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  from . import mparser
  from . import environment
  from . import coredata
  from . import dependencies
  from . import mlog
  from . import build
  from . import optinterpreter
  from . import compilers
  from .wrap import wrap, WrapMode
  from . import mesonlib
  from .mesonlib import FileMode, Popen_safe, listify, extract_as_list
  from .dependencies import ExternalProgram
  from .dependencies import InternalDependency, Dependency, DependencyException
  from .interpreterbase import InterpreterBase
  from .interpreterbase import check_stringlist, noPosargs, noKwargs, stringArgs, permittedKwargs
  from .interpreterbase import InterpreterException, InvalidArguments, InvalidCode
  from .interpreterbase import InterpreterObject, MutableInterpreterObject, Disabler
  from .modules import ModuleReturnValue
  
  import os, sys, shutil, uuid
  import re, shlex
  from collections import namedtuple
  from pathlib import PurePath
  
  import importlib
  
  
  def stringifyUserArguments(args):
      if isinstance(args, list):
          return '[%s]' % ', '.join([stringifyUserArguments(x) for x in args])
      elif isinstance(args, int):
          return str(args)
      elif
  
  [... the rest is omitted ...]
files.new_path: mesonbuild/interpreter.py
files.old_contents: # Copyright 2012-2018 The Meson development team
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
  # You may obtain a copy of the License at
  
  #     http://www.apache.org/licenses/LICENSE-2.0
  
  # Unless required by applicable law or agreed to in writing, software
  # distributed under the License is distributed on an "AS IS" BASIS,
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  # See the License for the specific language governing permissions and
  # limitations under the License.
  
  from . import mparser
  from . import environment
  from . import coredata
  from . import dependencies
  from . import mlog
  from . import build
  from . import optinterpreter
  from . import compilers
  from .wrap import wrap, WrapMode
  from . import mesonlib
  from .mesonlib import FileMode, Popen_safe, listify, extract_as_list
  from .dependencies import ExternalProgram
  from .dependencies import InternalDependency, Dependency, DependencyException
  from .interpreterbase import InterpreterBase
  from .interpreterbase import check_stringlist, noPosargs, noKwargs, stringArgs, permittedKwargs
  from .interpreterbase import InterpreterException, InvalidArguments, InvalidCode
  from .interpreterbase import InterpreterObject, MutableInterpreterObject, Disabler
  from .modules import ModuleReturnValue
  
  import os, sys, shutil, uuid
  import re, shlex
  from collections import namedtuple
  from pathlib import PurePath
  
  import importlib
  
  def stringifyUserArguments(args):
      if isinstance(args, list):
          return '[%s]' % ', '.join([stringifyUserArguments(x) for x in args])
      elif isinstance(args, int):
          return str(args)
      elif
  
  [... the rest is omitted ...]
files.old_path: mesonbuild/interpreter.py
files.new_contents: project('D Features', 'd')
  
  # ONLY FOR BACKWARDS COMPATIBILITY.
  # DO NOT DO THIS IN NEW CODE!
  # USE include_directories() INSTEAD OF BUILDING
  # STRINGS TO PATHS MANUALLY!
  data_dir = join_paths(meson.current_source_dir(), 'data')
  
  e_plain_bcompat = executable('dapp_menu_bcompat',
      'app.d',
      d_import_dirs: [data_dir]
  )
  test('dapp_menu_t_fail_bcompat', e_plain_bcompat, should_fail: true)
  test('dapp_menu_t_bcompat', e_plain_bcompat, args: ['menu'])
  
  # directory for data
  # This is the correct way to do this.
  data_dir = include_directories('data')
  
  e_plain = executable('dapp_menu',
      'app.d',
      d_import_dirs: [data_dir]
  )
  test('dapp_menu_t_fail', e_plain, should_fail: true)
  test('dapp_menu_t', e_plain, args: ['menu'])
  
  
  # test feature versions and string imports
  e_versions = executable('dapp_versions',
      'app.d',
      d_import_dirs: [data_dir],
      d_module_versions: ['No_Menu', 'With_People']
  )
  test('dapp_versions_t_fail', e_versions, args: ['menu'], should_fail: true)
  test('dapp_versions_t', e_versions, args: ['people'])
  
  # test everything and unittests
  e_test = executable('dapp_test',
      'app.d',
      d_import_dirs: [data_dir],
      d_module_versions: ['No_Menu', 'With_People'],
      d_unittest: true
  )
  test('dapp_test', e_test)
  
  
  [... the rest is omitted ...]
files.new_path: test cases/d/9 features/meson.build
files.old_contents: project('D Features', 'd')
  
  # directory for data
  data_dir = join_paths(meson.current_source_dir(), 'data')
  
  e_plain = executable('dapp_menu',
      'app.d',
      d_import_dirs: [data_dir]
  )
  test('dapp_menu_t_fail', e_plain, should_fail: true)
  test('dapp_menu_t', e_plain, args: ['menu'])
  
  # test feature versions and string imports
  e_versions = executable('dapp_versions',
      'app.d',
      d_import_dirs: [data_dir],
      d_module_versions: ['No_Menu', 'With_People']
  )
  test('dapp_versions_t_fail', e_versions, args: ['menu'], should_fail: true)
  test('dapp_versions_t', e_versions, args: ['people'])
  
  # test everything and unittests
  e_test = executable('dapp_test',
      'app.d',
      d_import_dirs: [data_dir],
      d_module_versions: ['No_Menu', 'With_People'],
      d_unittest: true
  )
  test('dapp_test', e_test)
  
  
  [... the rest is omitted ...]
files.old_path: test cases/d/9 features/meson.build