Skip to content

Deprecations

kronenthaler edited this page Dec 17, 2016 · 2 revisions

Moving from version 1.3.1 to 2.0.0 some major changes were introduced. Some of this changes made existing API obsolete, some of this changes were made to make the API clearer (private/public) and some changes were made to remove ambiguous implementations. For some of the changes mentioned above there are alternatives, in some cases, the new API is simply more powerful and but the old API is kept as a temporary backwards-compatible solution.

Note: The list below is limited to the methods of the XcodeProject class.

What is deprecated and will be soon removed?

All deprecated methods are conveniently placed in the file at pbxproj.pbxextensions.Deprecations.py

All these deprecated methods give a warning when used. If you receive such warning, take a look at what alternative method is being called in the Deprecations.py file and replace your call with it.

  • Load(cls, path, pure_python=False)
  • remove_group(self, group_id, recursive=True)
  • add_run_script_all_targets(self, script=None)
  • add_single_valued_flag(self, flag, value, configuration='All')
  • remove_single_valued_flag(self, flag, configuration='All')
  • add_flags(self, pairs, configuration='All')
  • remove_flags(self, pairs, configuration='All')
  • get_groups_by_os_path(self, path)
  • get_files_by_os_path(self, os_path, tree='SOURCE_ROOT')
  • remove_file(self, file_id, recursive=True)
  • get_file_id_by_path(self, path)
  • get_keys_for_files_by_name(self, name)
  • get_build_files(self, file_id)
  • get_build_phases(self, phase_name)
  • add_file_if_doesnt_exist(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False, ignore_unknown_type=False, target=None)

What changed?

Some methods names were correct on what they do, but some parameters were either missing or reorganized to make clearer the purpose of the method.

  • add_file(self, f_path, parent=None, tree='SOURCE_ROOT', create_build_files=True, weak=False, ignore_unknown_type=False, target=None): parameters changed.
  • add_flags(self, pairs, configuration='All'): parameters changed.
  • backup(self, file_name=None, backup_name=None): parameters changed.
  • add_run_script(self, target, script=None, insert_before_compile=False) : parameters changed.
  • add_folder(self, os_path, parent=None, excludes=None, recursive=True, create_build_files=True): parameters changed.
  • path_leaf(self, path): made private.
  • save(self, file_name=None, old_format=False, sort=False): parameters changed.
  • get_obj(self, id): renamed to get_object

What was removed?

Some methods made no longer sense or fulfill any purpose so they were completely removed from the project.

  • addslashes(cls, s): It was for internal use only. No longer needed.
  • apply_mods(self, mod_dict, default_path=None): Not implemented.
  • apply_patch(self, patch_path, xcode_path): Not implemented.
  • check_and_repair_framework(self, base): Only make sense for old style frameworks.
  • get_relative_path(self, os_path): It was for internal use only. No longer needed.
  • LoadFromXML(cls, path): No longer supported by Xcode.
  • move_file(self, id, dest_grp=None): Not implemented.
  • _printNewXCodeFormat(self, out, root, deep, enters=True, sort=False): This is the only way to save the project.
  • save_format_xml(self, file_name=None): XML is no longer supported.
  • save_new_format(self, file_name=None, sort=False): Single format supported. No longer needed
  • verify_files(self, file_list, parent=None): It was for internal use only. No longer needed.