Xcоde

Xcode is a free macOS-only IDE. You can download it from the Mac App Store.

Импортирование проекта

  • From Xcode's main screen create a new project using the Other > External Build System template.

../../../_images/xcode_1_create_external_build_project.png
  • Open your build targets from the Targets section and select the Info tab.

  • Fill out the form with the following settings:

    Build Tool

    A full path to the scons executable, e.g. /usr/local/bin/scons

    Arguments

    See Введение в систему сборки for a full list of arguments.

    Directory

    A full path to the Godot root folder

../../../_images/xcode_2_configure_scons.png
  • Add a Command Line Tool target which will be used for indexing the project by choosing File > New > Target....

../../../_images/xcode_3_add_new_target.png
  • Select OS X > Application > Command Line Tool.

../../../_images/xcode_4_select_command_line_target.png

Примечание

Назовите его так, чтобы вы знали, что не нужно компилировать с этой целью (например, GodotXcodeIndex).

  • Для этой цели откройте вкладку Build Settings и найдите Header Search Paths.

  • Установите в Header Search Paths абсолютный путь к корневой папке Godot. Вам также нужно включить подкаталоги. Для этого добавьте две звездочки (**) в конец пути, например /Users/me/repos/godot-source/**.

  • Add the Godot source to the project by dragging and dropping it into the project file browser.

  • Снимите флажок Create external build system project.

../../../_images/xcode_5_after_add_godot_source_to_project.png
  • Далее выберите Создать группы (Create groups) для опции Добавленные папки (Added folders) и отметьте только (only) вашу цель индексирования командной строки в разделе Добавить в цели (Add to targets).

../../../_images/xcode_6_after_add_godot_source_to_project_2.png
  • Xcode will now index the files. This may take a few minutes.

  • Once Xcode is done indexing, you should have jump-to-definition, autocompletion, and full syntax highlighting.

Debugging the project

To enable debugging support you need to edit the external build target's build and run schemes.

  • Откройте редактор схемы внешней цели сборки.

  • Найдите раздел Build > Post Actions.

  • Add a new script run action

  • Under Provide build settings from select your project. This allows to reference the project directory within the script.

  • Создайте скрипт, который даст двоичному файлу имя, которое Xcode может распознать, например:

ln -f ${PROJECT_DIR}/godot/bin/godot.osx.tools.64 ${PROJECT_DIR}/godot/bin/godot
../../../_images/xcode_7_setup_build_post_action.png
  • Соберите внешнюю цель сборки.

  • Откройте редактор схем снова и выберите Run.

../../../_images/xcode_8_setup_run_scheme.png
  • Установите Executable на файл который вы присоединили к вашему скрипту сборки.

  • Проверьте Debug executable.

  • You can add two arguments on the Arguments tab: the -e flag opens the editor instead of the project manager, and the --path argument tells the executable to open the specified project (must be provided as an absolute path to the project root, not the project.godot file).

Чтобы проверить, что все работает, поместите точку останова в platform/osx/godot_main_osx.mm и запустите проект.

Если у вас возникнут какие-либо проблемы, обратитесь за помощью в один из каналов сообщества Godot.