�
�"Kb(, � �J � d Z ddlZddlZddlZddlZddlZd� Zd� Z d� Z
d� ZdS )a� Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project itself is transformed into a list of
executable targets, each with a build step to build with ninja, and a target
with every source and resource file. This appears to sidestep some of the
major performance headaches experienced using complex projects and large number
of targets within Xcode.
� Nc �� � t j � | � � \ }}|dz }|d }|j r%t j � |j |� � } t j |� � n-# t $ r }|j t j k r� Y d}~nd}~ww xY wd}| |fD ]v} t j � t j � | � � � � d dz }
t j j �
d|
z � � }
|d|
z z
}�w|d z
}t j � |d
� � } t |d� � 5 }|� � � }
|
|k r ddd� � dS ddd� � n# 1 swxY w Y n# t $ r Y nw xY wt |d� � 5 }|� |� � ddd� � dS # 1 swxY w Y dS )
z8 Create a workspace to wrap main and sources gyp paths. z.xcworkspace�optionsNzC<?xml version="1.0" encoding="UTF-8"?>
<Workspace version = "1.0">
r z
.xcodeprojzgroup:z$ <FileRef location = %s></FileRef>
z
</Workspace>
zcontents.xcworkspacedata�r�w)�os�path�splitext�generator_output�join�makedirs�OSError�errno�EEXIST�basename�xml�sax�saxutils� quoteattr�open�read�IOError�write)�main_gyp�sources_gyp�params�build_file_root�build_file_ext�workspace_pathr �e�
output_string�gyp_name�name�workspace_file�
input_file�input_string�output_files �1/usr/lib/python3/dist-packages/gyp/xcode_ninja.py�_WriteWorkspacer( s� � �&(�g�&6�&6�x�&@�&@�#�?�N�"�^�3�.��9��'��� L��W�\�\�'�":�N�K�K�N���K������� � � � ��w�%�,���� �������������2�-��[�)� D� D�h�
�7���B�G�,�,�X�6�6�7�7��:�\�I�D��7��%�%�h��o�6�6�D��<�t�C�C�M�M��#�#�-��7�<�<��0J�K�K�.� �
�n�c� "� "� �j��_�_�&�&�l� �� &� &��� � � � � � � � &�� � � � � � � � � � ���� � � � ���
� � � ��D� ���� �N�C� � � %�K����m�$�$�$�%� %� %� %� %� %� %� %� %� %� %� %���� %� %� %� %� %� %sf �A2 �2
B�<B�B�F �F�.F �<F �F�F �F�F �
F!� F!�4G�G�Gc � � d}d}|ry|d }t j � |j t j j � |� � � � }|� di � � � dd� � }| � d� � }| � d|� � }| � d� � }i }||d< |