CasperSecurity
o
p.a(, � @ sP d Z ddlZddlZddlZddlZddlZdd� Zdd� Z dd� Z
d 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
C sz t j�| �\}}|d }|d }|jrt j�|j|�}zt �|� W n ty; } z
|jtjkr1� W Y d}~nd}~ww d}| |fD ]} t j�t j� | ��d d }
t
jj�
d|
�}
|d|
7 }qB|d 7 }t j�|d
�}z)t|d��}|�� }
|
|kr� W d � W dS W d � n1 s�w Y W n ty� Y nw t|d��}|�|� W d � dS 1 s�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_file� r% �1/usr/lib/python3/dist-packages/gyp/xcode_ninja.py�_WriteWorkspace sF �������"�r'